PDA

View Full Version : Tooltip erraticity with QGraphicsPixmapItem



kghose
10th July 2008, 20:47
Firstly, I glad I found this forum. It has answers to almost every question I had with QT. Its great to find this community.

One question I could not find the answer to is this:

I have a bunch of QGraphicsPixmapItems (subclassed to my own class) inserted into a QGraphicsScene and I set their tooltips.

The behavior I expected is a tooltip popup on mouse hover over an item, and a quick switch to the next tool tip when the mouse hovers over another item.

The actual behavior is erratic. Sometimes it will work as expected, but sometimes even when I move the mouse to another item, the old tool tip remains.

Is there a setting I have to play with somewhere, or is this a more fundamental windowing system problem?

I am on Mac OS X, Qt version 4.4.0 g++ version i686-apple-darwin9-g++-4.0.1

Thanks
-K

wysota
10th July 2008, 21:46
Unfortunately there are no good ways to overcome the problem. The only thing you can do is to catch the event responsible for tooltips and handle it yourself (it is "help event"), but I can't guarantee that the delay is not caused by a late delivery of the help event itself.

kghose
10th July 2008, 21:51
Thanks for your reply. Could I also force a tooltip showing from the hoverevents? I found those to be deterministic.

Thanks
-K

JimDaniel
10th July 2008, 21:58
I don't have any advice, I just wanted to thank you for introducing me to such a cool word - erraticity - gonna start using that one. :-)

wysota
10th July 2008, 21:59
If you implement it yourself, then sure - the QToolTip class (and QTimer, I guess) is your friend. Just be aware there will be some cases where relying on the hover event won't work.