Closed stefanb2 closed 8 years ago
The one generated by the system (the lower entry with icon) quits the program correctly. But it causes issue #45.
The one generated by QT-SESAM (the upper entry without icon) only closes the main window.
As far as I can tell from the source code, the main menu entry File -> Exit
and the system tray icon menu entry Quit
are connected to the main window slot close()
. I.e. they only close the main window, but do not exit the application.
The system generated entry on the system tray icon menu causes this dialog:
![Uploading QtSESAM-tray-menu-Exit-Dialog.png…]()
which I can't find in the source code. So I assume this is a "force application" dialog from the system.
IMHO a real "exit" is missing in the Qt-SESAM code
ah damn... wrong button. This is NOT closed :-(
OK, somehow the PNG uploads got lost. Trying again:
If close()
is called on the MainWindow
the main loop exits, thus ending the application. That's the theory and works on Windows in practice. Regarding the Qt docs this is the desired behavior of close()
and should be the same on other platforms. Should …
I checked the documentation: your mainwindow code looks correct. Except maybe the QMainWindow::closeEvent()
calls.
I even connected the exit
with the closeAllWindows
slot on qApp
and it still doesn't work.
So my assumption is that the problem is in QApplication
, not your main window code. I.e. the application doesn't exit when the last window is closed.
Regarding the extra "Quit" tray item: It doesn't appear on every Linux desktop. So it leads to nothing to #ifdef WIN32
the code section that inserts the "Quit" action :-(
Obviously some Linux desktops add a quit button by themselves. Won't do anything about it. Thus closing this issue.
On my Fedora 22 box with KDE Plasma 5 the system tray icon menu looks like this
![Uploading QtSESAM-tray-menu-KDEPlasma.png…]()
As you can see there is a duplicate "Quit" entry at the end. This is not generated by Qt-SESAM, but automatically by the system (it's translation changes when I switch languages).
I'm not sure how to solve this. If this is the case for every Linux user, but not Windows user, then I would suggest to flag the generation of the "Quit" entry with #ifdef WIN32 in the code.