QQuick3DObject Class

Base class of all 3D nodes and resources. 更多...

头: #include <QQuick3DObject>
实例化: Object3D
继承: QObject and QQmlParserStatus
继承者: QQuick3DGeometry , QQuick3DInstancing ,和 QQuick3DTextureData

特性

公共函数

QQuick3DObject * parentItem () const
void setState (const QString & state )
QString state () const

公共槽

void setParentItem (QQuick3DObject * parentItem )

信号

void parentChanged ()
void stateChanged ()

详细描述

Object3D is the base class for all Qt Quick 3D scene objects. Currently the types available in C++ are:

Both of these types are resource objects which directly inherit QQuick3DObject.

It should not be necessary to use QQuick3DObject directly anywhere currently because it is just an interface for supporting spatial items and resources in a 3D scene, as well as exposing similar functionality as QQuickItem for 3D scene content.

特性文档编制

parent : QQuick3DObject *

This property holds the parent of the Object3D in a 3D scene.

注意: An Object3D 's parent may not necessarily be the same as its object parent. This is necessary because the object parent may be an item that is not of type Object3D , for example the root object in a scene.

注意: Currently for 3D items to be correctly handled by the scene manager when parenting 3D objects from C++ it is necessary to call QQuick3DObject::setParentItem before the QObject::setParent . This requirement is likely to change in a future release though.

QQuick3DObject *newItem = new QQuick3DObject();
newItem->setParentItem(parentItem);
newItem->setParent(parentItem);
					

访问函数:

QQuick3DObject * parentItem () const
void setParentItem (QQuick3DObject * parentItem )

通知程序信号:

void parentChanged ()

state : QString

This property holds the name of the current state of the object.

If the item is in its default state, that is, no explicit state has been set, then this property holds an empty string. Likewise, you can return an item to its default state by setting this property to an empty string.

访问函数:

QString state () const
void setState (const QString & state )

通知程序信号:

void stateChanged ()

另请参阅 Qt Quick 状态 .