Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.4.0
-
None
-
macOS 12.6
Rectangle Pro 2.6.2
Python 3.10.7 (installed with MacPorts)
-
-
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.