QNode Class

class Qt3DCore::QNode

QNode is the base class of all Qt3D node classes used to build a Qt3D scene. More...

This class was introduced in Qt 5.5.

Public Types

enum PropertyTrackingMode { TrackFinalValues, DontTrackValues, TrackAllValues }

Public Functions

void clearPropertyTracking(const QString &propertyName)
void clearPropertyTrackings()
Qt3DCore::QNode::PropertyTrackingMode defaultPropertyTrackingMode() const
Qt3DCore::QNode::PropertyTrackingMode propertyTracking(const QString &propertyName) const
void setPropertyTracking(const QString &propertyName, Qt3DCore::QNode::PropertyTrackingMode trackMode)

Protected Functions

void nodeDestroyed()
typedef QNodePtr
typedef QNodeVector
Qt3DCore::QNodeId qIdForNode(Qt3DCore::QNode *node)
Qt3DCore::QNodeIdVector qIdsForNodes(const T &nodes)

Detailed Description

The owernship of QNode is determined by the QObject parent/child relationship between nodes. By itself, a QNode has no visual appearance and no particular meaning, it is there as a way of building a node based tree structure.

The parent of a QNode instance can only be another QNode instance.

Each QNode instance has a unique id that allows it to be recognizable from other instances.

When properties are defined on a QNode subclass, their NOTIFY signal will automatically generate notifications that the Qt3D backend aspects will receive.

See also QEntity and QComponent.

Member Type Documentation

enum QNode::PropertyTrackingMode

Indicates how a QNode listens for property updates.

ConstantValueDescription
Qt3DCore::QNode::TrackFinalValues0Tracks final values
Qt3DCore::QNode::DontTrackValues1Does not track values
Qt3DCore::QNode::TrackAllValues2Tracks all values

Member Function Documentation

void QNode::clearPropertyTracking(const QString &propertyName)

Clears the tracking property called propertyName.

void QNode::clearPropertyTrackings()

Erases all values that have been saved by the property tracking.

Qt3DCore::QNode::PropertyTrackingMode QNode::defaultPropertyTrackingMode() const

Returns the default property tracking mode which determines whether a QNode should be listening for property updates.

[protected] void QNode::nodeDestroyed()

Emitted when the node is destroyed.

Qt3DCore::QNode::PropertyTrackingMode QNode::propertyTracking(const QString &propertyName) const

Returns the tracking mode of propertyName.

See also setPropertyTracking().

void QNode::setPropertyTracking(const QString &propertyName, Qt3DCore::QNode::PropertyTrackingMode trackMode)

Sets the property tracking for propertyName and trackMode.

See also propertyTracking().

Related Non-Members

typedef QNodePtr

A shared pointer for QNode.

typedef QNodeVector

List of QNode pointers.

Qt3DCore::QNodeId qIdForNode(Qt3DCore::QNode *node)

Returns node id for node.

template <typename T> Qt3DCore::QNodeIdVector qIdsForNodes(const T &nodes)

Returns vector of node ids for nodes.