QSystemTray stays longer than it should !
I just created a QSystemTray.
Code:
trayIcon->showMessage("Beta 0.9", "You are logged in", trayIcon->Information, 1);
The idea is that the message displayed in the tray should stay for a very short period of time, but it stays there for about 10 seconds.
1. How can I make sure that the message disappears after 2 seconds ?
2. The system tray icon is a child of my QMainWindow, but when I close the window, the icon stays in the system tray. Why ? How can I destroy it together with the window ?
Re: QSystemTray staus longer than it should !
Quote:
Originally Posted by
probine
1. How can I make sure that the message disappears after 2 seconds ?
Notice that QSystemTrayIcon::showMessage() takes the time parameter as milliseconds so you should try passing 2000.
Quote:
2. The system tray icon is a child of my QMainWindow, but when I close the window, the icon stays in the system tray. Why ? How can I destroy it together with the window ?
Closing a window does not delete it unless you set the Qt::WA_DeleteOnClose attribute:
Code:
setAttribute(Qt::WA_DeleteOnClose, true);
Re: QSystemTray stays longer than it should !
I have set the time to 2000, but it is still the same... no matter what it is the same
I am showing this bubble after I call show(); in the tray icon !!!
What is wrong ?