diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-12-02 16:15:30 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-12-04 03:50:06 +0100 |
commit | e64c04b1409769118a9324f9c07a30a0bb81013a (patch) | |
tree | bf7cb4fdbcf9c005cfdfec00afc8e7c10822c070 /src/qml/qml/qqmltypewrapper.cpp | |
parent | 6e757fc08d91b42cbb4b56dfdcb8252631fdeed8 (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/qml/qqmltypewrapper.cpp')
-rw-r--r-- | src/qml/qml/qqmltypewrapper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp index 8114576238..328ecd6f95 100644 --- a/src/qml/qml/qqmltypewrapper.cpp +++ b/src/qml/qml/qqmltypewrapper.cpp @@ -408,7 +408,7 @@ ReturnedValue QQmlTypeWrapper::virtualInstanceOf(const Object *typeObject, const // we're a composite type; a composite type cannot be equal to a // non-composite object instance (Rectangle{} is never an instance of // CustomRectangle) - QQmlData *theirDData = QQmlData::get(wrapperObject, /*create=*/false); + QQmlData *theirDData = QQmlData::get(wrapperObject); Q_ASSERT(theirDData); // must exist, otherwise how do we have a QObjectWrapper for it?! if (!theirDData->compilationUnit) return Encode(false); |