QApplication can’t be receiver of its own signal aboutToExit?
I got some cleanup job before app exit, by following document, I built my own QMyApplication with a private slot cleanup() and got it connected to aboutToExit signal.
However, I found cleanup() was never called.
Then I added another class QMyApplicationHelper (definitely inherited from QObject) to receive aboutToExit instead. That worked.
I was wondering if QApplication can’t be receiver of its own signal aboutToExit.
Furthermore, I also tried an idle processing by use of a QTimer with 0 timeout, like
- connect(mIdleTrigger, SIGNAL ( timeout( ) ), this, SLOT ( processIdle( ) ));
- mIdleTrigger->start(0);
It still never worked until I had QMyApplicationHelper be receiver of timer.
I didn’t figure out why there has to be a helper class to take over role of signal receiver.
Thx.
[EDIT: code highlighting, Volker]
4 replies
You must log in to post a reply. Not a member yet? Register here!
