TeapotThe Teapot item represents a stock teapot object. More... Inherits Item3D Teapot instantiates the C++ class Teapot This type was introduced in Qt 4.8. Detailed DescriptionThe Teapot element in QML provides a simple way to create a teapot object, usually for testing material effects and complex geometry. Teapot's center is the center of it's base. For example, the following QML code displays a teapot of size 1.5, covered in the Qt logo texture: Teapot {
scale: 1.5
effect: Effect {
color: "#aaca00"
texture: "qtlogo.png"
decal: true
}
}
The Teapot 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 teapot can be moved from the origin by specifying the Item3D::position property: Teapot {
scale: 1.5
position: Qt.vector3d(1, 0, 5)
effect: Effect {
color: "#aaca00"
texture: "qtlogo.png"
decal: true
}
}
See also Item3D. |