Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
5.1.0 Beta 1
-
None
Description
Try the following app:
#include <QtGui> #include <QtWidgets> class MyDialog: public QDialog { public: MyDialog() { createWidgets(); } private: void createWidgets() { QVBoxLayout *layout = new QVBoxLayout(this); QPushButton *button = new QPushButton("Test", this); connect(button, SIGNAL(clicked()), this, SLOT(accept())); layout->addWidget(button); } }; int main(int argc, char **argv) { QApplication app(argc, argv); MyDialog dialog; dialog.exec(); }
Clicking "Test" should make the dialog box close. When running on the OpenGL enabled platform plugin, it hangs instead inside the event dispatcher.
It's easy to test the broken behavior by adding "QT += opengl" to the .pro file and running qmake && make clean && make. Then it should load the EGL back-end and you should see the bug.
This only happens if you don't start a top level event loop first. To work around the bug in the example, you could replace the contents of the main function with the following:
int main(int argc, char **argv) { QApplication app(argc, argv); MyDialog dialog; QTimer::singleShot(0, &dialog, SLOT(exec())); QObject::connect(&dialog, SIGNAL(accepted()), QApplication::instance(), SLOT(quit())); return app.exec(); }
Attachments
Issue Links
- replaces
-
QTBUG-30879 Android: qmlscene crashes when closing the initial QFileDialog and trying to set up the scene
- Closed