Results 1 to 5 of 5

Thread: How to pop up information when mousing over system tray icon?

  1. #1
    Join Date
    Jun 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to pop up information when mousing over system tray icon?

    Like a tooltip, but not just a string.

    I'm using python and qt4, but If someone can tell me how to do this in C++ I should be able to convert the code...

    I know some kde3 applications that do this, ie Power Manager. I would like a cross platform way of doing this as I do run my application on both linux and windows but if it will only work on linux that would be ok...

    (On further investigation i've found that Power Manager is a python program, using the KDE KSystemTray for it's system tray icon.)

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to pop up information when mousing over system tray icon?

    Have you tried using QSystemTrayIcon::setTooltip ??

    Hope it works for you

  3. #3
    Join Date
    Jun 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to pop up information when mousing over system tray icon?

    Well, according to the qt docs you linked to, the setTooltip method only takes a QString. I want to have a read only QTextEdit pop up when you mouse over the icon...

  4. #4
    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: How to pop up information when mousing over system tray icon?

    Quote Originally Posted by jords View Post
    Well, according to the qt docs you linked to, the setTooltip method only takes a QString. I want to have a read only QTextEdit pop up when you mouse over the icon...
    What's the advantage of a read only QTextEdit as tooltip? With QToolTip the tip can be any rich text formatted string.
    J-P Nurmi

  5. #5
    Join Date
    Jun 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to pop up information when mousing over system tray icon?

    Hey, that actually works quite well!

    I didn't realize that you could just put a whole lot of information directly into the tooltip... quite cool.
    I'm setting it to the same html that I was using for the QTextEdit. Works fine on linux, but just tried it on windows, and my tooltip is just my (truncated) html code - so not cross platform?

Similar Threads

  1. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13

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.