diff options
author | Katja Marttila <katja.marttila@qt.io> | 2023-05-25 11:17:02 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2023-06-12 11:56:35 +0300 |
commit | c6a06cd0a9aef990b57772f4caaf1aa8832ccee0 (patch) | |
tree | ea364178fc5e53a727284d6493163057e91419c7 /src/libs/installer/packagemanagercore.h | |
parent | 70081ce03cac6c331ed471a7f0ab6b38b843e31e (diff) |
Omit thisObject creation in javascript code
Originally, new Component object was created for javascript so that the garbage collector would not destroy the object. This caused the
thisObject in javascript to differ from the object in packageManagerCore, which in Qt6.5 lead to warning messages when each script was evaluated:
"Warning: :1: Calling C++ methods with 'this' objects different
from the one they were retrieved from is broken, due to historical
reasons. The original object is used as 'this' object."
Fixes so that the new object creation is omitted
and QJSEngine::CppOwnership is set to Component object so that garbage
collector won't destroy it.
Task-number: QTIFW-1829
Change-Id: Ia131d88fc83122f11c5b19a431e7db45e0ba18f9
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src/libs/installer/packagemanagercore.h')
-rw-r--r-- | src/libs/installer/packagemanagercore.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs/installer/packagemanagercore.h b/src/libs/installer/packagemanagercore.h index 0c167f92c..f85e5fcae 100644 --- a/src/libs/installer/packagemanagercore.h +++ b/src/libs/installer/packagemanagercore.h @@ -241,7 +241,8 @@ public: void appendUpdaterComponent(Component *components); QList<Component *> components(ComponentTypes mask, const QString ®exp = QString()) const; - Component *componentByName(const QString &identifier) const; + Q_INVOKABLE QInstaller::Component *componentByName(const QString &identifier) const; + Q_INVOKABLE QList<QInstaller::Component *> components(const QString ®exp = QString()) const; Q_INVOKABLE bool calculateComponentsToInstall() const; QList<Component*> orderedComponentsToInstall() const; |