From fa3cf15e0577fe382ac577456422ad78325a3977 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 10 Nov 2014 11:39:03 +0100 Subject: 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 --- .../auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'tests/auto/qml/qqmlvaluetypes') diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp index ce2723bbf9..e3703eac00 100644 --- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp +++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp @@ -79,7 +79,6 @@ private slots: void deletedObject(); void bindingVariantCopy(); void scriptVariantCopy(); - void cppClasses(); void enums(); void conflictingBindings(); void returnValues(); @@ -1166,26 +1165,6 @@ void tst_qqmlvaluetypes::scriptVariantCopy() delete object; } - -// Test that the value type classes can be used manually -void tst_qqmlvaluetypes::cppClasses() -{ - CPP_TEST(QQmlPointValueType, QPoint(19, 33)); - CPP_TEST(QQmlPointFValueType, QPointF(33.6, -23)); - CPP_TEST(QQmlSizeValueType, QSize(-100, 18)); - CPP_TEST(QQmlSizeFValueType, QSizeF(-100.7, 18.2)); - CPP_TEST(QQmlRectValueType, QRect(13, 39, 10928, 88)); - CPP_TEST(QQmlRectFValueType, QRectF(88.2, -90.1, 103.2, 118)); - CPP_TEST(QQuickVector2DValueType, QVector2D(19.7f, 1002)); - CPP_TEST(QQuickVector3DValueType, QVector3D(18.2f, 19.7f, 1002)); - CPP_TEST(QQuickVector4DValueType, QVector4D(18.2f, 19.7f, 1002, 54)); - CPP_TEST(QQuickQuaternionValueType, QQuaternion(18.2f, 19.7f, 1002, 54)); - CPP_TEST(QQuickMatrix4x4ValueType, - QMatrix4x4(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); - CPP_TEST(QQuickFontValueType, QFont("Helvetica")); - -} - void tst_qqmlvaluetypes::enums() { { -- cgit v1.2.3