PDA

View Full Version : Is the QToolTip::showText Bug?



cspp
15th May 2009, 03:46
Now I want to show some tips when my mouse hovered on some QTreeWidgetItem in QTreeWidget.

but the tips sometimes show and change well,but sometimes it does not changed,although
I have to change the position.
The porblem is:
when the mouse hovered on the first item,it should be show like "TipA";
and the second third item also show the tip "TipA".but the position should be changed!

but now,it didn't changed!

In QTooltip::showText,I find this code:

else if (!QTipLabel::instance->fadingOut){
// If the tip has changed, reuse the one
// that is showing (removes flickering)
if (QTipLabel::instance->tipChanged(pos, text, w)){
QTipLabel::instance->reuseTip(text);
QTipLabel::instance->setTipRect(w, rect);
QTipLabel::instance->placeTip(pos, w);
}
return;
}

if my tip contents didnot changed,it will be returned direct when I use QToolTip::showText();

so in function tipChanged,should add some judgement like pos!

aamer4yu
15th May 2009, 05:38
I guess thats the behaviour.
Tooltip doesnt change if text hasnt changed.
If you want to update the tooltip rapidly, you will need to override the mousemoveevent and show tooltip yourself.

cspp
15th May 2009, 06:12
I guess thats the behaviour.
Tooltip doesnt change if text hasnt changed.
If you want to update the tooltip rapidly, you will need to override the mousemoveevent and show tooltip yourself.

yes,I have to QToolTip::hideText() everytime when I user QToolTip::showText()