Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-70518

Make platform plugins libraries with their own private headers

    XMLWordPrintable

Details

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              vestbo Tor Arne Vestbø
              vestbo Tor Arne Vestbø
              Votes:
              1 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes