summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorKirill Burtsev <kirill.burtsev@qt.io>2021-09-16 22:08:22 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-10 16:54:50 +0000
commit9d350003fe1c3b5b0b1f839a66ddfb4650abc1ec (patch)
treef709c59f27de5b06731df9c427ced6bdc320af63 /src/core
parentcfb1051fb3055f1786bec84cc21d0b5d7076d05a (diff)
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. Fixes: QTBUG-96597 Change-Id: I61e76652a5d0fd5609070fd541816503908f2dc8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit f5fbc34fc16fc9c6e7f7e8bbbf60f5b343b9466d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/api/qwebenginescriptcollection.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/api/qwebenginescriptcollection.h b/src/core/api/qwebenginescriptcollection.h
index 7bc9005cb..35a35e266 100644
--- a/src/core/api/qwebenginescriptcollection.h
+++ b/src/core/api/qwebenginescriptcollection.h
@@ -70,6 +70,7 @@ private:
friend class QWebEngineProfilePrivate;
friend class QQuickWebEngineProfilePrivate;
friend class QQuickWebEngineViewPrivate;
+ friend class QQuickWebEngineScriptCollectionPrivate;
QWebEngineScriptCollection(QWebEngineScriptCollectionPrivate *);
QScopedPointer<QWebEngineScriptCollectionPrivate> d;