Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
6.2.0
-
None
-
-
c4ce5d64ed (qt/qtdoc/dev) 86cead92ae (qt/qtdoc/6.4) 86cead92ae (qt/tqtc-qtdoc/6.4) c4ce5d64ed (qt/tqtc-qtdoc/dev) 7f4e611401 (qt/tqtc-qtdoc/6.2) 86cead92ae (qt/qtdoc/6.4.1) 86cead92ae (qt/tqtc-qtdoc/6.4.1)
Description
The porting guide at https://doc.qt.io/qt-6/extras-changes-qt6.html#changes-to-qt-x11-extras is only talking about including the QtGui/private/qtx11extras_p.h private header to be able to use QX11Info.
However, as we (thanks to David Redondo ) found out while porting the KDE Frameworks to Qt6, there are viable alternatives to some of the functionality of QX11Info that can be used instead of relying on private API:
- QX11Info::isPlatformX11() can be replaced by checking `QGuiApplication::platformName() == "xcb"
- QX11Info::display() and QX11Info::connection() can be replaced by using QGuiApplication::nativeInterface():
auto *nativeInterface = qGuiApp->nativeInterface<QNativeInterface::QX11Application>();
if (nativeInterface) { auto *xdisplay = nativeInterface->display(); auto *xconnection = nativeInterface->connection(); .... .... }
Attachments
Issue Links
- relates to
-
QTBUG-103715 QNativeInterface::QX11Application::display() example missing
- Reported