diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ include(KDEFrameworkCompilerSettings) include(KDECMakeSettings) -set(REQUIRED_QT_VERSION 5.3.0) +set(REQUIRED_QT_VERSION 5.5.0) find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets DBus) set(KF5_VERSION "5.18.0") # handled by release scripts diff --git a/src/platformtheme/kdeplatformfiledialoghelper.cpp b/src/platformtheme/kdeplatformfiledialoghelper.cpp --- a/src/platformtheme/kdeplatformfiledialoghelper.cpp +++ b/src/platformtheme/kdeplatformfiledialoghelper.cpp @@ -221,13 +221,7 @@ { if (options()->testOption(QFileDialogOptions::ShowDirsOnly)) { m_dialog->deleteLater(); - m_dialog = new KDirSelectDialog( -#if QT_VERSION >= QT_VERSION_CHECK(5,5,0) - options()->initialDirectory() -#else - m_dialog->directory() -#endif - ); + m_dialog = new KDirSelectDialog(options()->initialDirectory()); connect(m_dialog, SIGNAL(accepted()), SIGNAL(accept())); connect(m_dialog, SIGNAL(rejected()), SIGNAL(reject())); if (!options()->windowTitle().isEmpty()) @@ -241,9 +235,7 @@ } else { dialog->setWindowTitle(options()->windowTitle()); } -#if QT_VERSION >= QT_VERSION_CHECK(5,5,0) setDirectory(options()->initialDirectory()); -#endif //dialog->setViewMode(options()->viewMode()); // don't override our options, fixes remembering the chosen view mode and sizes! dialog->setFileMode(options()->fileMode()); diff --git a/src/platformtheme/kdeplatformsystemtrayicon.h b/src/platformtheme/kdeplatformsystemtrayicon.h --- a/src/platformtheme/kdeplatformsystemtrayicon.h +++ b/src/platformtheme/kdeplatformsystemtrayicon.h @@ -28,7 +28,6 @@ class QAction; class QMenu; -#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)) class SystemTrayMenu : public QPlatformMenu { Q_OBJECT @@ -76,19 +75,14 @@ void setText(const QString &text) Q_DECL_OVERRIDE; void setVisible(bool isVisible) Q_DECL_OVERRIDE; quintptr tag() const Q_DECL_OVERRIDE; - void setIconSize(int size) -#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)) - Q_DECL_OVERRIDE -#endif - ; + void setIconSize(int size) Q_DECL_OVERRIDE; QAction *action() const; private: quintptr m_tag; QAction *m_action; }; -#endif class KDEPlatformSystemTrayIcon : public QPlatformSystemTrayIcon { @@ -108,9 +102,7 @@ bool isSystemTrayAvailable() const Q_DECL_OVERRIDE; bool supportsMessages() const Q_DECL_OVERRIDE; -#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)) QPlatformMenu *createMenu() const Q_DECL_OVERRIDE; -#endif private: KStatusNotifierItem *m_sni; diff --git a/src/platformtheme/kdeplatformsystemtrayicon.cpp b/src/platformtheme/kdeplatformsystemtrayicon.cpp --- a/src/platformtheme/kdeplatformsystemtrayicon.cpp +++ b/src/platformtheme/kdeplatformsystemtrayicon.cpp @@ -26,7 +26,6 @@ #include #include -#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)) SystemTrayMenu::SystemTrayMenu() : QPlatformMenu() , m_tag(0) @@ -252,7 +251,6 @@ { return m_action; } -#endif KDEPlatformSystemTrayIcon::KDEPlatformSystemTrayIcon() : QPlatformSystemTrayIcon() @@ -312,24 +310,18 @@ void KDEPlatformSystemTrayIcon::updateMenu(QPlatformMenu *menu) { -#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)) if (!m_sni) { return; } if (SystemTrayMenu *ourMenu = qobject_cast(menu)) { m_sni->setContextMenu(ourMenu->menu()); } -#else - Q_UNUSED(menu) -#endif } -#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)) QPlatformMenu *KDEPlatformSystemTrayIcon::createMenu() const { return new SystemTrayMenu(); } -#endif QRect KDEPlatformSystemTrayIcon::geometry() const { diff --git a/src/platformtheme/kdeplatformtheme.h b/src/platformtheme/kdeplatformtheme.h --- a/src/platformtheme/kdeplatformtheme.h +++ b/src/platformtheme/kdeplatformtheme.h @@ -46,9 +46,7 @@ QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const Q_DECL_OVERRIDE; bool usePlatformNativeDialog(DialogType type) const Q_DECL_OVERRIDE; -#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0) QString standardButtonText(int button) const Q_DECL_OVERRIDE; -#endif QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const Q_DECL_OVERRIDE; diff --git a/src/platformtheme/kdeplatformtheme.cpp b/src/platformtheme/kdeplatformtheme.cpp --- a/src/platformtheme/kdeplatformtheme.cpp +++ b/src/platformtheme/kdeplatformtheme.cpp @@ -212,7 +212,6 @@ return type == QPlatformTheme::FileDialog; } -#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0) QString KdePlatformTheme::standardButtonText(int button) const { switch (static_cast(button)) { @@ -260,7 +259,6 @@ return QPlatformTheme::defaultStandardButtonText(button); } } -#endif QPlatformDialogHelper *KdePlatformTheme::createPlatformDialogHelper(QPlatformTheme::DialogType type) const { diff --git a/src/platformtheme/khintssettings.cpp b/src/platformtheme/khintssettings.cpp --- a/src/platformtheme/khintssettings.cpp +++ b/src/platformtheme/khintssettings.cpp @@ -106,9 +106,7 @@ m_hints[QPlatformTheme::UiEffects] = cg.readEntry("GraphicEffectsLevel", 0) != 0 ? QPlatformTheme::GeneralUiEffect : 0; m_hints[QPlatformTheme::IconPixmapSizes] = QVariant::fromValue(QList() << 512 << 256 << 128 << 64 << 32 << 22 << 16 << 8); -#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)) m_hints[QPlatformTheme::WheelScrollLines] = cg.readEntry("WheelScrollLines", 3); -#endif if (qobject_cast(QCoreApplication::instance())) { QApplication::setWheelScrollLines(cg.readEntry("WheelScrollLines", 3)); } @@ -331,10 +329,8 @@ bool showIcons = cg.readEntry("ShowIconsInMenuItems", !QApplication::testAttribute(Qt::AA_DontShowIconsInMenus)); QCoreApplication::setAttribute(Qt::AA_DontShowIconsInMenus, !showIcons); -#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)) int wheelScrollLines = cg.readEntry("WheelScrollLines", 3); m_hints[QPlatformTheme::WheelScrollLines] = wheelScrollLines; -#endif QApplication *app = qobject_cast(QCoreApplication::instance()); if (app) { QApplication::setWheelScrollLines(cg.readEntry("WheelScrollLines", 3)); diff --git a/src/platformtheme/main.cpp b/src/platformtheme/main.cpp --- a/src/platformtheme/main.cpp +++ b/src/platformtheme/main.cpp @@ -22,16 +22,6 @@ #include "kdeplatformtheme.h" -#include -#if (QT_VERSION < QT_VERSION_CHECK(5, 3, 1)) -#if HAVE_X11 -#include -#include -#include -#include -#endif -#endif - class KdePlatformThemePlugin : public QPlatformThemePlugin { Q_OBJECT @@ -44,37 +34,8 @@ { Q_UNUSED(key) Q_UNUSED(paramList) -#if (QT_VERSION < QT_VERSION_CHECK(5, 3, 1)) - // Must be done after we have an event-dispatcher. By posting a method invocation - // we are sure that by the time the method is called we have an event-dispatcher. - QMetaObject::invokeMethod(this, "setupXcbFlush", Qt::QueuedConnection); -#endif return new KdePlatformTheme; } - -public Q_SLOTS: - void setupXcbFlush(); }; -void KdePlatformThemePlugin::setupXcbFlush() -{ -#if (QT_VERSION < QT_VERSION_CHECK(5, 3, 1)) -#if HAVE_X11 - // this is a workaround for BUG 334858 - // it ensures that the xcb connection gets flushed before the EventDispatcher - // is going to block. Qt does not guarantee this in all cases. - // For Qt this issue is addressed in https://codereview.qt-project.org/85654 - // TODO: remove again once we depend on a Qt version with the patch. - if (!QX11Info::isPlatformX11() || qstrcmp(qVersion(), "5.3.1") >= 0) { - return; - } - connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::aboutToBlock, - []() { - xcb_flush(QX11Info::connection()); - } - ); -#endif -#endif -} - #include "main.moc"