PDA

View Full Version : QSystemTrayIcon closes my complete application



NoRulez
15th March 2010, 21:08
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:


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:


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

been_1990
16th March 2010, 02:37
Funny, that happens to me only if the main window isn't showing, which seems to be your case also..