diff --git a/src/platformtheme/CMakeLists.txt b/src/platformtheme/CMakeLists.txt --- a/src/platformtheme/CMakeLists.txt +++ b/src/platformtheme/CMakeLists.txt @@ -24,7 +24,6 @@ set(platformtheme_SRCS kdeplatformtheme.cpp - qdbusmenubar.cpp # fork of Qt's qdbusmenubar with some added setters for our convenience kfontsettingsdata.cpp khintssettings.cpp kdeplatformfiledialoghelper.cpp @@ -37,6 +36,12 @@ main.cpp ) +if(Qt5Core_VERSION VERSION_EQUAL "5.7.0" OR Qt5Core_VERSION VERSION_GREATER "5.7.0") +set(platformtheme_SRCS + qdbusmenubar.cpp # fork of Qt's qdbusmenubar with some added setters for our convenience + ${platformtheme_SRCS} +) +endif() add_library(KDEPlasmaPlatformTheme MODULE ${platformtheme_SRCS}) diff --git a/src/platformtheme/kdeplatformtheme.h b/src/platformtheme/kdeplatformtheme.h --- a/src/platformtheme/kdeplatformtheme.h +++ b/src/platformtheme/kdeplatformtheme.h @@ -55,7 +55,9 @@ QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const Q_DECL_OVERRIDE; +#ifdef QT_VERSION > QT_VERSION_CHECK(5.7.0) QPlatformMenuBar *createPlatformMenuBar() const Q_DECL_OVERRIDE; +#endif private: void loadSettings(); diff --git a/src/platformtheme/kdeplatformtheme.cpp b/src/platformtheme/kdeplatformtheme.cpp --- a/src/platformtheme/kdeplatformtheme.cpp +++ b/src/platformtheme/kdeplatformtheme.cpp @@ -48,7 +48,9 @@ #include #include +#ifdef QT_VERSION > QT_VERSION_CHECK(5.7.0) #include "qdbusmenubar_p.h" +#endif static const QByteArray s_x11AppMenuServiceNamePropertyName = QByteArrayLiteral("_KDE_NET_WM_APPMENU_SERVICE_NAME"); static const QByteArray s_x11AppMenuObjectPathPropertyName = QByteArrayLiteral("_KDE_NET_WM_APPMENU_OBJECT_PATH"); @@ -321,6 +323,7 @@ return new KDEPlatformSystemTrayIcon; } +#ifdef QT_VERSION > QT_VERSION_CHECK(5.7.0) QPlatformMenuBar *KdePlatformTheme::createPlatformMenuBar() const { if (isDBusGlobalMenuAvailable()) { @@ -360,5 +363,6 @@ return nullptr; } +#endif #include "kdeplatformtheme.moc"