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

QGLWidget with parent widget and hidden toolbar with widget shows white rectangle on application start under OS X

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.4.1
    • GUI: OpenGL
    • None
    • OS X 10.10.3 MacPro
    • macOS

      When using QGLWidget with a parent widget as the central widget in a main window with a hidden toolbar which again has a widget, a white rectangle will appear in the top left corner of the application on startup. After showing the toolbar the rectangle disappears and will never appear again.

      Here is some simple code which leads to the problem:

      main.cpp
      #include <QApplication>
      #include <QMainWindow>
      #include <QGLWidget>
      #include <QToolBar>
      #include <QMenuBar>
      #include <QMenu>
      
      int main(int argc, char *argv[])
      {
          //QCoreApplication::addLibraryPath("Qt/plugins");
      
          QApplication app(argc, argv);
      
          QMainWindow main;
      
          main.setStyleSheet("background-color: black;");
      
          QWidget *central = new QWidget(&main);
          QGLWidget *gl = new QGLWidget(central);
          main.setCentralWidget(central);
      
          QWidget *w = new QWidget();
          QToolBar *tb = new QToolBar("Test");
          tb->addWidget(w);
          tb->hide();
      
          main.addToolBar(Qt::BottomToolBarArea, tb);
      
          QMenu *m = main.menuBar()->addMenu("View");
          m->addAction(tb->toggleViewAction());
      
          main.show();
      
          main.resize(800, 600);
      
          return app.exec();
      }
      

        1. doublebar.png
          44 kB
          Nicola De Filippo
        2. image.png
          15 kB
          Marcus Fritzen
        3. problem.png
          22 kB
          Marcus Fritzen
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            sorvig Morten Sørvig
            mfritzen Marcus Fritzen
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes