summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@theqtcompany.com>2015-04-29 14:55:28 +0200
committerPierre Rossi <pierre.rossi@theqtcompany.com>2015-06-03 13:50:04 +0000
commit8d9623c005c073f102097adcc1555fe93555b359 (patch)
tree6f93a841d5f9ec6c199129b9b0038e327d097125
parent76635345d96413944b81f5cf3d0f3dffa0a7b743 (diff)
QQuickWebEngineView: add activeFocusOnPress property
This allows to use a WebEngineView to make a UI element that should not get focus, which can be useful inthe case of hybrid UIs. [ChangeLog][QtWebEngineQML][QQuickWebEngineView] Add activeFocusOnPress Change-Id: I0666f81badd135db0049e0dd7b0fc30d0765b1c9 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
-rw-r--r--src/webengine/api/qquickwebengineview.cpp26
-rw-r--r--src/webengine/api/qquickwebengineview_p.h8
-rw-r--r--src/webengine/api/qquickwebengineview_p_p.h1
-rw-r--r--src/webengine/plugin/experimental/plugin.cpp4
-rw-r--r--src/webengine/plugin/plugin.cpp3
-rw-r--r--src/webengine/plugin/plugin.pro2
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.cpp15
-rw-r--r--tests/auto/quick/qmltests/data/TestWebEngineView.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml82
-rw-r--r--tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_favIconLoad.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_filePicker.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_findText.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_linkHovered.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadFail.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadHtml.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadProgress.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadProgressSignal.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadUrl.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_navigationHistory.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_navigationRequested.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_properties.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_runJavaScript.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_titleChanged.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_userScripts.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_webchannel.qml2
30 files changed, 154 insertions, 31 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 11e4d018c..f5210a816 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -103,6 +103,7 @@ QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
, loadProgress(0)
, m_isFullScreen(false)
, isLoading(false)
+ , m_activeFocusOnPress(true)
, devicePixelRatio(QGuiApplication::primaryScreen()->devicePixelRatio())
, m_dpiScale(1.0)
{
@@ -758,8 +759,23 @@ void QQuickWebEngineView::setTestSupport(QQuickWebEngineTestSupport *testSupport
Q_D(QQuickWebEngineView);
d->m_testSupport = testSupport;
}
+
#endif
+/*!
+ * \qmlproperty bool WebEngineView::activeFocusOnPress
+ * \since QtWebEngine 1.2
+ *
+ * This property specifies whether the view should gain active focus when pressed.
+ * The default value is true.
+ *
+ */
+bool QQuickWebEngineView::activeFocusOnPress() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->m_activeFocusOnPress;
+}
+
void QQuickWebEngineViewPrivate::didRunJavaScript(quint64 requestId, const QVariant &result)
{
Q_Q(QQuickWebEngineView);
@@ -960,6 +976,16 @@ void QQuickWebEngineView::grantFeaturePermission(const QUrl &securityOrigin, QQu
}
}
+void QQuickWebEngineView::setActiveFocusOnPress(bool arg)
+{
+ Q_D(QQuickWebEngineView);
+ if (d->m_activeFocusOnPress == arg)
+ return;
+
+ d->m_activeFocusOnPress = arg;
+ emit activeFocusOnPressChanged(arg);
+}
+
void QQuickWebEngineView::goBackOrForward(int offset)
{
Q_D(QQuickWebEngineView);
diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
index 40299c1c5..462278571 100644
--- a/src/webengine/api/qquickwebengineview_p.h
+++ b/src/webengine/api/qquickwebengineview_p.h
@@ -73,6 +73,8 @@ private:
bool m_toggleOn;
};
+#define LATEST_WEBENGINEVIEW_REVISION 2
+
class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem {
Q_OBJECT
Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
@@ -89,6 +91,7 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem {
Q_PROPERTY(QQuickWebEngineHistory *navigationHistory READ navigationHistory CONSTANT FINAL REVISION 1)
Q_PROPERTY(QQmlWebChannel *webChannel READ webChannel WRITE setWebChannel NOTIFY webChannelChanged REVISION 1)
Q_PROPERTY(QQmlListProperty<QQuickWebEngineScript> userScripts READ userScripts FINAL)
+ Q_PROPERTY(bool activeFocusOnPress READ activeFocusOnPress WRITE setActiveFocusOnPress NOTIFY activeFocusOnPressChanged REVISION 2)
#ifdef ENABLE_QML_TESTSUPPORT_API
Q_PROPERTY(QQuickWebEngineTestSupport *testSupport READ testSupport WRITE setTestSupport FINAL)
@@ -200,6 +203,8 @@ public:
void setTestSupport(QQuickWebEngineTestSupport *testSupport);
#endif
+ bool activeFocusOnPress() const;
+
public Q_SLOTS:
void runJavaScript(const QString&, const QJSValue & = QJSValue());
void loadHtml(const QString &html, const QUrl &baseUrl = QUrl());
@@ -212,6 +217,7 @@ public Q_SLOTS:
Q_REVISION(1) void findText(const QString &subString, FindFlags options = 0, const QJSValue &callback = QJSValue());
Q_REVISION(1) void fullScreenCancelled();
Q_REVISION(1) void grantFeaturePermission(const QUrl &securityOrigin, Feature, bool granted);
+ Q_REVISION(2) void setActiveFocusOnPress(bool arg);
Q_SIGNALS:
void titleChanged();
@@ -230,7 +236,7 @@ Q_SIGNALS:
Q_REVISION(1) void zoomFactorChanged(qreal arg);
Q_REVISION(1) void profileChanged();
Q_REVISION(1) void webChannelChanged();
-
+ Q_REVISION(2) void activeFocusOnPressChanged(bool);
protected:
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
index a7c851e81..ad0e937a0 100644
--- a/src/webengine/api/qquickwebengineview_p_p.h
+++ b/src/webengine/api/qquickwebengineview_p_p.h
@@ -184,6 +184,7 @@ public:
int loadProgress;
bool m_isFullScreen;
bool isLoading;
+ bool m_activeFocusOnPress;
qreal devicePixelRatio;
QMap<quint64, QJSValue> m_callbacks;
QList<QSharedPointer<CertificateErrorController> > m_certificateErrorControllers;
diff --git a/src/webengine/plugin/experimental/plugin.cpp b/src/webengine/plugin/experimental/plugin.cpp
index 29b5413f4..21def1a66 100644
--- a/src/webengine/plugin/experimental/plugin.cpp
+++ b/src/webengine/plugin/experimental/plugin.cpp
@@ -61,14 +61,14 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebEngine.experimental"));
- qmlRegisterExtendedType<QQuickWebEngineView, QQuickWebEngineViewExperimentalExtension>(uri, 1, 0, "WebEngineView");
+ qmlRegisterExtendedType<QQuickWebEngineView, QQuickWebEngineViewExperimentalExtension>(uri, 1, 2, "WebEngineView");
qmlRegisterUncreatableType<QQuickWebEngineViewExperimental>(uri, 1, 0, "WebEngineViewExperimental",
QObject::tr("Cannot create a separate instance of WebEngineViewExperimental"));
qmlRegisterUncreatableType<QQuickWebEngineViewport>(uri, 1, 0, "WebEngineViewport",
QObject::tr("Cannot create a separate instance of WebEngineViewport"));
// Use the latest revision of QQuickWebEngineView when importing QtWebEngine.experimental 1.0
- qmlRegisterRevision<QQuickWebEngineView, 1>(uri, 1, 0);
+ qmlRegisterRevision<QQuickWebEngineView, LATEST_WEBENGINEVIEW_REVISION>(uri, 1, LATEST_WEBENGINEVIEW_REVISION);
}
};
diff --git a/src/webengine/plugin/plugin.cpp b/src/webengine/plugin/plugin.cpp
index c5ef11a5e..cc95fb01f 100644
--- a/src/webengine/plugin/plugin.cpp
+++ b/src/webengine/plugin/plugin.cpp
@@ -83,6 +83,9 @@ public:
QObject::tr("Cannot create a separate instance of NavigationHistory"));
qmlRegisterUncreatableType<QQuickWebEngineFullScreenRequest>(uri, 1, 1, "FullScreenRequest",
QObject::tr("Cannot create a separate instance of FullScreenRequest"));
+
+ // For now (1.x import), the latest revision matches the minor version of the import.
+ qmlRegisterRevision<QQuickWebEngineView, LATEST_WEBENGINEVIEW_REVISION>(uri, 1, LATEST_WEBENGINEVIEW_REVISION);
}
};
diff --git a/src/webengine/plugin/plugin.pro b/src/webengine/plugin/plugin.pro
index 5682e90ed..e033b2db5 100644
--- a/src/webengine/plugin/plugin.pro
+++ b/src/webengine/plugin/plugin.pro
@@ -1,7 +1,7 @@
CXX_MODULE = qml
TARGET = qtwebengineplugin
TARGETPATH = QtWebEngine
-IMPORT_VERSION = 1.0
+IMPORT_VERSION = 1.2
QT += webengine qml quick
QT_PRIVATE += webengine-private
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 ebf1acf27..9fc1ed3eb 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
+++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
@@ -64,10 +64,14 @@ RenderWidgetHostViewQtDelegateQuick::RenderWidgetHostViewQtDelegateQuick(RenderW
void RenderWidgetHostViewQtDelegateQuick::initAsChild(WebContentsAdapterClient* container)
{
- QQuickWebEngineViewPrivate *viewPrivate = static_cast<QQuickWebEngineViewPrivate *>(container);
- setParentItem(viewPrivate->q_func());
- setSize(viewPrivate->q_func()->boundingRect().size());
+ QQuickWebEngineView *view = static_cast<QQuickWebEngineViewPrivate *>(container)->q_func();
+ setParentItem(view);
+ setSize(view->boundingRect().size());
+ // Focus on creation if the view accepts it
+ if (view->activeFocusOnPress())
+ setFocus(true);
m_initialized = true;
+
}
void RenderWidgetHostViewQtDelegateQuick::initAsPopup(const QRect &r)
@@ -195,7 +199,7 @@ void RenderWidgetHostViewQtDelegateQuick::focusOutEvent(QFocusEvent *event)
void RenderWidgetHostViewQtDelegateQuick::mousePressEvent(QMouseEvent *event)
{
- if (!m_isPopup)
+ if (!m_isPopup && (parentItem() && parentItem()->property("activeFocusOnPress").toBool()))
forceActiveFocus();
m_client->forwardEvent(event);
}
@@ -227,7 +231,8 @@ void RenderWidgetHostViewQtDelegateQuick::wheelEvent(QWheelEvent *event)
void RenderWidgetHostViewQtDelegateQuick::touchEvent(QTouchEvent *event)
{
- if (event->type() == QEvent::TouchBegin && !m_isPopup)
+ if (event->type() == QEvent::TouchBegin && !m_isPopup
+ && (parentItem() && parentItem()->property("activeFocusOnPress").toBool()))
forceActiveFocus();
m_client->forwardEvent(event);
}
diff --git a/tests/auto/quick/qmltests/data/TestWebEngineView.qml b/tests/auto/quick/qmltests/data/TestWebEngineView.qml
index a97739404..8a01dfa09 100644
--- a/tests/auto/quick/qmltests/data/TestWebEngineView.qml
+++ b/tests/auto/quick/qmltests/data/TestWebEngineView.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
import QtWebEngine.experimental 1.0
WebEngineView {
diff --git a/tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml b/tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml
new file mode 100644
index 000000000..eaca8822b
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.5
+import QtTest 1.0
+
+Item {
+ id: root
+ width: 300
+ height: 400
+ TextInput {
+ id: textInput
+ anchors {
+ top: parent.top
+ left: parent.left
+ right: parent.right
+ }
+ focus: true
+ text: "foo"
+ }
+
+ TestWebEngineView {
+ id: webEngineView
+ activeFocusOnPress: false
+ anchors {
+ top: textInput.bottom
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+
+ TestCase {
+ name: "ActiveFocusOnPress"
+ when:windowShown
+
+ function test_activeFocusOnPress() {
+ textInput.forceActiveFocus()
+ verify(textInput.activeFocus)
+ mouseClick(root, 150, 300, Qt.LeftButton)
+ verify(textInput.activeFocus)
+ }
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml b/tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml
index dfb983c43..51c1d5580 100644
--- a/tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml
+++ b/tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_favIconLoad.qml b/tests/auto/quick/qmltests/data/tst_favIconLoad.qml
index 73190f1bd..df5479eec 100644
--- a/tests/auto/quick/qmltests/data/tst_favIconLoad.qml
+++ b/tests/auto/quick/qmltests/data/tst_favIconLoad.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml
index 0ea13810c..02b2dd024 100644
--- a/tests/auto/quick/qmltests/data/tst_filePicker.qml
+++ b/tests/auto/quick/qmltests/data/tst_filePicker.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
import "../mock-delegates/TestParams" 1.0
TestWebEngineView {
diff --git a/tests/auto/quick/qmltests/data/tst_findText.qml b/tests/auto/quick/qmltests/data/tst_findText.qml
index b51da0b2e..9c4aa48c1 100644
--- a/tests/auto/quick/qmltests/data/tst_findText.qml
+++ b/tests/auto/quick/qmltests/data/tst_findText.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml b/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml
index 58a49da5a..75b45bfac 100644
--- a/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml
+++ b/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.0
+import QtWebEngine 1.2
import "../mock-delegates/TestParams" 1.0
TestWebEngineView {
diff --git a/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml b/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml
index 230ee9635..c127d7391 100644
--- a/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml
+++ b/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_linkHovered.qml b/tests/auto/quick/qmltests/data/tst_linkHovered.qml
index c9fbd5520..31d90615b 100644
--- a/tests/auto/quick/qmltests/data/tst_linkHovered.qml
+++ b/tests/auto/quick/qmltests/data/tst_linkHovered.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_loadFail.qml b/tests/auto/quick/qmltests/data/tst_loadFail.qml
index 0885fc193..c2a4b6e13 100644
--- a/tests/auto/quick/qmltests/data/tst_loadFail.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadFail.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
import QtWebEngine.experimental 1.0
import QtWebEngine.testsupport 1.0
diff --git a/tests/auto/quick/qmltests/data/tst_loadHtml.qml b/tests/auto/quick/qmltests/data/tst_loadHtml.qml
index b8acd0dd7..ee1149b16 100644
--- a/tests/auto/quick/qmltests/data/tst_loadHtml.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadHtml.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_loadProgress.qml b/tests/auto/quick/qmltests/data/tst_loadProgress.qml
index 9f8b6f6f7..2a051d931 100644
--- a/tests/auto/quick/qmltests/data/tst_loadProgress.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadProgress.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_loadProgressSignal.qml b/tests/auto/quick/qmltests/data/tst_loadProgressSignal.qml
index 8e2e99b64..7b0bac61b 100644
--- a/tests/auto/quick/qmltests/data/tst_loadProgressSignal.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadProgressSignal.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml b/tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml
index 2400a5ed6..fb692c472 100644
--- a/tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml
@@ -41,7 +41,7 @@
import QtQuick 2.3
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
Item {
width: 300
diff --git a/tests/auto/quick/qmltests/data/tst_loadUrl.qml b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
index 922925b48..c8abf2bb0 100644
--- a/tests/auto/quick/qmltests/data/tst_loadUrl.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
import QtWebEngine.experimental 1.0
TestWebEngineView {
diff --git a/tests/auto/quick/qmltests/data/tst_navigationHistory.qml b/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
index 3acde3abc..f7875bb78 100644
--- a/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
+++ b/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_navigationRequested.qml b/tests/auto/quick/qmltests/data/tst_navigationRequested.qml
index 72eb0aac9..7d49cda90 100644
--- a/tests/auto/quick/qmltests/data/tst_navigationRequested.qml
+++ b/tests/auto/quick/qmltests/data/tst_navigationRequested.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_properties.qml b/tests/auto/quick/qmltests/data/tst_properties.qml
index 738ef532d..9418252cb 100644
--- a/tests/auto/quick/qmltests/data/tst_properties.qml
+++ b/tests/auto/quick/qmltests/data/tst_properties.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_runJavaScript.qml b/tests/auto/quick/qmltests/data/tst_runJavaScript.qml
index 6cf3a71fb..07e7130c6 100644
--- a/tests/auto/quick/qmltests/data/tst_runJavaScript.qml
+++ b/tests/auto/quick/qmltests/data/tst_runJavaScript.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_titleChanged.qml b/tests/auto/quick/qmltests/data/tst_titleChanged.qml
index adc8564c0..8d9dae0a4 100644
--- a/tests/auto/quick/qmltests/data/tst_titleChanged.qml
+++ b/tests/auto/quick/qmltests/data/tst_titleChanged.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml b/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml
index 1c32c73a9..5fefd0fe5 100644
--- a/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml
+++ b/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
Item {
id: parentItem
diff --git a/tests/auto/quick/qmltests/data/tst_userScripts.qml b/tests/auto/quick/qmltests/data/tst_userScripts.qml
index a9ed933d9..8a3b8207f 100644
--- a/tests/auto/quick/qmltests/data/tst_userScripts.qml
+++ b/tests/auto/quick/qmltests/data/tst_userScripts.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
Item {
WebEngineScript {
diff --git a/tests/auto/quick/qmltests/data/tst_webchannel.qml b/tests/auto/quick/qmltests/data/tst_webchannel.qml
index dce585b67..51e37d50e 100644
--- a/tests/auto/quick/qmltests/data/tst_webchannel.qml
+++ b/tests/auto/quick/qmltests/data/tst_webchannel.qml
@@ -40,7 +40,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.1
+import QtWebEngine 1.2
import QtWebEngine.experimental 1.0
import QtWebChannel 1.0