QSystemTrayIcon closes my complete application
Hey @all,
I'Ve an application with an system tray icon. When the application is hidden and i open and close a dialog from the context menu of the tray icon, then the complete application is closed.
Here is how i open the preference dialog for example:
Code:
Preferences *pPreferences = new Preferences(this);
if(pPreferences) {
pPreferences->setAttribute(Qt::WA_DeleteOnClose);
pPreferences->exec();
}
and in the preference dialog I've the following to close it, if the button "Close" was pressed:
Code:
connect(m_ui->btnClose, SIGNAL(clicked()), this, SLOT(close()));
So, when I press the "Close" button from the preference dialog, then the complete application is closed. The tray icon is gone when i move the mouse cursor over it.
I hope someone could help me please
Best Regards
NoRulez
Re: QSystemTrayIcon closes my complete application
Funny, that happens to me only if the main window isn't showing, which seems to be your case also..