CubeThe Cube item represents a simple cube in 3D space. More... Inherits Item3D Cube instantiates the C++ class Cube This type was introduced in Qt 4.8. Detailed DescriptionThe Cube element in QML provides a simple way to create a cube object, usually for testing material effects. For example, the following QML code displays a cube of size 1.5, centered on the origin and covered in the Qt logo texture: Cube { scale: 1.5 effect: Effect { color: "#aaca00" texture: "qtlogo.png" } } The Cube element is part of the Qt3D.Shapes namespace, so the following must appear at the top of any QML file that references it: import Qt3D.Shapes 1.0 The cube can be moved from the origin by specifying the Item3D::position property: Cube { scale: 1.5 position: Qt.vector3d(1, 0, 5) effect: Effect { color: "#aaca00" texture: "qtlogo.png" } } See also Item3D. |