I have a Qt application (A) that runs as a Windows system tray application.
I also have another Qt application (B) that launches/closes any executable.
If I try to close application (A) with its system tray context menu, everything works as expected (process is killed, system tray icon disappears).
However, if I try to close application (A) via application (B), the system tray icon of application (A) disappears, but its process remains running in the background. I have to force kill the process to get it to quit.
Application (B) uses QProcess to launch executables. When requested, it calls QProcess::terminate() to close the launched application.
There is no issue closing applications that actually have windows (forms). It is only this one windowless system tray application (A) that is having issues.
I have overridden the QWidget::closeEvent(...), which is never triggered/called.
How can I get the closeEvent(...) to be triggered in application (A)?
Qt documentation implies that the closeEvent is triggered by a window close request, which may be the problem since application (A) has no windows. Do I need to give application (A) a form and hide it?