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

macOS: not possible to make QWindow background transparent

XMLWordPrintable

    • macOS
    • ee82f866152a27ef7a0d69f3aa41608d4a058610 (qt/qtbase/5.12)

      When using QBackingStore to render raster in QWindow on Linux it is enough to add to constructor of child class of QWindow (as described in docs https://doc.qt.io/qt-5/qwindow.html#setFormat) :

      {
         ...
      
         QSurfaceFormat fmt = format(); 
         fmt.setAlphaBufferSize(8); 
         setFormat(fmt);
      
         create();
      
         ...
         //new QBackingStore(this)
      }

      and background becomes transparent.

      On MacOS with the same code it is filled with gray color.

        1. linux.png
          linux.png
          21 kB
        2. macos.png
          macos.png
          21 kB
        3. rasterwindow.zip
          9 kB
        For Gerrit Dashboard: QTBUG-77637
        # Subject Branch Project Status CR V

            vestbo Tor Arne Vestbø
            e.nemtsev Egor Nemtsev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes