tooltip概率不显示问题

This commit is contained in:
hanpinlong 2024-06-09 10:38:54 +08:00
parent 25d289373e
commit e97ca4f020
1 changed files with 8 additions and 9 deletions

View File

@ -508,15 +508,14 @@ void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w, cons
else if (!QTipLabel::instance->fadingOut){
// If the tip has changed, reuse the one
// that is showing (removes flickering)
// QPoint localPos = pos;
// if (w)
// localPos = w->mapFromGlobal(pos);
// if (QTipLabel::instance->tipChanged(localPos, text, w)){
// QTipLabel::instance->reuseTip(text, msecDisplayTime, pos);
// QTipLabel::instance->setTipRect(w, rect);
// QTipLabel::instance->placeTip(pos, w);
// }
QTipLabel::instance->hideTip();
QPoint localPos = pos;
if (w)
localPos = w->mapFromGlobal(pos);
if (QTipLabel::instance->tipChanged(localPos, text, w)){
QTipLabel::instance->reuseTip(text, msecDisplayTime, pos);
QTipLabel::instance->setTipRect(w, rect);
QTipLabel::instance->placeTip(pos, w);
}
return;
}
}