aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvaluetype_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-10 12:34:46 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-16 13:40:17 +0000
commitb220a20552838fbafbbf126b9e50d148ae76518d (patch)
tree172e81559ed85ac0cdfedd4af9a9029bbdb15ecd /src/qml/qml/qqmlvaluetype_p.h
parent3fa8540800c43ccc4e4c1f8f323fb5ade34044db (diff)
Speed up value type binding creation
* Avoid calling QMetaType::construct/destruct(typeId, ...) as that requires repeated lookups in the type registry. Instead cache the constructor/destructor/etc. function addresses in the QQmlValueType singletons as QMetaType * Allocate memory for the gadget pointer lazily, to accommodate the common case of a value type binding by property reference. Change-Id: I98a3ac73453b8f80027c06401b4f29a9707949d2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlvaluetype_p.h')
-rw-r--r--src/qml/qml/qqmlvaluetype_p.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlvaluetype_p.h b/src/qml/qml/qqmlvaluetype_p.h
index f534fedf5d..be453ae35a 100644
--- a/src/qml/qml/qqmlvaluetype_p.h
+++ b/src/qml/qml/qqmlvaluetype_p.h
@@ -75,8 +75,11 @@ public:
private:
const QMetaObject *_metaObject;
- int typeId;
void *gadgetPtr;
+
+public:
+ int typeId;
+ QMetaType metaType;
};
class Q_QML_PRIVATE_EXPORT QQmlValueTypeFactory