Commit 423e3d0a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix build against QX11...

parent 1eb97bd5
......@@ -121,7 +121,7 @@ if (X11_FOUND)
if (QT_MAJOR_VERSION STREQUAL "5")
find_package(Qt5X11Extras ${QT_REQUIRED_VERSION} REQUIRED NO_MODULE)
else()
#TODO X11 on Qt6
find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Gui) # qtx11extras_p.h
endif()
endif()
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
......
......@@ -335,11 +335,14 @@ if (ENABLE_WAKE_FROM_SUSPEND)
target_link_libraries(kalarm_bin KF5::AuthCore)
endif()
if (Qt${QT_MAJOR_VERSION}X11Extras_FOUND)
target_link_libraries(kalarm_bin Qt${QT_MAJOR_VERSION}::X11Extras ${X11_X11_LIB})
if(X11_FOUND)
if (QT_MAJOR_VERSION STREQUAL "5")
target_link_libraries(kalarm_bin Qt${QT_MAJOR_VERSION}::X11Extras ${X11_X11_LIB})
else()
target_link_libraries(kalarm_bin Qt6::GuiPrivate ${X11_X11_LIB})
endif()
endif()
install(TARGETS kalarm_bin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
#endif (UNIX)
......
......@@ -36,9 +36,12 @@
#if KDEPIM_HAVE_X11
#include <KWindowInfo>
#include <netwm.h>
#include <qx11info_x11.h>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <private/qtx11extras_p.h>
#else
#include <QX11Info>
#endif
#endif
#include <QTextBrowser>
#include <QScrollBar>
#include <QCheckBox>
......
  • Including private Qt headers is not recommended. Doing so is presumably the only way to make X11 features available in Qt6, but is this really a good idea? Is Qt6 ever likely to make these publicly available?

  • Indeed it's not a good idea but no other idea for the moment. We will see when we will release kf6 if we have more idea, more class etc.

  • As only QX11Info::connection() is used here, QNativeInterface::QX11Application::connection() might be a viable replacement. But yes, the whole situation around the former Q[X11|Android|...]Extras modules is rather unfortunate still.

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