PDA

View Full Version : How to quit my application from any point of any class



tonnot
28th July 2011, 09:03
I can't get to terminate my application from a class that is at a deep level.
(In example class A, creates B, this creates D, and this last has a for loop in which class E is used ).
qApp.quit(); does nothing. (neither other options)
Any help ?

Zlatomir
28th July 2011, 09:10
By connecting one quit_signal to the qApp (http://doc.qt.nokia.com/latest/qapplication.html#qApp)'s quit (http://doc.qt.nokia.com/latest/qcoreapplication.html#quit) slot.

LE: You need: #include <QApplication> into the .cpp where you want to use the qApp macro.