Details
-
Task
-
Resolution: Done
-
P2: Important
-
5.12
-
None
Description
Platforms are today represented as platform plugins in src/plugins/platforms, and we expose platform specific functionality in various ad-hock ways:
- QPlatformNativeInterface, a QPA-internal class with functions such as:
- void *nativeResourceForWindow(const QByteArray &resource, QWindow *window)
- QFunctionPointer platformFunction(const QByteArray &function)
- Plumbed out to QGuiApplication::platformFunction
- QtPlatformHeaders, a header-only module with no binary compatibility promise, only source compatibility
- QtMacExtras, QtX11Extras
All of these require plumbing and boilerplate to expose platform-specific functionality.
One way to improve on this situation is to move platforms into src/platforms, as libraries, with their own private headers. The plugins will then just be thin wrappers to dynamically load a platform, linking to the corresponding platform library.
Users who want to use platform-specific functionality can then do e.g. QT += macos-private, include the relevant headers such as qcocoawindow.h, and cast the QWindow's handle.
Attachments
Issue Links
- relates to
-
QTBUG-75990 Extend QPA on Qt6 for all aspects of target platform
- Withdrawn
-
QTBUG-69411 XCB Plugin Changes in Qt 6
- Closed
-
QTBUG-81876 Research on how to re-organize the Extras [Spike]
- Closed
-
QTBUG-68847 Qt Wayland Changes planned for Qt 6
- Closed