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

Dialog without button does not close()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.1
    • None
    • KDE Neon 18.04
    • Linux/X11

    Description

      I tried to use a message box without button.

      Please consider the following demo snippet:

      QMessageBox* d = new QMessageBox(this);
      d->setText("Hello");
      // d->setStandardButtons(QMessageBox::Ok);
      d->setStandardButtons(QMessageBox::NoButton); // Dialog does not close
      d->open();
      QTimer::singleShot(3000, d, &QMessageBox::close);

      Using the "QMessageBox::Ok" line, the dialog closes after 3 seconds. Using the "QMessageBox::NoButton" line the dialog stays open. This is probably not how it should behave. Even a dialog without buttons should allow to be closed programmatically.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            silicomancer Bernhard Lindner
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes