summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2013-11-25 11:31:51 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-25 20:40:11 +0100
commit840e2817de1eda68f656f9764f824898ebf6d9c2 (patch)
tree553bf348e700c56d19f7b84c03f6bd3a587be7d2
parenta7084bff6a81db6488e6f517988b196ac0a951e3 (diff)
Account for when the QGraphicsView is a top level widgetv5.2.0-rc1
When the QGraphicsView was a top level widget then it would not account for the transformations as it did not translate the point from the scene to the view. [ChangeLog][QtWebKitWidgets][QGraphicsWebView] Make sure that mouse events for QGraphicsWebView items in a top level QGraphicsView. Task-number: QTBUG-32179 Change-Id: I2c26580a7e7e5eaec08d71768298e961d3e9d13b Reviewed-by: Michael Bruning <michael.bruning@digia.com> Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
-rw-r--r--Source/WebKit/qt/WidgetSupport/PageClientQt.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/WebKit/qt/WidgetSupport/PageClientQt.cpp b/Source/WebKit/qt/WidgetSupport/PageClientQt.cpp
index de21c9fd7..792613676 100644
--- a/Source/WebKit/qt/WidgetSupport/PageClientQt.cpp
+++ b/Source/WebKit/qt/WidgetSupport/PageClientQt.cpp
@@ -254,9 +254,12 @@ QRect PageClientQGraphicsWidget::geometryRelativeToOwnerWidget() const
QPoint PageClientQGraphicsWidget::mapToOwnerWindow(const QPoint& point) const
{
- if (const QGraphicsView* graphicsView = firstGraphicsView())
+ if (const QGraphicsView* graphicsView = firstGraphicsView()) {
if (const QWidget *nativeParent = graphicsView->nativeParentWidget())
return graphicsView->mapTo(nativeParent, graphicsView->mapFromScene(view->mapToScene(point)));
+ else
+ return graphicsView->mapFromScene(view->mapToScene(point));
+ }
return point;
}