summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Funk <kfunk@kde.org>2014-09-29 17:34:46 +0200
committerKevin Funk <kevin.funk@kdab.com>2014-09-30 17:54:19 +0200
commit5fbad0e976b4b603e2f4faccbcb5c052d917ba7a (patch)
tree7d1a2510cb8f476743112976d38ce4135eaff8b0
parent1aecda36d1d12bcd24a5ee87dd82ed04f85c41e2 (diff)
downloadqtquickcontrols-5fbad0e976b4b603e2f4faccbcb5c052d917ba7a.tar.gz
Fix tooltip position for real inside QQuickWidgets5.3
If the QQuickWidget was embedded in a complex layout, tooltip positions would be off. Tooltip positions need to be moved by the offset of the actual render window. Task-number: QTBUG-39878 Change-Id: I5f923b1d1a0956aa67afa7c05d4bfec2788682a6 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
-rw-r--r--src/controls/Private/qquicktooltip.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/controls/Private/qquicktooltip.cpp b/src/controls/Private/qquicktooltip.cpp
index 30ac58ee..f27e7442 100644
--- a/src/controls/Private/qquicktooltip.cpp
+++ b/src/controls/Private/qquicktooltip.cpp
@@ -66,9 +66,10 @@ void QQuickTooltip::showText(QQuickItem *item, const QPointF &pos, const QString
if (QGuiApplicationPrivate::platformIntegration()->
hasCapability(QPlatformIntegration::MultipleWindows) &&
QCoreApplication::instance()->inherits("QApplication")) {
- QWindow *renderWindow = QQuickRenderControl::renderWindowFor(item->window());
+ QPoint offset;
+ QWindow *renderWindow = QQuickRenderControl::renderWindowFor(item->window(), &offset);
QWindow *window = renderWindow ? renderWindow : item->window();
- QPoint mappedPos = window->mapToGlobal(item->mapToScene(pos).toPoint());
+ QPoint mappedPos = window->mapToGlobal(item->mapToScene(pos).toPoint() + offset);
QToolTip::showText(mappedPos, str);
}
#else