Results 1 to 6 of 6

Thread: How to close application?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2006
    Location
    Zürich, Switzerland
    Posts
    23
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to close application?

    Hi

    From the Qt docs:

    Regarding qApp->quit(), qApp->exit() etc:
    Note that ... this function does return to the caller -- it is event processing that stops.


    Therefore try this: First terminate the Qt event loop processing and then end the application with the exit() function from stdlib.h:

    Qt Code:
    1. #include <QCoreApplication>
    2. #include <stdlib.h>
    3.  
    4. ...
    5. if(result == QDialog::Rejected)
    6. {
    7. QCoreApplication::quit(0);
    8. exit(0);
    9. }
    To copy to clipboard, switch view to plain text mode 

    Regards
    Ernst

  2. The following user says thank you to 3dch for this useful post:

    aMan (11th August 2006)

Similar Threads

  1. Replies: 3
    Last Post: 8th December 2006, 18:51
  2. How to install my own application in QUnitTest
    By Artschi in forum Qt Programming
    Replies: 3
    Last Post: 18th July 2006, 16:05
  3. Qmenu Stable close on QTableWidget
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 17th July 2006, 10:03
  4. Replies: 5
    Last Post: 24th April 2006, 15:42
  5. Replies: 3
    Last Post: 31st March 2006, 18:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.