aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvaluetypewrapper_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-11-10 11:39:03 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-22 21:48:11 +0100
commitfa3cf15e0577fe382ac577456422ad78325a3977 (patch)
tree3323ab526433f73fb644b1692c10629f01093d62 /src/qml/qml/qqmlvaluetypewrapper_p.h
parentee771dda2e9e304edea88e6d5f6e6d540a0bab97 (diff)
Initial work on gadget support
Changed built-in QtQml value types to use gadgets. This is in preparation for supporting external gadgets. This replaces the mostly direct inheritance of the concrete value types with gadgets and "dynamic" inheritance through QQmlValueType being generic. Over time as some of the value types may become gadgets, we can remove the ones here. It's important that these "separate" gadgets have the same memory layout as the actual types (QPointF, etc.). Also while QQmlValueType remains practically a singleton, it's not required anymore to be one. Consequently the JS wrappers for value types keep their own instance of QQmlValueType. This allows eliminating the qobject_cast in various places that dealt with the singleton nature. This comes at a cost, making the JS wrappers slightly heavier. However that is meant to be a temporary situation and finally the value type wrapper should merely store the meta-object in addition to the data and the type. Change-Id: I15071ded0a1e54203f29ec1ecf7a9ab646d1168e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlvaluetypewrapper_p.h')
-rw-r--r--src/qml/qml/qqmlvaluetypewrapper_p.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlvaluetypewrapper_p.h b/src/qml/qml/qqmlvaluetypewrapper_p.h
index d15a4b0cef..4946c13e42 100644
--- a/src/qml/qml/qqmlvaluetypewrapper_p.h
+++ b/src/qml/qml/qqmlvaluetypewrapper_p.h
@@ -65,7 +65,7 @@ struct QmlValueTypeWrapper : Object {
QmlValueTypeWrapper(QV8Engine *engine, ObjectType type);
QV8Engine *v8;
ObjectType objectType;
- mutable QQmlValueType *type;
+ mutable QScopedPointer<QQmlValueType> type;
};
}
@@ -77,8 +77,8 @@ struct Q_QML_EXPORT QmlValueTypeWrapper : Object
public:
- static ReturnedValue create(QV8Engine *v8, QObject *, int, QQmlValueType *);
- static ReturnedValue create(QV8Engine *v8, const QVariant &, QQmlValueType *);
+ static ReturnedValue create(QV8Engine *v8, QObject *, int, const QMetaObject *metaObject, int typeId);
+ static ReturnedValue create(QV8Engine *v8, const QVariant &, const QMetaObject *metaObject, int typeId);
QVariant toVariant() const;
bool isEqual(const QVariant& value);