Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.5.1
-
None
Description
Consider the following example:
#include <QtGui>
#include <QtOpenGL>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QMainWindow mainWin;
QMdiArea *mdiArea = new QMdiArea;
mainWin.setCentralWidget(mdiArea);
mainWin.show();
QGraphicsView *glview = 0;
for (int i = 0; i < 3; ++i)
{ QGraphicsView *view = new QGraphicsView; QGraphicsScene *scene = new QGraphicsScene; scene->setBackgroundBrush(QColor(qrand() % 255, qrand() % 255, qrand() % 255)); scene->setSceneRect(QRectF(0.0, 0.0, 256, 256)); view->setScene(scene); mdiArea->addSubWindow(view); view->show(); if (i == 2) glview = view; }mdiArea->cascadeSubWindows();
if (glview)
glview->setViewport(new QGLWidget);
return app.exec();
}
The expected result is that all sub-windows in the MDI area are shown cascaded without any garbled pixels.
The actual result is that there are garbled pixels in the sub-window with the QGLWidget. The middle sub-window seems to "shine" through the QGLWidget.
The problem seems to be related to mixing alien and native widgets in a QMdiArea.
Note that the problem does not occur if the AA_NativeWindows attribute is set on the QApplication object.