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
For Gerrit Dashboard: QTBUG-103856 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
439445,9 | Add more info about QX11Info alternatives | dev | qt/qtdoc | Status: MERGED | +2 | 0 |
439703,2 | Add more info about QX11Info alternatives | 6.4 | qt/qtdoc | Status: MERGED | +2 | 0 |
439710,3 | Add more info about QX11Info alternatives | tqtc/lts-6.2 | qt/tqtc-qtdoc | Status: MERGED | +2 | 0 |