diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-07-14 12:51:02 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-07-14 14:38:13 +0200 |
commit | c75c32cc9dff47b1230366e1044bdf6b5ba6495c (patch) | |
tree | 6a5f3b9f74041d5d83a9c810c4fe5d69cc271643 /src/webengine | |
parent | 31f41cf9b98b1ff3dde61e667693b2106b906e2c (diff) |
Fix RenderWidgetHostViewQt::GetViewBounds
GetViewBounds should return the bounds of the view, not the screen rect.
The view bounds are for example used to calculate the screen position of
accessible objects (which gets fixed with this patch).
Change-Id: I5b342113af737847c1756a13183cd2b8b8db648a
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Diffstat (limited to 'src/webengine')
4 files changed, 14 insertions, 0 deletions
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp index 8d7f298e7..e37a07960 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp @@ -90,6 +90,13 @@ QRectF RenderWidgetHostViewQtDelegateQuick::screenRect() const return QRectF(pos.x(), pos.y(), width(), height()); } +QRectF RenderWidgetHostViewQtDelegateQuick::contentsRect() const +{ + QPointF scenePoint = mapToScene(QPointF(0, 0)); + QPointF screenPos = window()->mapToGlobal(scenePoint.toPoint()); + return QRectF(screenPos, QPointF(width(), height())); +} + void RenderWidgetHostViewQtDelegateQuick::setKeyboardFocus() { setFocus(true); diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.h b/src/webengine/render_widget_host_view_qt_delegate_quick.h index 2efb2d098..1d79a101c 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.h +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.h @@ -55,6 +55,7 @@ public: virtual void initAsChild(WebContentsAdapterClient* container) Q_DECL_OVERRIDE; virtual void initAsPopup(const QRect&) Q_DECL_OVERRIDE; virtual QRectF screenRect() const Q_DECL_OVERRIDE; + virtual QRectF contentsRect() const Q_DECL_OVERRIDE; virtual void setKeyboardFocus() Q_DECL_OVERRIDE; virtual bool hasKeyboardFocus() Q_DECL_OVERRIDE; virtual void show() Q_DECL_OVERRIDE; diff --git a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp index b2e461450..2a7e98408 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp +++ b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp @@ -75,6 +75,11 @@ QRectF RenderWidgetHostViewQtDelegateQuickWindow::screenRect() const return QRectF(x(), y(), width(), height()); } +QRectF RenderWidgetHostViewQtDelegateQuickWindow::contentsRect() const +{ + return geometry(); +} + void RenderWidgetHostViewQtDelegateQuickWindow::show() { QQuickWindow::show(); diff --git a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h index 667bb4b3a..53203bb47 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h +++ b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h @@ -58,6 +58,7 @@ public: virtual void initAsChild(WebContentsAdapterClient* container) Q_DECL_OVERRIDE; virtual void initAsPopup(const QRect&) Q_DECL_OVERRIDE; virtual QRectF screenRect() const Q_DECL_OVERRIDE; + virtual QRectF contentsRect() const Q_DECL_OVERRIDE; virtual void setKeyboardFocus() Q_DECL_OVERRIDE {} virtual bool hasKeyboardFocus() Q_DECL_OVERRIDE { return false; } virtual void show() Q_DECL_OVERRIDE; |