Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Application does not quit
Forum Updated to NodeBB v4.3 + New Features

Application does not quit

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 822 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fxrh
    wrote on last edited by
    #1

    I'm working on an application which does not quit even though

    • I close the last window
    • quitOnLastWindowClosed is set to true
    • the signal "QApplication::lastWindowClosed" is emitted.

    I checked all above with the following code:

    QObject::connect(&app, &QApplication::lastWindowClosed, []{
            qDebug() << "Last window closed!";
            qDebug() << "Quit on last window closed: " << qApp->quitOnLastWindowClosed();
            //QApplication::postEvent(qApp, new QEvent(QEvent::Quit));
        });
    

    If I uncomment the last line, the application quits.

    Is this a bug? Or am I doing something wrong?

    kshegunovK 1 Reply Last reply
    0
    • F fxrh

      I'm working on an application which does not quit even though

      • I close the last window
      • quitOnLastWindowClosed is set to true
      • the signal "QApplication::lastWindowClosed" is emitted.

      I checked all above with the following code:

      QObject::connect(&app, &QApplication::lastWindowClosed, []{
              qDebug() << "Last window closed!";
              qDebug() << "Quit on last window closed: " << qApp->quitOnLastWindowClosed();
              //QApplication::postEvent(qApp, new QEvent(QEvent::Quit));
          });
      

      If I uncomment the last line, the application quits.

      Is this a bug? Or am I doing something wrong?

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      @fxrh said in Application does not quit:

      Is this a bug?

      Possibly, but provide MWE that reproduces the issue and the relevant specs (OS, Qt version, window manager etc.) with which you experience it.

      Or am I doing something wrong?

      Not from what I can see.

      Read and abide by the Qt Code of Conduct

      F 1 Reply Last reply
      0
      • kshegunovK kshegunov

        @fxrh said in Application does not quit:

        Is this a bug?

        Possibly, but provide MWE that reproduces the issue and the relevant specs (OS, Qt version, window manager etc.) with which you experience it.

        Or am I doing something wrong?

        Not from what I can see.

        F Offline
        F Offline
        fxrh
        wrote on last edited by
        #3

        @kshegunov Thank you! I'm not sure I'll be able to provide a MWE, as I'm out of ideas what could cause this.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved