summaryrefslogtreecommitdiff
path: root/src/webenginequick/api/qquickwebengineprofile.h
diff options
context:
space:
mode:
authorKirill Burtsev <kirill.burtsev@qt.io>2021-09-16 22:08:22 +0200
committerMichal Klocek <michal.klocek@qt.io>2022-02-10 12:37:02 +0100
commitf5fbc34fc16fc9c6e7f7e8bbbf60f5b343b9466d (patch)
tree2a8456285c1d79f79ce48842aa16a3760382baf5 /src/webenginequick/api/qquickwebengineprofile.h
parentf28c0e6680f3ef8ebb5e82d0fe375afbc6fb0fe9 (diff)
downloadqtwebengine-f5fbc34fc16fc9c6e7f7e8bbbf60f5b343b9466d.tar.gz
Fix crash on WebEngine(View|Profile).userScripts.collection get
To create a javascript list on 'collection' method qml engine is needed for a qml scope, but it's only available for objects, which are created by the QML Engine itself. The only object in hierarchy of classes is an actual WebEngineView, so get it from there on collection init. Also implement delayed initialization of scripts collection for the usage of default profile through WebEngine singleton, and for the reason that it's not really needed until really asked by user code. Pick-to: 6.2 6.3 Fixes: QTBUG-96597 Change-Id: I61e76652a5d0fd5609070fd541816503908f2dc8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webenginequick/api/qquickwebengineprofile.h')
-rw-r--r--src/webenginequick/api/qquickwebengineprofile.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/webenginequick/api/qquickwebengineprofile.h b/src/webenginequick/api/qquickwebengineprofile.h
index e594b5982..029238a0a 100644
--- a/src/webenginequick/api/qquickwebengineprofile.h
+++ b/src/webenginequick/api/qquickwebengineprofile.h
@@ -170,6 +170,7 @@ private:
Q_DECLARE_PRIVATE(QQuickWebEngineProfile)
QQuickWebEngineProfile(QQuickWebEngineProfilePrivate *, QObject *parent = nullptr);
QQuickWebEngineSettings *settings() const;
+ void ensureQmlContext(const QObject *object);
friend class FaviconImageResponseRunnable;
friend class QQuickWebEngineSingleton;