Results 1 to 3 of 3

Thread: QSystemTrayIcon: Overridden balloon msg

  1. #1
    Join Date
    Apr 2008
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question QSystemTrayIcon: Overridden balloon msg

    Hi All,

    My application is a mailbox monitor (Java/QtJambi), polling email accounts to look for new messages. Tray ballons are used to display information (new message available...) or/and errors (server not responding...).

    I use a FIFO mecanism to push notifications into a queue. I'd like to pop notifications and display them using showMessage() with some mecanism allowing the user to confirm the previous balloon has been read before displaying the next one, to avoid unnoticed "critical" notifications being overridden before they have been read.

    I'm aware of the messageClicked() signal that may inform of the closure of the balloon. However I'm looking for a way to known whether a balloon is currently displayed, rather than using a flag mecanism fueled by showMessage() and messageClicked() that may desynchronize easily.

    Any help will be appreciated (C++ or Java ok)
    Thanks.
    Robert.

  2. #2
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QSystemTrayIcon: Overridden balloon msg

    Actually I don't see your concern. What's wrong with flagging messages as "acknowledged" or "dismissed" upon QSystemTrayIcon::messageClicked(). Seeing that QSystemTrayIcons API is pretty minimal, any other solution will surely be highly platform dependent and likely much more complicated.

  3. #3
    Join Date
    Apr 2008
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSystemTrayIcon: Overridden balloon msg

    Spud, thanks for the feedback which could confirm there is no simple way to do that.

    A balloon may be closed by the system itself without user action, leaving the application in a state like "maybe the balloon has been closed before the user saw it, maybe it is still visible".

    With Windows XP, when the user doesn't interact, balloons remain visible as long as the application keeps the focus (beyond the timeout hint provided in QSystemTrayIcon::showMessage()), when the application losts the focus, the balloon disappears. It seems no event/signal is triggered in this case (as well as when the timeout hint has expired).

    This will make it difficult to have a reliable semaphore system. I know when to raise the "notificationIsVisible flag", but clearing it upon QSystemTrayIcon::messageClicked () is not sufficient (at least a timer needs to be used, but as explained above, still not reliable). I'm considering using alternatives.

    Robert.

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.