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

Details

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

    Description

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

      Attachments

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

        Activity

          People

            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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes