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

Change in behaviour of WA_QuitOnClose when WA_DontShowOnScreen is set

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P0: Blocker
    • 4.7.2
    • 4.7.2
    • None
    • Windows, Symbian RelTestRound2

    Description

      f75d55f1a71cae9864ca4bf12c92fcd9e34ed651 commit changes behavior of WA_QuitOnClose when WA_DontShowOnScreen
      was used. Now it works differently between two Qt versions. Therefore following test case from BC suite is failed.

          {
              int argc = 0;
              QApplication app(argc, 0, QApplication::GuiServer);
              QTimer timer;
              timer.setInterval(100);
      
              QSignalSpy spy(&app, SIGNAL(aboutToQuit()));
              QSignalSpy spy2(&timer, SIGNAL(timeout()));
      
              QPointer<QMainWindow> mainWindow = new QMainWindow;
              QPointer<QWidget> invisibleTopLevelWidget = new QWidget;
              invisibleTopLevelWidget->setAttribute(Qt::WA_DontShowOnScreen);
      
              QVERIFY(app.quitOnLastWindowClosed());
              QVERIFY(mainWindow->testAttribute(Qt::WA_QuitOnClose));
              QVERIFY(invisibleTopLevelWidget->testAttribute(Qt::WA_QuitOnClose));
              QVERIFY(invisibleTopLevelWidget->testAttribute(Qt::WA_DontShowOnScreen));
      
              mainWindow->show();
              invisibleTopLevelWidget->show();
      
              timer.start();
              QTimer::singleShot(1000, mainWindow, SLOT(close())); // This should quit the application
              QTimer::singleShot(2000, &app, SLOT(quit()));        // This makes sure we quit even if it didn't
      
              app.exec();
      
              QCOMPARE(spy.count(), 1);
              int count = spy2.count();
              QVERIFY(spy2.count() < 15);      // Should be around 10 if closing caused the quit
          }
      

      This test case was deleted from tests/auto in Qt 4.7. But it is significant changes and can affect on application developed using Qt 4.6 and run on Qt 4.7.

      Attachments

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

        Activity

          People

            biochimia João Abecasis
            vasyura Oleh Vasyura
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes