diff --git a/retroshare-gui/src/gui/AboutDialog.cpp b/retroshare-gui/src/gui/AboutDialog.cpp index 72536797f..3d05e7a33 100644 --- a/retroshare-gui/src/gui/AboutDialog.cpp +++ b/retroshare-gui/src/gui/AboutDialog.cpp @@ -221,7 +221,7 @@ void AWidget::timerEvent(QTimerEvent* e) { page ^= 1; if (qrand() % 128 == 0) { - int r = 3 + qRound(qrand() * 4 / RAND_MAX); + int r = 3 + qRound((double) qrand() * 4 / RAND_MAX); int h = 300 + qrand() * 200 / RAND_MAX; int x = 1 + r + qrand()%(image1.width() -2*r-1); int y = 1 + r + qrand()%(image1.height()-2*r-1); diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp index fb62df515..71e449001 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp +++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp @@ -11,6 +11,7 @@ #include "notifyqt.h" #include "chat/ChatLobbyDialog.h" #include "util/HandleRichText.h" +#include "util/QtVersion.h" #include #include "retroshare/rsmsgs.h" @@ -83,10 +84,10 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags) headerItem->setTextAlignment(COLUMN_SUBSCRIBED, Qt::AlignHCenter | Qt::AlignVCenter); QHeaderView *header = lobbyTreeWidget->header(); - header->setResizeMode(COLUMN_NAME, QHeaderView::Interactive); - header->setResizeMode(COLUMN_USER_COUNT, QHeaderView::Interactive); - header->setResizeMode(COLUMN_TOPIC, QHeaderView::Interactive); - header->setResizeMode(COLUMN_SUBSCRIBED, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(header, COLUMN_NAME, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(header, COLUMN_USER_COUNT, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(header, COLUMN_TOPIC, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(header, COLUMN_SUBSCRIBED, QHeaderView::Interactive); privateSubLobbyItem = new RSTreeWidgetItem(compareRole, TYPE_FOLDER); privateSubLobbyItem->setText(COLUMN_NAME, tr("Private Subscribed Lobbies")); diff --git a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp index e70e5ed26..c4e8f566a 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp @@ -54,6 +54,7 @@ #include "util/misc.h" #include #include "TransferUserNotify.h" +#include "util/QtVersion.h" #include #include @@ -236,19 +237,19 @@ TransfersDialog::TransfersDialog(QWidget *parent) /* Set header resize modes and initial section sizes Downloads TreeView*/ QHeaderView * _header = ui.downloadList->header () ; - _header->setResizeMode (COLUMN_NAME, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_SIZE, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_COMPLETED, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_DLSPEED, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_PROGRESS, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_SOURCES, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_STATUS, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_PRIORITY, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_REMAINING, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_DOWNLOADTIME, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_ID, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_LASTDL, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_PATH, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_NAME, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_SIZE, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_COMPLETED, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_DLSPEED, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_PROGRESS, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_SOURCES, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_STATUS, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_PRIORITY, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_REMAINING, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_DOWNLOADTIME, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_ID, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_LASTDL, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_PATH, QHeaderView::Interactive); _header->resizeSection ( COLUMN_NAME, 170 ); _header->resizeSection ( COLUMN_SIZE, 70 ); @@ -299,13 +300,13 @@ TransfersDialog::TransfersDialog(QWidget *parent) /* Set header resize modes and initial section sizes Uploads TreeView*/ QHeaderView * upheader = ui.uploadsList->header () ; - upheader->setResizeMode (COLUMN_UNAME, QHeaderView::Interactive); - upheader->setResizeMode (COLUMN_USIZE, QHeaderView::Interactive); - upheader->setResizeMode (COLUMN_UTRANSFERRED, QHeaderView::Interactive); - upheader->setResizeMode (COLUMN_ULSPEED, QHeaderView::Interactive); - upheader->setResizeMode (COLUMN_UPROGRESS, QHeaderView::Interactive); - upheader->setResizeMode (COLUMN_USTATUS, QHeaderView::Interactive); - upheader->setResizeMode (COLUMN_USERNAME, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(upheader, COLUMN_UNAME, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(upheader, COLUMN_USIZE, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(upheader, COLUMN_UTRANSFERRED, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(upheader, COLUMN_ULSPEED, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(upheader, COLUMN_UPROGRESS, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(upheader, COLUMN_USTATUS, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(upheader, COLUMN_USERNAME, QHeaderView::Interactive); upheader->resizeSection ( COLUMN_UNAME, 190 ); upheader->resizeSection ( COLUMN_USIZE, 70 ); diff --git a/retroshare-gui/src/gui/ForumsDialog.cpp b/retroshare-gui/src/gui/ForumsDialog.cpp index c8f9f16a8..93576aee2 100644 --- a/retroshare-gui/src/gui/ForumsDialog.cpp +++ b/retroshare-gui/src/gui/ForumsDialog.cpp @@ -43,6 +43,7 @@ #include "notifyqt.h" #include "util/HandleRichText.h" #include "util/DateTime.h" +#include "util/QtVersion.h" #include #include @@ -154,7 +155,7 @@ ForumsDialog::ForumsDialog(QWidget *parent) /* Set header resize modes and initial section sizes */ QHeaderView * ttheader = ui.threadTreeWidget->header () ; - ttheader->setResizeMode (COLUMN_THREAD_TITLE, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(ttheader, COLUMN_THREAD_TITLE, QHeaderView::Interactive); ttheader->resizeSection (COLUMN_THREAD_DATE, 140); ttheader->resizeSection (COLUMN_THREAD_TITLE, 290); @@ -191,7 +192,7 @@ ForumsDialog::ForumsDialog(QWidget *parent) /* Set header sizes for the fixed columns and resize modes, must be set after processSettings */ ttheader->resizeSection (COLUMN_THREAD_READ, 24); - ttheader->setResizeMode (COLUMN_THREAD_READ, QHeaderView::Fixed); + QHeaderView_setSectionResizeMode(ttheader, COLUMN_THREAD_READ, QHeaderView::Fixed); ttheader->hideSection (COLUMN_THREAD_CONTENT); ui.progressBar->hide(); @@ -1278,7 +1279,7 @@ void ForumsDialog::nextUnreadMessage() { QTreeWidgetItem *currentItem = ui.threadTreeWidget->currentItem(); - while (TRUE) { + while (true) { QTreeWidgetItemIterator itemIterator = currentItem ? QTreeWidgetItemIterator(currentItem, QTreeWidgetItemIterator::NotHidden) : QTreeWidgetItemIterator(ui.threadTreeWidget, QTreeWidgetItemIterator::NotHidden); QTreeWidgetItem *item; diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp index e90a62c3d..5ff0ac8a3 100644 --- a/retroshare-gui/src/gui/GenCertDialog.cpp +++ b/retroshare-gui/src/gui/GenCertDialog.cpp @@ -103,11 +103,11 @@ void GenCertDialog::grabMouse() RsInit::collectEntropy(E+(F << 16)) ; } -static bool MyEventFilter(void *message, long *result) -{ - std::cerr << "Event called " << message << std::endl; - return false ; -} +//static bool MyEventFilter(void *message, long *result) +//{ +// std::cerr << "Event called " << message << std::endl; +// return false ; +//} /** Default constructor */ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint), mOnlyGenerateIdentity(onlyGenerateIdentity) diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index 7c9ce35a8..a1fd10d94 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -37,6 +37,7 @@ #include "common/RSItemDelegate.h" #include "util/DateTime.h" #include "util/RsProtectedTimer.h" +#include "util/QtVersion.h" #include #include @@ -210,7 +211,7 @@ MessagesDialog::MessagesDialog(QWidget *parent) msgwheader->resizeSection (COLUMN_DATE, 140); msgwheader->resizeSection (COLUMN_STAR, 16); - msgwheader->setResizeMode (COLUMN_STAR, QHeaderView::Fixed); + QHeaderView_setSectionResizeMode(msgwheader, COLUMN_STAR, QHeaderView::Fixed); msgwheader->resizeSection (COLUMN_STAR, 24); ui.forwardmessageButton->setToolTip(tr("Forward selected Message")); @@ -243,14 +244,14 @@ MessagesDialog::MessagesDialog(QWidget *parent) processSettings(true); /* Set header sizes for the fixed columns and resize modes, must be set after processSettings */ - msgwheader->setResizeMode (COLUMN_ATTACHEMENTS, QHeaderView::Fixed); - msgwheader->setResizeMode (COLUMN_DATE, QHeaderView::Interactive); - msgwheader->setResizeMode (COLUMN_UNREAD, QHeaderView::Fixed); - msgwheader->setResizeMode (COLUMN_SIGNATURE, QHeaderView::Fixed); + QHeaderView_setSectionResizeMode(msgwheader, COLUMN_ATTACHEMENTS, QHeaderView::Fixed); + QHeaderView_setSectionResizeMode(msgwheader, COLUMN_DATE, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(msgwheader, COLUMN_UNREAD, QHeaderView::Fixed); + QHeaderView_setSectionResizeMode(msgwheader, COLUMN_SIGNATURE, QHeaderView::Fixed); msgwheader->resizeSection (COLUMN_UNREAD, 24); msgwheader->resizeSection (COLUMN_SIGNATURE, 24); msgwheader->resizeSection (COLUMN_STAR, 24); - msgwheader->setResizeMode (COLUMN_STAR, QHeaderView::Fixed); + QHeaderView_setSectionResizeMode(msgwheader, COLUMN_STAR, QHeaderView::Fixed); msgwheader->setStretchLastSection(false); // fill folder list diff --git a/retroshare-gui/src/gui/NetworkDialog.cpp b/retroshare-gui/src/gui/NetworkDialog.cpp index 6ac5a9541..a80d9aa4c 100644 --- a/retroshare-gui/src/gui/NetworkDialog.cpp +++ b/retroshare-gui/src/gui/NetworkDialog.cpp @@ -41,6 +41,7 @@ #include "connect/ConfCertDialog.h" #include "settings/rsharesettings.h" #include "RetroShareLink.h" +#include "util/QtVersion.h" #include @@ -95,12 +96,12 @@ NetworkDialog::NetworkDialog(QWidget *parent) /* Set header resize modes and initial section sizes */ QHeaderView * _header = ui.connectTreeWidget->header () ; - _header->setResizeMode (COLUMN_CHECK, QHeaderView::Custom); - _header->setResizeMode (COLUMN_PEERNAME, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_I_AUTH_PEER, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_PEER_AUTH_ME, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_PEERID, QHeaderView::Interactive); - _header->setResizeMode (COLUMN_LAST_USED, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_CHECK, QHeaderView::Custom); + QHeaderView_setSectionResizeMode(_header, COLUMN_PEERNAME, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_I_AUTH_PEER, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_PEER_AUTH_ME, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_PEERID, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_header, COLUMN_LAST_USED, QHeaderView::Interactive); _header->model()->setHeaderData(COLUMN_CHECK, Qt::Horizontal, tr("")); _header->model()->setHeaderData(COLUMN_PEERNAME, Qt::Horizontal, tr("Name")); diff --git a/retroshare-gui/src/gui/QuickStartWizard.cpp b/retroshare-gui/src/gui/QuickStartWizard.cpp index 6d832f65e..02cb65a98 100644 --- a/retroshare-gui/src/gui/QuickStartWizard.cpp +++ b/retroshare-gui/src/gui/QuickStartWizard.cpp @@ -33,7 +33,7 @@ #include #include #include "settings/rsharesettings.h" - +#include "util/QtVersion.h" QuickStartWizard::QuickStartWizard(QWidget *parent) : QDialog(parent) @@ -59,8 +59,8 @@ QuickStartWizard::QuickStartWizard(QWidget *parent) : // bool b = rsPeers->getAllowTunnelConnection() ; // ui.checkBoxTunnelConnection->setChecked(b) ; - ui.shareddirList->horizontalHeader()->setResizeMode( 0,QHeaderView::Stretch); - ui.shareddirList->horizontalHeader()->setResizeMode( 2,QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(ui.shareddirList->horizontalHeader(), 0, QHeaderView::Stretch); + QHeaderView_setSectionResizeMode(ui.shareddirList->horizontalHeader(), 2, QHeaderView::Interactive); ui.shareddirList->horizontalHeader()->resizeSection( 0, 360 ); ui.shareddirList->horizontalHeader()->setStretchLastSection(false); diff --git a/retroshare-gui/src/gui/SearchDialog.cpp b/retroshare-gui/src/gui/SearchDialog.cpp index 0656401f7..eca07ea7a 100644 --- a/retroshare-gui/src/gui/SearchDialog.cpp +++ b/retroshare-gui/src/gui/SearchDialog.cpp @@ -36,6 +36,7 @@ #include "settings/rsharesettings.h" #include "advsearch/advancedsearchdialog.h" #include "common/RSTreeWidgetItem.h" +#include "util/QtVersion.h" #include #include @@ -146,17 +147,17 @@ SearchDialog::SearchDialog(QWidget *parent) ui.searchSummaryWidget->setColumnHidden ( 2, true); QHeaderView * _smheader = ui.searchSummaryWidget->header () ; - _smheader->setResizeMode (0, QHeaderView::Interactive); - _smheader->setResizeMode (1, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_smheader, 0, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_smheader, 1, QHeaderView::Interactive); _smheader->resizeSection ( 0, 160 ); _smheader->resizeSection ( 1, 50 ); ui.searchResultWidget->setColumnCount(6); _smheader = ui.searchResultWidget->header () ; - _smheader->setResizeMode (0, QHeaderView::Interactive); - _smheader->setResizeMode (1, QHeaderView::Interactive); - _smheader->setResizeMode (2, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_smheader, 0, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_smheader, 1, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(_smheader, 2, QHeaderView::Interactive); _smheader->resizeSection ( 0, 240 ); _smheader->resizeSection ( 1, 75 ); diff --git a/retroshare-gui/src/gui/ShareManager.cpp b/retroshare-gui/src/gui/ShareManager.cpp index 8b4405578..9abd97b35 100644 --- a/retroshare-gui/src/gui/ShareManager.cpp +++ b/retroshare-gui/src/gui/ShareManager.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -36,6 +37,7 @@ #include #include "gui/common/GroupDefs.h" #include "gui/notifyqt.h" +#include "util/QtVersion.h" /* Images for context menu icons */ #define IMAGE_CANCEL ":/images/delete.png" @@ -77,7 +79,7 @@ ShareManager::ShareManager() ui.removeButton->setEnabled(false); QHeaderView* header = ui.shareddirList->horizontalHeader(); - header->setResizeMode( COLUMN_PATH, QHeaderView::Stretch); + QHeaderView_setSectionResizeMode(header, COLUMN_PATH, QHeaderView::Stretch); //header->setResizeMode(COLUMN_NETWORKWIDE, QHeaderView::Fixed); //header->setResizeMode(COLUMN_BROWSABLE, QHeaderView::Fixed); diff --git a/retroshare-gui/src/gui/SharedFilesDialog.cpp b/retroshare-gui/src/gui/SharedFilesDialog.cpp index 17f2c9af8..e8ab8bc0c 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/SharedFilesDialog.cpp @@ -39,6 +39,7 @@ #include "RemoteDirModel.h" #include "ShareDialog.h" #include "common/PeerDefs.h" +#include "util/QtVersion.h" #include #include @@ -330,7 +331,7 @@ void SharedFilesDialog::changeCurrentViewModel(int c) ui.dirTreeView->update(); QHeaderView * header = ui.dirTreeView->header () ; - header->setResizeMode (0, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(header, 0, QHeaderView::Interactive); ui.dirTreeView->header()->headerDataChanged(Qt::Horizontal,0,4) ; diff --git a/retroshare-gui/src/gui/common/FriendList.cpp b/retroshare-gui/src/gui/common/FriendList.cpp index 7e0918534..fd453baa9 100644 --- a/retroshare-gui/src/gui/common/FriendList.cpp +++ b/retroshare-gui/src/gui/common/FriendList.cpp @@ -48,6 +48,7 @@ #include "StatusDefs.h" #include "util/misc.h" #include "vmessagebox.h" +#include "util/QtVersion.h" #include "gui/connect/ConnectProgressDialog.h" @@ -283,13 +284,13 @@ void FriendList::initializeHeader(bool afterLoadSettings) { // set column size QHeaderView *header = ui->peerTreeWidget->header(); - header->setMovable(true); - //header->setResizeMode(COLUMN_NAME, QHeaderView::Stretch); - header->setResizeMode(COLUMN_NAME, QHeaderView::Interactive); - header->setResizeMode(COLUMN_STATE, QHeaderView::Interactive); - header->setResizeMode(COLUMN_LAST_CONTACT, QHeaderView::Interactive); - header->setResizeMode(COLUMN_IP, QHeaderView::Interactive); - header->setResizeMode(COLUMN_AVATAR, QHeaderView::Fixed); + QHeaderView_setSectionsMovable(header, true); + //QHeaderView_setSectionResizeMode(header, COLUMN_NAME, QHeaderView::Stretch); + QHeaderView_setSectionResizeMode(header, COLUMN_NAME, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(header, COLUMN_STATE, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(header, COLUMN_LAST_CONTACT, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(header, COLUMN_IP, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(header, COLUMN_AVATAR, QHeaderView::Fixed); /* if (!afterLoadSettings) { header->resizeSection(COLUMN_NAME, 150); diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index 2e13ddddf..4ee468c27 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -29,6 +29,7 @@ #include "PopularityDefs.h" #include "gui/settings/rsharesettings.h" #include "RSTreeWidgetItem.h" +#include "util/QtVersion.h" #include @@ -86,9 +87,9 @@ GroupTreeWidget::GroupTreeWidget(QWidget *parent) : /* Set header resize modes and initial section sizes */ QHeaderView *header = ui->treeWidget->header (); - header->setResizeMode(COLUMN_NAME, QHeaderView::Stretch); + QHeaderView_setSectionResizeMode(header, COLUMN_NAME, QHeaderView::Stretch); header->resizeSection(COLUMN_NAME, 170); - header->setResizeMode(COLUMN_POPULARITY, QHeaderView::Fixed); + QHeaderView_setSectionResizeMode(header, COLUMN_POPULARITY, QHeaderView::Fixed); header->resizeSection(COLUMN_POPULARITY, 25); /* add filter actions */ diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.cpp b/retroshare-gui/src/gui/msgs/MessageComposer.cpp index 507ee0020..a73aabf56 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.cpp +++ b/retroshare-gui/src/gui/msgs/MessageComposer.cpp @@ -60,6 +60,7 @@ #include "gui/common/TagDefs.h" #include "gui/connect/ConfCertDialog.h" #include "util/HandleRichText.h" +#include "util/QtVersion.h" #define IMAGE_GROUP16 ":/images/user/group16.png" #define IMAGE_FRIENDINFO ":/images/peerdetails_16x16.png" @@ -286,9 +287,9 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WindowFlags flags) QHeaderView *header = ui.recipientWidget->horizontalHeader(); header->resizeSection(COLUMN_RECIPIENT_TYPE, 50); header->resizeSection(COLUMN_RECIPIENT_ICON, 22); - header->setResizeMode(COLUMN_RECIPIENT_TYPE, QHeaderView::Fixed); - header->setResizeMode(COLUMN_RECIPIENT_ICON, QHeaderView::Fixed); - header->setResizeMode(COLUMN_RECIPIENT_NAME, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(header, COLUMN_RECIPIENT_TYPE, QHeaderView::Fixed); + QHeaderView_setSectionResizeMode(header, COLUMN_RECIPIENT_ICON, QHeaderView::Fixed); + QHeaderView_setSectionResizeMode(header, COLUMN_RECIPIENT_NAME, QHeaderView::Interactive); header->setStretchLastSection(true); /* Set own item delegate */ diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index f4cc63983..1e5a77c76 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -42,6 +42,7 @@ #include "util/printpreview.h" #include "util/HandleRichText.h" #include "util/DateTime.h" +#include "util/QtVersion.h" #include #include @@ -146,9 +147,9 @@ MessageWidget::MessageWidget(bool controlled, QWidget *parent, Qt::WindowFlags f /* Set header resize modes and initial section sizes */ QHeaderView * msglheader = ui.msgList->header () ; - msglheader->setResizeMode (COLUMN_FILE_NAME, QHeaderView::Interactive); - msglheader->setResizeMode (COLUMN_FILE_SIZE, QHeaderView::Interactive); - msglheader->setResizeMode (COLUMN_FILE_HASH, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(msglheader, COLUMN_FILE_NAME, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(msglheader, COLUMN_FILE_SIZE, QHeaderView::Interactive); + QHeaderView_setSectionResizeMode(msglheader, COLUMN_FILE_HASH, QHeaderView::Interactive); msglheader->resizeSection (COLUMN_FILE_NAME, 200); msglheader->resizeSection (COLUMN_FILE_SIZE, 100); diff --git a/retroshare-gui/src/gui/settings/SoundPage.cpp b/retroshare-gui/src/gui/settings/SoundPage.cpp index b53033416..471618dec 100644 --- a/retroshare-gui/src/gui/settings/SoundPage.cpp +++ b/retroshare-gui/src/gui/settings/SoundPage.cpp @@ -53,7 +53,11 @@ SoundPage::SoundPage(QWidget * parent, Qt::WindowFlags flags) headerItem->setText(COLUMN_NAME, tr("Event")); headerItem->setText(COLUMN_FILENAME, tr("Filename")); +#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0) + ui.eventTreeWidget->header()->setSectionResizeMode(QHeaderView::Fixed); +#else ui.eventTreeWidget->header()->setResizeMode(QHeaderView::Fixed); +#endif ui.eventTreeWidget->setTextElideMode(Qt::ElideMiddle); /* Hide platform specific features */ diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index 4606972c1..fe14eec42 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -1,4 +1,13 @@ -CONFIG += qt gui uic qrc resources uitools idle bitdht +QT += network xml script +CONFIG += qt gui uic qrc resources idle bitdht + +greaterThan(QT_MAJOR_VERSION, 4) { + # Qt 5 + QT += uitools widgets multimedia printsupport +} else { + # Qt 4 + CONFIG += uitools +} # Below is for GXS services. # Should be disabled for releases. @@ -26,9 +35,6 @@ gxs { #CONFIG += framecatcher #CONFIG += blogs - -QT += network xml script - TEMPLATE = app TARGET = RetroShare @@ -361,6 +367,7 @@ HEADERS += rshare.h \ util/misc.h \ util/HandleRichText.h \ util/ObjectPainter.h \ + util/QtVersion.h \ gui/bwgraph/bwgraph.h \ gui/profile/ProfileWidget.h \ gui/profile/ProfileManager.h \ diff --git a/retroshare-gui/src/util/QtVersion.h b/retroshare-gui/src/util/QtVersion.h new file mode 100644 index 000000000..dd42de37b --- /dev/null +++ b/retroshare-gui/src/util/QtVersion.h @@ -0,0 +1,41 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2013 RetroShare Team + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + ****************************************************************/ + +#ifndef QTVERSION_H +#define QTVERSION_H + +// Macros to compile with Qt 4 and Qt 5 + +// Renamed QHeaderView::setResizeMode to QHeaderView::setSectionResizeMode +#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0) +#define QHeaderView_setSectionResizeMode(header, column, mode) header->setSectionResizeMode(column, mode); +#else +#define QHeaderView_setSectionResizeMode(header, column, mode) header->setResizeMode(column, mode); +#endif + +// Renamed QHeaderView::setMovable to QHeaderView::setSectionsMovable +#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0) +#define QHeaderView_setSectionsMovable(header, movable) header->setSectionsMovable(movable); +#else +#define QHeaderView_setSectionsMovable(header, movable) header->setMovable(movable); +#endif + +#endif