diff options
author | Thomas Sondergaard <ts@medical-insight.com> | 2009-07-24 13:56:05 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-07-24 14:03:55 (GMT) |
commit | 11985909ddb17283e392244ee72ed54baa9a7339 (patch) | |
tree | 26e825ef5b0c68e7a352b2540cdb45effd213672 /src | |
parent | a588ca19acd2f0f6a55426a30d8ef029d8dbb99b (diff) | |
download | Qt-11985909ddb17283e392244ee72ed54baa9a7339.zip Qt-11985909ddb17283e392244ee72ed54baa9a7339.tar.gz Qt-11985909ddb17283e392244ee72ed54baa9a7339.tar.bz2 |
Specify widget when calling QToolTip::showText() to make sure the tool tip ends up on the right X11 screen.
Merge-request: 987
Reviewed-by: Olivier Goffart <ogoffart@trolltech.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/qworkspace.cpp | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 4796436..9b6414d 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -3457,7 +3457,7 @@ void QGraphicsScene::helpEvent(QGraphicsSceneHelpEvent *helpEvent) text = toolTipItem->toolTip(); point = helpEvent->screenPos(); } - QToolTip::showText(point, text); + QToolTip::showText(point, text, helpEvent->widget()); helpEvent->setAccepted(!text.isEmpty()); #endif } @@ -3556,8 +3556,7 @@ void QGraphicsScenePrivate::leaveScene() { Q_Q(QGraphicsScene); #ifndef QT_NO_TOOLTIP - // Remove any tooltips - QToolTip::showText(QPoint(), QString()); + QToolTip::hideText(); #endif // Send HoverLeave events to all existing hover items, topmost first. QGraphicsView *senderWidget = qobject_cast<QGraphicsView *>(q->sender()); diff --git a/src/gui/widgets/qworkspace.cpp b/src/gui/widgets/qworkspace.cpp index 2833c08..3184140 100644 --- a/src/gui/widgets/qworkspace.cpp +++ b/src/gui/widgets/qworkspace.cpp @@ -110,11 +110,11 @@ bool QMDIControl::event(QEvent *event) QStyle::SubControl ctrl = style()->hitTestComplexControl(QStyle::CC_MdiControls, &opt, helpEvent->pos(), this); if (ctrl == QStyle::SC_MdiCloseButton) - QToolTip::showText(helpEvent->globalPos(), QWorkspace::tr("Close")); + QToolTip::showText(helpEvent->globalPos(), QWorkspace::tr("Close"), this); else if (ctrl == QStyle::SC_MdiMinButton) - QToolTip::showText(helpEvent->globalPos(), QWorkspace::tr("Minimize")); + QToolTip::showText(helpEvent->globalPos(), QWorkspace::tr("Minimize"), this); else if (ctrl == QStyle::SC_MdiNormalButton) - QToolTip::showText(helpEvent->globalPos(), QWorkspace::tr("Restore Down")); + QToolTip::showText(helpEvent->globalPos(), QWorkspace::tr("Restore Down"), this); else QToolTip::hideText(); #endif // QT_NO_TOOLTIP |