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

QDialogs: Native Dialogs keep running even when the parent Qt dialog is already destroyed.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8
    • None
    • macOS

    Description

      It looks like on macOS the Native Dialogs keep running even when the parent Qt dialog is already destroyed. The error was found by following code
      tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp:

      void tst_QColorDialog::noCrashWhenParentIsDeleted()
      {
          QPointer<QWidget> mainWindow = new QWidget();
          QTimer::singleShot(1000, mainWindow, [mainWindow]
                             { if (mainWindow.get()) mainWindow->deleteLater(); });
          const QColor color = QColorDialog::getColor(QColor::fromRgba(0xffffffff), mainWindow.get(),
                                                      QString(), QColorDialog::ShowAlphaChannel);
          QVERIFY(!color.isValid());
          QVERIFY(!mainWindow.get());
      }
      

      Actual test-case result:

       

      agent:2024/09/12 07:57:10 build.go:404: 515: === End of stack trace === agent:2024/09/12 07:57:10 build.go:404: 515: QFATAL : tst_QColorDialog::noCrashWhenParentIsDeleted() Test function timed out agent:2024/09/12 07:57:10 build.go:404: 515: FAIL! : tst_QColorDialog::noCrashWhenParentIsDeleted() Received a fatal error. agent:2024/09/12 07:57:10 build.go:404: 515: Totals: 5 passed, 1 failed, 0 skipped, 0 blacklisted, 309598ms

       

      NOTE:

      To prevent current problem we are setting the QColorDialog::DontUseNativeDialog option for noCrashWhenParentIsDeleted() test-cases.

      Attachments

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

        Activity

          People

            vestbo Tor Arne Vestbø
            tatiana.borisova Tatiana Borisova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes