QQuick3DObject Class

Base class of all 3D nodes and resources. More...

Header: #include <QQuick3DObject>
Since: Qt 5.15
Instantiated By: Object3D
Inherits: QObject and QQmlParserStatus
Inherited By:

QQuick3DGeometry, QQuick3DInstancing, and QQuick3DTextureData

Public Types

enum ItemChange { ItemChildAddedChange, ItemChildRemovedChange, ItemSceneChange, ItemVisibleHasChanged, ItemParentHasChanged, …, ItemEnabledHasChanged }

Properties

Public Functions

QQuick3DObject(QQuick3DObject *parent = nullptr)
virtual ~QQuick3DObject() override
QList<QQuick3DObject *> childItems() const
QQuick3DObject *parentItem() const
void setState(const QString &state)
QString state() const

Public Slots

void setParentItem(QQuick3DObject *parentItem)
void update()

Signals

Protected Functions

QQuick3DObject(QQuick3DObjectPrivate &dd, QQuick3DObject *parent = nullptr)
bool isComponentComplete() const
virtual void itemChange(QQuick3DObject::ItemChange, const QQuick3DObject::ItemChangeData &)
virtual void markAllDirty()
virtual void preSync()
virtual QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) = 0

Reimplemented Protected Functions

virtual void classBegin() override
virtual void componentComplete() override

Detailed Description

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.

Member Type Documentation

enum QQuick3DObject::ItemChange

Property Documentation

parent : QQuick3DObject*

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

Note: 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.

Note: 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);

Access functions:

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

Notifier signal:

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.

Access functions:

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

Notifier signal:

void stateChanged()

See also Qt Quick States.

Member Function Documentation

QQuick3DObject::QQuick3DObject(QQuick3DObject *parent = nullptr)

Default constructs an instance of QQuick3DObject.

[protected] QQuick3DObject::QQuick3DObject(QQuick3DObjectPrivate &dd, QQuick3DObject *parent = nullptr)

Default constructs an instance of QQuick3DObject.

[override virtual] QQuick3DObject::~QQuick3DObject()

Destroys the instance of QQuick3DObject. The destructor is virtual.

QList<QQuick3DObject *> QQuick3DObject::childItems() const

[signal] void QQuick3DObject::childrenChanged()

[override virtual protected] void QQuick3DObject::classBegin()

[override virtual protected] void QQuick3DObject::componentComplete()

[private signal] void QQuick3DObject::detachWatchers()

[protected] bool QQuick3DObject::isComponentComplete() const

[virtual protected] void QQuick3DObject::itemChange(QQuick3DObject::ItemChange, const QQuick3DObject::ItemChangeData &)

[virtual protected] void QQuick3DObject::markAllDirty()

[virtual protected] void QQuick3DObject::preSync()

[slot] void QQuick3DObject::update()

[pure virtual protected] QSSGRenderGraphObject *QQuick3DObject::updateSpatialNode(QSSGRenderGraphObject *node)

© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.