diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-09-12 18:29:45 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-09-12 18:29:45 +0300 |
commit | da0aac1057552048f59075beb31861a6cc076684 (patch) | |
tree | 020cd8784f01248ea051bbf70254b8bcb3100a23 /src/qml/qml/qqmlengine.cpp | |
parent | f274d775774b78f6217c9770ae87045d969acbe1 (diff) | |
parent | 4757cac470edbeaeaceca4e63075d9f1139f546b (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.7' into tqtc/lts-5.15-opensourcev5.15.7-lts-lgpl
Change-Id: I658cff3c394ed233005efe6b12c515d2a886ef6b
Diffstat (limited to 'src/qml/qml/qqmlengine.cpp')
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 54cc07af2e..dcc2f8f7f5 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -1063,6 +1063,16 @@ QQmlEngine::~QQmlEngine() Once the component cache has been cleared, components must be loaded before any new objects can be created. + \note Any existing objects created from QML components retain their types, + even if you clear the component cache. This includes singleton objects. If you + create more objects from the same QML code after clearing the cache, the new + objects will be of different types than the old ones. Assigning such a new + object to a property of its declared type belonging to an object created + before clearing the cache won't work. + + As a general rule of thumb, make sure that no objects created from QML + components are alive when you clear the component cache. + \sa trimComponentCache() */ void QQmlEngine::clearComponentCache() |