From 840e2817de1eda68f656f9764f824898ebf6d9c2 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 25 Nov 2013 11:31:51 +0100 Subject: Account for when the QGraphicsView is a top level widget 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 Reviewed-by: Jocelyn Turcotte --- Source/WebKit/qt/WidgetSupport/PageClientQt.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3