Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
None
-
5.4.1
-
None
-
OS X 10.10.3 MacPro
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(); }