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

QMessageBox with standardButtons == QMessageBox::NoButton don't react on signal close()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • Some future release
    • 4.5.0, 4.5.1, 4.5.2, 4.5.3, 5.7.0
    • None
    • Windows XP/Vista, MS Visual Studi 2005.

    Description

      #include <QtGui/QApplication>
      #include <QMessageBox>
      #include <QTimer>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          a.setQuitOnLastWindowClosed ( true );
      
          QMessageBox w( QMessageBox::Information, 
              QObject::tr("QMessageBox test"),
              QObject::tr("This message box should be closed in 5 s" ));
          w.setStandardButtons(QMessageBox::NoButton);
          w.show();
          QTimer::singleShot( 5000, &w, SLOT(close()) );
          return a.exec();
      }
      

      This test program never ends.
      After commenting line
      w.setStandardButtons(QMessageBox::NoButton);
      we have QMessageBox with OK button and program ends after 5 s.

      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
            lesiok Leszek Kubrak
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes