diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-01-13 11:50:07 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-01-13 14:32:11 +0100 |
commit | b64f8dacae36fca948933cf56498d5e4ad3e2a07 (patch) | |
tree | 3c41c0270d6b4ab13b104581b0f1024e0e3cddab /src/qml/util/qqmlpropertymap.h | |
parent | 315261a809778a8ac37c523741e021d6431ab85e (diff) |
QQmlPropertyMap: Add a method to insert multiple values at once
This avoid re-building the metaobject for every property added. As
rebuilding the metaobject is an effort linear in the number of
properties, the runtime when adding multiple properties via singular
insert() is quadratic in the number of properties. The plural insert()
rebuilds the metaobject only once.
Task-number: QTBUG-57792
Change-Id: I9513c4de047724e4141dab72aacfbdd840a3e465
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/util/qqmlpropertymap.h')
-rw-r--r-- | src/qml/util/qqmlpropertymap.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/util/qqmlpropertymap.h b/src/qml/util/qqmlpropertymap.h index d948989833..556754c021 100644 --- a/src/qml/util/qqmlpropertymap.h +++ b/src/qml/util/qqmlpropertymap.h @@ -60,6 +60,7 @@ public: QVariant value(const QString &key) const; void insert(const QString &key, const QVariant &value); + void insert(const QVariantHash &values); void clear(const QString &key); Q_INVOKABLE QStringList keys() const; |