Hi,
I've a problem catching WM_QUERYENDSESSION inside my QAbstractEventDispatcher function. Main window implements closeEvent() with event->ignore(). This prevents application to exit on system(win) shutdown. Threrefore I've set global event filter:
testEventFilter catches messages, but not the WM_QUERYENDSESSION. I thought message comes at first to testEventFilter() and then will be processed by Qt event loop. It seems to be not the case. How can I provide proper shutdown without changing main window code?Qt Code:
bool testEventFilter(void *message) { MSG* m=static_cast<MSG*>(message); if (m->message == WM_QUERYENDSESSION) qDebug()<<"Shutdown detected!"; if (origEventFiler) origEventFiler(message); return false; } ... origEventFiler=d->setEventFilter(digicongEventFilter);To copy to clipboard, switch view to plain text mode
Bookmarks