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

Android: Top-level modal dialog hangs on EGL when no event loop is running

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • 5.2.0
    • 5.1.0 Beta 1
    • Core: Event loop
    • None
    • Android

    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

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              esabraha Eskil Abrahamsen Blomfeldt
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes