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

[REG 6.3.2 -> 6.4.0] Mac: QWindow blanks when resized by a custom window manager when it contains a QOpenGLWidget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.5.0 Beta1
    • 6.4.0
    • GUI: OpenGL
    • None
    • macOS 12.6
      Rectangle Pro 2.6.2
      Python 3.10.7 (installed with MacPorts)
    • macOS
    • 2decbe0417 (qt/qtbase/dev) 2decbe0417 (qt/tqtc-qtbase/dev)

    Description

      When using a window manager such as Rectangle, the window will blank to grey when resized by the manager if it contains a QOpenGLWidget. This doesn't happen if it only contains regular widget.

      This can be demonstrated with this simple program:

      from PySide6.QtGui import QPaintEvent, QPainter, QColor
      from PySide6.QtOpenGLWidgets import QOpenGLWidget
      from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton
      
      
      class MyWidget(QOpenGLWidget):
       def paintEvent(self , event: QPaintEvent):
       painter = QPainter(self)
       painter.fillRect(0, 0, 50, 50, QColor.fromRgb(255, 255, 128))
       painter.end()
      
      
      class MainWindow(QMainWindow):
       def __init__(self):
       super().__init__()
      
       self.setCentralWidget(MyWidget())
      
      
      app = QApplication(sys.argv)
      
      window = MainWindow()
      window.show()
      
      app.exec()

      (sorry, I'm unable to provide a C++ version of the same)

      Here is a recording of the behaviour:

       

      Note that for a resizeGL()/paintGL() implementation, resizeGL() is called when the window manager resizes the window, but paintGL() is not.

      If MyWidget() is replaced by some other widget (e.g. a button), the behaviour is as expected.

       

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            abey Antoine Beyeler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes