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

QCoreApplication::startingUp() is never false without a QApplication

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.1.0
    • 4.4.1
    • Core: Event loop
    • None
    • fd7b52d268ab3f9cdcdb06a77b715644d2d22ef3 9181ee4d86b29b12d2c87fda0699c10df4b28e43

    Description

      The following prints true even after the QCoreApplication instance has been created. It only returns false after QApplication has been created.

      #include <QtGui>
      
      int main(int argc, char** argv) 
      { 
          qDebug() << "Before QCoreApp c'tor" << QCoreApplication::startingUp();
          {
              QCoreApplication coreapp(argc, argv); 
              qDebug() << "After QCoreApp c'tor" << QCoreApplication::startingUp();
          }
          qDebug() << "After QCoreApp d'tor" << QCoreApplication::startingUp();
          {
              QApplication app(argc, argv); 
              qDebug() << "After QApp c'tor" << QCoreApplication::startingUp();
          }
          qDebug() << "After QApp d'tor" << QCoreApplication::startingUp();
         
          return 0; 
      }
      

      closingDown correctly returns true after either d'tor call, and false after the c'tor. The is_app_running variable is never changed by QCoreApplication or QCoreApplicationPrivate - only by QApplicationPrivate.

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            vhilshei Volker Hilsheimer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes