How do I properly implement a \"minimize to tray\" function in Qt?
I tried the following code inside QMainWindow::changeEvent(QEvent *e), but the window
QMainWindow::changeEvent(QEvent *e)
I have found that the showMinimized() slot works without a QTimer delay, so you can use code like:
showMinimized()
mw->show(); if ( qApp->arguments().contains( "--startHidden" ) ) mw->showMinimized();
in your main() to show a main window and immediately iconize it, when desired.
main()