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

QMdiArea: alien widget shines through QGLWidget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.5.1
    • GUI: Workspace
    • 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.

      Attachments

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

        Activity

          People

            bjnilsen Bjørn Erik Nilsen
            sthomass Stian Sandvik Thomassen (closed Nokia identity) (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes