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. close_event->accept() vs qApp->quit()

close_event->accept() vs qApp->quit()

Scheduled Pinned Locked Moved Unsolved General and Desktop
qmainwindowqapplication
1 Posts 1 Posters 620 Views
  • 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.
  • ravasR Offline
    ravasR Offline
    ravas
    wrote on last edited by ravas
    #1

    If we have a QMainWindow subclass with:

    MainWindow::closeEvent(QCloseEvent* close_event)
    {
         something ? close_event->accept() : close_event->ignore();
    }
    

    and a main function with

    main ()
    {
        ...
        int return_code = app.exec()
        qDebug() << return_code;
        return return_code;
    }
    

    the debug does not output anything;
    however, it will if we use a different function with qApp->quit().

    What does accepting the close event of a QMainWindow do differently than calling qApp->quit?

    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