Fix broken value-type support by allowing property definition
authorChris Adams <christopher.adams@nokia.com>
Tue, 26 Jun 2012 08:02:35 +0000 (18:02 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 10 Jul 2012 23:46:52 +0000 (01:46 +0200)
commitf5cb65b35e076facbce45e896902a34da7036135
tree7575065fde2d0c14c379a992bf8b3593e21f4881
parent5376906de58e1c25c77b7a61800365b6e542542f
Fix broken value-type support by allowing property definition

In QtQuick 1.x the "variant" property type was supported, which could
be used to allow value type properties to be defined in QML.  In
QtQuick 2.0, we have deprecated the "variant" property, but its
replacement ("var") is not suited for defining lightweight C++ type
values (such as QColor, QFont, QRectF, QVector3D etc).

This commit allows those QML basic types to be used in QML once more,
by supporting them in the property definition syntax.

Note that since some value types are provided by QtQuick and others
are provided by QtQml, if a client imports only QtQml they can define
but not use properties of certain types (eg, font).

Task-number: QTBUG-21034
Task-number: QTBUG-18217

Change-Id: Ia951a8522f223408d27293bb96c276281a710277
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
34 files changed:
src/qml/doc/src/syntax/objectattributes.qdoc
src/qml/doc/src/typesystem/basictypes.qdoc
src/qml/qml/qqmlcompiler.cpp
src/qml/qml/qqmlengine.cpp
src/qml/qml/qqmlglobal.cpp
src/qml/qml/qqmlglobal_p.h
src/qml/qml/qqmlscript.cpp
src/qml/qml/qqmlscript_p.h
src/qml/qml/qqmlvaluetype.cpp
src/qml/qml/qqmlvaluetype_p.h
src/qml/qml/qqmlvmemetaobject.cpp
src/qml/qml/v8/qqmlbuiltinfunctions.cpp
src/qml/qml/v8/qqmlbuiltinfunctions_p.h
src/qml/qml/v8/qv8engine.cpp
src/qml/qml/v8/qv8valuetypewrapper.cpp
src/qml/qml/v8/qv8valuetypewrapper_p.h
src/quick/util/qquickglobal.cpp
src/quick/util/qquickvaluetypes.cpp
tests/auto/qml/qml.pro
tests/auto/qml/qqmlglobal/tst_qqmlglobal.cpp
tests/auto/qml/qqmlqt/data/font.qml [new file with mode: 0644]
tests/auto/qml/qqmlqt/data/matrix4x4.qml [new file with mode: 0644]
tests/auto/qml/qqmlqt/data/quaternion.qml [new file with mode: 0644]
tests/auto/qml/qqmlqt/data/vector2.qml [new file with mode: 0644]
tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
tests/auto/qml/qqmlvaluetypeproviders/data/comparisonSemantics.qml [new file with mode: 0644]
tests/auto/qml/qqmlvaluetypeproviders/data/cppIntegration.qml [new file with mode: 0644]
tests/auto/qml/qqmlvaluetypeproviders/data/jsObjectConversion.qml [new file with mode: 0644]
tests/auto/qml/qqmlvaluetypeproviders/data/qtqmlValueTypes.qml [new file with mode: 0644]
tests/auto/qml/qqmlvaluetypeproviders/data/qtquickValueTypes.qml [new file with mode: 0644]
tests/auto/qml/qqmlvaluetypeproviders/qqmlvaluetypeproviders.pro [new file with mode: 0644]
tests/auto/qml/qqmlvaluetypeproviders/testtypes.cpp [new file with mode: 0644]
tests/auto/qml/qqmlvaluetypeproviders/testtypes.h [new file with mode: 0644]
tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp [new file with mode: 0644]