From 75bb3a25d320e08f8cc840190e3a216ea4d74387 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Sun, 24 Nov 2013 15:31:04 +0100 Subject: [PATCH] qt4 things --- CMakeLists.txt | 4 ---- src/gui/messagesview.cpp | 15 +++++++++++++++ src/qtsingleapplication/qtlocalpeer.cpp | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c1fbd825..5d20aac2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,10 +14,6 @@ option(USE_QT_5 "Use Qt 5 for building" ON) message(STATUS "[${APP_LOW_NAME}] Welcome to ${APP_NAME} compilation process.") message(STATUS "[${APP_LOW_NAME}] Compilation process begins right now.") -#if(USE_QT_5 EQUAL false) -# message(FATAL_ERROR "[${APP_LOW_NAME}] Only Qt 5 is supported now.") -#endif(USE_QT_5 EQUAL false) - # Setup name for executable file. if(APPLE) set(EXE_NAME ${APP_UP_NAME}) diff --git a/src/gui/messagesview.cpp b/src/gui/messagesview.cpp index 9526bb08d..fc884dc0e 100644 --- a/src/gui/messagesview.cpp +++ b/src/gui/messagesview.cpp @@ -12,6 +12,7 @@ MessagesView::MessagesView(QWidget *parent) : QTreeView(parent) { setModel(m_proxyModel); +#if QT_VERSION >= 0x050000 // Setup column resize strategies. header()->setSectionResizeMode(MSG_DB_ID_INDEX, QHeaderView::Interactive); header()->setSectionResizeMode(MSG_DB_READ_INDEX, QHeaderView::ResizeToContents); @@ -24,6 +25,20 @@ MessagesView::MessagesView(QWidget *parent) : QTreeView(parent) { header()->setSectionResizeMode(MSG_DB_DCREATED_INDEX, QHeaderView::Interactive); header()->setSectionResizeMode(MSG_DB_DUPDATED_INDEX, QHeaderView::Interactive); header()->setSectionResizeMode(MSG_DB_CONTENTS_INDEX, QHeaderView::Interactive); +#else + // Setup column resize strategies. + header()->setResizeMode(MSG_DB_ID_INDEX, QHeaderView::Interactive); + header()->setResizeMode(MSG_DB_READ_INDEX, QHeaderView::ResizeToContents); + header()->setResizeMode(MSG_DB_DELETED_INDEX, QHeaderView::Interactive); + header()->setResizeMode(MSG_DB_IMPORTANT_INDEX, QHeaderView::ResizeToContents); + header()->setResizeMode(MSG_DB_FEED_INDEX, QHeaderView::Interactive); + header()->setResizeMode(MSG_DB_TITLE_INDEX, QHeaderView::Stretch); + header()->setResizeMode(MSG_DB_URL_INDEX, QHeaderView::Interactive); + header()->setResizeMode(MSG_DB_AUTHOR_INDEX, QHeaderView::Interactive); + header()->setResizeMode(MSG_DB_DCREATED_INDEX, QHeaderView::Interactive); + header()->setResizeMode(MSG_DB_DUPDATED_INDEX, QHeaderView::Interactive); + header()->setResizeMode(MSG_DB_CONTENTS_INDEX, QHeaderView::Interactive); +#endif // Hide columns. hideColumn(MSG_DB_ID_INDEX); diff --git a/src/qtsingleapplication/qtlocalpeer.cpp b/src/qtsingleapplication/qtlocalpeer.cpp index 332b0643f..a909cb22e 100644 --- a/src/qtsingleapplication/qtlocalpeer.cpp +++ b/src/qtsingleapplication/qtlocalpeer.cpp @@ -49,7 +49,7 @@ typedef BOOL(WINAPI*PProcessIdToSessionId)(DWORD,DWORD*); static PProcessIdToSessionId pProcessIdToSessionId = 0; #endif -#if defined(Q_OS_UNIX) +#if defined(Q_OS_UNIX) || defined(Q_OS_OS2) #include #include #include