aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsapi/qjsengine.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-12-02 16:15:30 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2021-12-04 03:50:06 +0100
commite64c04b1409769118a9324f9c07a30a0bb81013a (patch)
treebf7cb4fdbcf9c005cfdfec00afc8e7c10822c070 /src/qml/jsapi/qjsengine.cpp
parent6e757fc08d91b42cbb4b56dfdcb8252631fdeed8 (diff)
Ensure QQmlData::get const-correctness
If we pass in a const pointer, we're not allowed to modify the object, so the create==true case does not make sense there. We therefore provide now two versions of the function: One taking only a const pointer, and one taking a non-const pointer and a bool. The latter no longer provides a default parameter to encourage usage of the the const version wherever possible. Change-Id: Ifb5a7e0605127de429403982b31f754e154b8048 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsapi/qjsengine.cpp')
-rw-r--r--src/qml/jsapi/qjsengine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp
index 1e102699f1..7b436645e9 100644
--- a/src/qml/jsapi/qjsengine.cpp
+++ b/src/qml/jsapi/qjsengine.cpp
@@ -1158,7 +1158,7 @@ void QJSEnginePrivate::removeFromDebugServer(QJSEngine *q)
*/
QJSEngine *qjsEngine(const QObject *object)
{
- QQmlData *data = QQmlData::get(object, false);
+ QQmlData *data = QQmlData::get(object);
if (!data || data->jsWrapper.isNullOrUndefined())
return nullptr;
return data->jsWrapper.engine()->jsEngine();