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