PDA

View Full Version : How to pop up information when mousing over system tray icon?



jords
30th June 2008, 05:29
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.)

aamer4yu
30th June 2008, 05:57
Have you tried using QSystemTrayIcon::setTooltip ??

Hope it works for you :)

jords
30th June 2008, 06:04
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...

jpn
30th June 2008, 06:49
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.

jords
30th June 2008, 07:25
Hey, that actually works quite well! :D

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? :confused: