diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-07-31 17:24:26 +0200 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-08-01 15:33:00 +0200 |
commit | 04f58ffc1904bef7ba788b56ed098a7823017e65 (patch) | |
tree | 8fb75f472afecbb2fc11d71bf6a4496a73f5114e /src/webenginewidgets/api | |
parent | 945f9183ced012960c75e0b0339a328bbbc96ee6 (diff) |
Fix tab focus in the widgets and QML webviews
Fixes:
- Make sure that we call SetInitialFocus when giving focus through Tab
This does the same as would WebContents::FocusThroughTabTraversal
- Implement QWebEnginePagePrivate::passOnFocus
- Set each new RWHVQtDelegate as the focus proxy of the QWebEngineView
- Make sure that the widgets delegate accepts the tab focus policy
Cleaups:
- RenderWidgetHostViewQtDelegateQuick doesn't need to be a focus scope,
it doesn't have any children
- We don't need to reimplement QQuickWebEngineView::forceActiveFocus
since the view is now a focus scope
- Do not explicitly setFocus(true) on the QQuickWebEngineView,
the application should decide this through the API
Change-Id: I817dc2c895d4fff4aa3536c71ecc5d306bb3bee0
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'src/webenginewidgets/api')
-rw-r--r-- | src/webenginewidgets/api/qwebenginepage.cpp | 6 | ||||
-rw-r--r-- | src/webenginewidgets/api/qwebenginepage_p.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 212fd696e..430fa30a2 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -303,6 +303,12 @@ void QWebEnginePagePrivate::didFindText(quint64 requestId, int matchCount) m_callbacks.invoke(requestId, matchCount > 0); } +void QWebEnginePagePrivate::passOnFocus(bool reverse) +{ + if (view) + view->focusNextPrevChild(!reverse); +} + void QWebEnginePagePrivate::authenticationRequired(const QUrl &requestUrl, const QString &realm, bool isProxy, const QString &challengingHost, QString *outUser, QString *outPassword) { Q_Q(QWebEnginePage); diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index e46c64af8..3f421ed7e 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -135,7 +135,7 @@ public: virtual void didFetchDocumentMarkup(quint64 requestId, const QString& result) Q_DECL_OVERRIDE; virtual void didFetchDocumentInnerText(quint64 requestId, const QString& result) Q_DECL_OVERRIDE; virtual void didFindText(quint64 requestId, int matchCount) Q_DECL_OVERRIDE; - virtual void passOnFocus(bool reverse) Q_DECL_OVERRIDE { Q_UNUSED(reverse); } + virtual void passOnFocus(bool reverse) Q_DECL_OVERRIDE; virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) Q_DECL_OVERRIDE; virtual void authenticationRequired(const QUrl &requestUrl, const QString &realm, bool isProxy, const QString &challengingHost, QString *outUser, QString *outPassword) Q_DECL_OVERRIDE; virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) Q_DECL_OVERRIDE; |