Commit aeb3dfb3 authored by Volker Krause's avatar Volker Krause
Browse files

Initial support for building against Qt6

This mainly includes build system changes and minor code changes, the only
still remaining issue is the D-Bus menu code. That compiles but fails to
link as the corresponding classes in Qt are not exported despite installed
(private) headers.
parent 65cbbba8
Pipeline #153297 passed with stage
in 1 minute and 3 seconds
......@@ -5,7 +5,7 @@ set(PROJECT_VERSION "5.24.80")
set(PROJECT_VERSION_MAJOR 5)
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.86")
set(KF5_MIN_VERSION "5.90")
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
......@@ -19,8 +19,11 @@ include(GenerateExportHeader)
include(KDEClangFormat)
include(KDEGitCommitHooks)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Widgets DBus X11Extras QuickControls2)
find_package(Qt5Gui ${QT_MIN_VERSION} CONFIG REQUIRED Private)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED Widgets DBus QuickControls2)
find_package(Qt${QT_MAJOR_VERSION}Gui ${QT_MIN_VERSION} CONFIG REQUIRED Private)
if (QT_MAJOR_VERSION EQUAL "5")
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED X11Extras)
endif()
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Config ConfigWidgets I18n IconThemes KIO Notifications Wayland
......@@ -41,8 +44,10 @@ set_package_properties(Breeze PROPERTIES
PURPOSE "For setting the default QStyle name")
# dependencies for QPA plugin
find_package(Qt5ThemeSupport REQUIRED)
set(QT5PLATFORMSUPPORT_LIBS Qt5ThemeSupport::Qt5ThemeSupport)
if (QT_MAJOR_VERSION EQUAL "5")
find_package(Qt5ThemeSupport REQUIRED)
set(QT5PLATFORMSUPPORT_LIBS Qt5ThemeSupport::Qt5ThemeSupport)
endif()
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f02)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055B00)
add_definitions(-DTRANSLATION_DOMAIN=\"plasmaintegration5\")
......
include(ECMMarkAsTest)
include(ECMMarkNonGuiExecutable)
find_package(Qt5Test ${QT_MIN_VERSION} CONFIG QUIET)
find_package(Qt5Qml ${QT_MIN_VERSION} CONFIG QUIET)
find_package(Qt${QT_MAJOR_VERSION}Test ${QT_MIN_VERSION} CONFIG QUIET)
find_package(Qt${QT_MAJOR_VERSION}Qml ${QT_MIN_VERSION} CONFIG QUIET)
if(NOT Qt5Test_FOUND)
message(STATUS "Qt5Test not found, autotests will not be built.")
......
......@@ -5,7 +5,9 @@ set_package_properties(X11 PROPERTIES DESCRIPTION "Required for updating the Cur
)
set(HAVE_X11 ${X11_FOUND})
if(HAVE_X11)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED X11Extras)
if (QT_MAJOR_VERSION EQUAL "5")
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED X11Extras)
endif()
find_package(XCB COMPONENTS XCB)
set_package_properties(XCB PROPERTIES TYPE REQUIRED)
......@@ -43,7 +45,6 @@ target_link_libraries(KDEPlasmaPlatformTheme
PRIVATE
Qt::GuiPrivate
Qt::DBus
Qt::X11Extras
Qt::QuickControls2
KF5::ConfigWidgets
KF5::ConfigCore
......@@ -58,9 +59,12 @@ target_link_libraries(KDEPlasmaPlatformTheme
XCB::XCB
${QT5PLATFORMSUPPORT_LIBS}
)
if (QT_MAJOR_VERSION EQUAL "5")
target_link_libraries(KDEPlasmaPlatformTheme PRIVATE Qt5::X11Extras)
endif()
if(HAVE_X11)
target_link_libraries(KDEPlasmaPlatformTheme PRIVATE Qt::X11Extras ${X11_Xcursor_LIB} ${XCB_XCB_LIBRARY})
target_link_libraries(KDEPlasmaPlatformTheme PRIVATE ${X11_Xcursor_LIB} ${XCB_XCB_LIBRARY})
endif()
set_target_properties(KDEPlasmaPlatformTheme PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/platformthemes/")
......
......@@ -5,6 +5,7 @@
*/
#include "kdeplatformsystemtrayicon.h"
#include <QAction>
#include <QActionGroup>
#include <QApplication>
#include <QIcon>
#include <QMenu>
......
......@@ -79,7 +79,9 @@ KdePlatformTheme::KdePlatformTheme()
// contextual tooltips instead; we only want to ever see the titlebar button
// to invoke the "What's This?" feature in 3rd-party Qt apps that have set
// "What's This" help text and requested the button
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton, true);
#endif
QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, false);
setQtQuickControlsTheme();
......
......@@ -38,7 +38,11 @@
#define HAVE_X11 0
#endif
#if HAVE_X11
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <private/qtx11extras_p.h>
#else
#include <QX11Info>
#endif
#include <X11/Xcursor/Xcursor.h>
#endif
......
......@@ -27,10 +27,17 @@
#include <QString>
#include <QWindow>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QtThemeSupport/private/qdbusmenuadaptor_p.h>
#include <QtThemeSupport/private/qdbusmenuconnection_p.h>
#include <QtThemeSupport/private/qdbusmenuregistrarproxy_p.h>
#include <QtThemeSupport/private/qdbusplatformmenu_p.h>
#else
#include <private/qdbusmenuadaptor_p.h>
#include <private/qdbusmenuconnection_p.h>
#include <private/qdbusmenuregistrarproxy_p.h>
#include <private/qdbusplatformmenu_p.h>
#endif
QT_BEGIN_NAMESPACE
......
......@@ -11,7 +11,11 @@
#include <QGuiApplication>
#include <QPlatformSurfaceEvent>
#include <QWindow>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <private/qtx11extras_p.h>
#else
#include <QX11Info>
#endif
#include <KWindowEffects>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment