Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2083

QWindow blanks when resized by a windows manager when it contains a QOpenGLWidget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.3.2, 6.4.0
    • PySide
    • None
    • macOS 12.6
      Rectangle Pro 2.6.2
      Python 3.10.7 (installed with MacPorts)
    • macOS

    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()

       

      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

            crmaurei Cristian Maureira-Fredes
            abey Antoine Beyeler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes