Details
-
Suggestion
-
Resolution: Duplicate
-
P4: Low
-
None
-
4.7.3
-
None
Description
The property statement should be amended to take vector3d as a type, so that you can write
property vector3d vec1
property vector3d vec2: "1,0,0" // literal
property vector3d vec3: Qt.vector3d(scale,0,0) // computed
instead of just stuff like
property variant vec1
property variant vec2: "1,0,0" // literal
property variant vec3: Qt.vector3d(scale,0,0) // computed
which is what you have to do today.
The fact that you need to code variant just seems odd, especially given that http://doc.qt.nokia.com/latest/qdeclarativebasictypes.html lists vector3d as a basic type. As things stand, every QML3D programmer is going to find out the hard way what you have to do.
It would be nice incidentally to have a concise, accurate and full description of the property statement. I have never been able to find one, in 15 months or so of QML programming.
It's possible that if you do this for vector3d, it would make sense to do it for point, size, rect and perhaps other types also. The fact is that in 3D programming you end up creating a lot of vector3d properties, whereas I've hardly ever been tempted to create a point/size/rect property previously and so haven't noticed the omission from the property statement. I suspect that experience is not unusual.