Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.0, 6.1, 6.2, 6.3.0
Description
I believe `QGuiApplication::nativeInterface<QNativeInterface::QX11Application>()` does not accurately document how to use this interface to get the XCB Display pointer.
I looked into the tests and examples for how to use this, and came up empty.
What I find lacking is that:
- It was difficult to discover how to access a QNativeInterface::QX11Application object for an application. I started out finding this through the following links, in order:
- https://doc.qt.io/qt-6/native-interfaces.html
- https://doc.qt.io/qt-6/qnativeinterface.html
- https://doc.qt.io/qt-6/qnativeinterface-qx11application.html
From there, there is a very terse description that just says:
Accessed through QGuiApplication::nativeInterface().
Then, most importantly (and I still haven't solved this), https://doc.qt.io/qt-6/qnativeinterface-qx11application.html#display does not indicate when this call should return a valid xcb Display *. Whenever I have called this from a test application, it is always nullptr. I would have expected it to return a valid Display * after a window is displayed.
To test this, I have altered the gui/analogclock example to fetch the Display * and print out it's pointer. I will attach that code to this example.
I think it would also be good to provide some specific guidance on how to port old Qt 5 code that uses QX11Info::display() from the QtX11Extras to this new API in Qt 6.
Attachments
Issue Links
- relates to
-
QTBUG-103856 Add replacement for some QX11Info alternatives to Qt6 porting guide
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-103715 | ||||||
---|---|---|---|---|---|---|
# | 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 |