Results 1 to 3 of 3

Thread: QSystemTray stays longer than it should !

  1. #1
    Join Date
    Jan 2006
    Posts
    185
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QSystemTray stays longer than it should !

    I just created a QSystemTray.

    Qt Code:
    1. trayIcon->showMessage("Beta 0.9", "You are logged in", trayIcon->Information, 1);
    To copy to clipboard, switch view to plain text mode 

    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 ?
    Last edited by probine; 21st December 2006 at 11:17.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QSystemTray staus longer than it should !

    Quote Originally Posted by probine View Post
    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.

    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:
    Qt Code:
    1. setAttribute(Qt::WA_DeleteOnClose, true);
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Posts
    185
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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 ?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.