From f32b3514a5186bc4f5452f004324bdb7782d30a3 Mon Sep 17 00:00:00 2001 From: Oleg Yadrov Date: Fri, 14 Apr 2017 10:38:50 -0400 Subject: Make FocusOnNavigationEnabled setting disabled by default Before this setting was added in Qt 5.8, the behavior was that QWebEngineView/WebEngineView got the focus automatically. With the new setting added it is configurable, but it was left enabled for compatibility reasons. It would had to be changed at some point anyway: none of other QML items or widgets grab the focus after creation, so why would QWebEngineView/WebEngineView do? This patch also fixes a bug with the text cursor in WebView (the cursor was blinking as if WebView had the focus when it did not). [ChangeLog][Important Changes][QtWebEngine][General] focusOnNavigationEnabled setting which allows controlling whether a web view will receive focus on a navigation request is now disabled by default. Task-number: QTBUG-60152 Task-number: QTBUG-60149 Change-Id: I78dc9bb9ffc70bf06217952acd456b97651c5185 Reviewed-by: Qt CI Bot Reviewed-by: Michal Klocek --- tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.cpp') diff --git a/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.cpp b/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.cpp index d5e8a21cf..4f14f29f9 100644 --- a/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.cpp +++ b/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.cpp @@ -32,6 +32,7 @@ #include #include #include +#include class WebView : public QWebEngineView { @@ -143,6 +144,8 @@ void tst_QWebEngineSpellcheck::spellcheck() QFETCH(QStringList, languages); QFETCH(QStringList, suggestions); + m_view->settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, true); + QWebEngineProfile *profile = QWebEngineProfile::defaultProfile(); QVERIFY(profile); profile->setSpellCheckLanguages(languages); -- cgit v1.2.3