Vector3d type as property in QML (2D)
-
Yes it works fine. You can use it in the axis property of a Rotation element and even animate that:
@
import QtQuick 1.0Item {
width : 400
height : 400
Rectangle {
x : 100
y : 100
width : 100
height : 100
color : "lightsteelblue"
transform : Rotation {
angle : 45
// axis : Qt.vector3d(1, 0, 0)
SequentialAnimation on axis {
Vector3dAnimation {
from : Qt.vector3d(0.3, 0.3, 0.3)
to : Qt.vector3d(0, 0.6, 0.6)
duration : 1000
}
Vector3dAnimation {
from : Qt.vector3d(0, 0.6, 0.6)
to : Qt.vector3d(0.3, 0.3, 0.3)
duration : 1000
}
loops : Animation.Infinite
}
}
}
}
@ -
The types that can be used like:
@property <type> <name>@
in QML are currently hard-coded. You can see the list of supported types at http://doc.qt.nokia.com/4.7/qml-extending-types.html#supported-property-types.