XMLWordPrintable

Details

    • Technical task
    • Resolution: Done
    • Not Evaluated
    • None
    • GUI: Window management, QPA
    • None
    • 17e7d9862 (dev), 5d341c848 (6.6)

    Description

      To enable window embedding higher in the stack (Qt Widgets, Qt Quick), we rely on primitives provided by QtGui and in turn the QPA layer. This task is a survey of these enablers, and the current state on the various platforms.

      • QWindow support
        • All platforms (hopefully) have this  
      • Multiple top level QWindows
        • Not a requirement for window embedding, but a related topic
      • Child QWindow support
        • A QWindow be both top level (with or without a transient parent), or a child window
        • Child window support requires that the platform handles QPlatformWindow::setParent()
        • Child windows handle all input transformation, ie content is agnostic to the window being a child.
      • QWindow::setMask()
        • Useful for masking away part of the window (punching a hole)
        • Is documented to apply to input events (mouse, touch)
        • Is not guaranteed to visually clip the window
          • Client should clip drawing to mask
      • QWindow::fromWinId()
        • Allows adopting windows created via the native APIs
        • Results in a QWindow that represents the native window
        • Supports two distinct use-cases
          • Embedding of a Qt window into a native window
            • Useful for using Qt as part of a larger application writing with a native toolkit
            • The foreign window acts only as a parent for the Qt window
            • No other modifications of the native window through the wrapper QWindow
          • Embedding of a native window into a Qt window
            • Useful for adding UI elements to a Qt app that Qt doesn’t support (yet)
            • Or where the platform has native UI controls that we can’t easily replicate
            • The foreign window must support parenting into another QWindow
            • Once parented, it should support all normal operations on a QWindow, since the rest of the app shouldn’t care that the window is foreign. E.g setGeometry, setMask, setOpacity
              • Our various platforms differ in how far they go here. At a minimum we need setParent and setGeometry
      • QSurfaceFormat::setAlphaBufferSize()
        • Allows windows with transparency
        • Useful for overlays that are not perfectly square

      A test case for these areas is added in qtbase tests/manual/embeddedwindows/

      Shown here on macOS:

      • The top row tests child windows, with a circular setMask, and with alpha channel
      • The second row tests foreign windows, with a mask
      • The third row is a foreign window with an embedded Qt window

      Attachments

        1. image-2023-08-17-17-14-20-598.png
          127 kB
          Tor Arne Vestbø
        2. image-2023-08-17-17-15-21-143.png
          448 kB
          Tor Arne Vestbø
        3. image-2023-08-17-17-18-30-828.png
          127 kB
          Tor Arne Vestbø
        4. image-2023-08-17-17-19-03-169.png
          289 kB
          Tor Arne Vestbø
        5. image-2023-08-17-17-21-57-475.png
          399 kB
          Tor Arne Vestbø
        6. image-2023-08-17-17-22-51-548.png
          428 kB
          Tor Arne Vestbø
        7. image-2023-08-17-17-23-59-859.png
          583 kB
          Tor Arne Vestbø
        8. image-2023-08-17-17-44-21-002.png
          161 kB
          Tor Arne Vestbø
        9. image-2023-08-17-18-04-36-255.png
          177 kB
          Tor Arne Vestbø

        Issue Links

          For Gerrit Dashboard: QTBUG-116183
          # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes