QNode Class▲
-
Header: QNode
-
Since: Qt 5.5
-
qmake: QT += 3dcore
-
Inherits: QObject
-
Inherited By: Qt3DAnimation::QAbstractAnimationClip, Qt3DAnimation::QAbstractClipBlendNode, Qt3DAnimation::QChannelMapper, Qt3DCore::QAbstractSkeleton, Qt3DCore::QComponent, Qt3DCore::QEntity, Qt3DCore::QJoint, Qt3DInput::QAbstractActionInput, Qt3DInput::QAbstractAxisInput, Qt3DInput::QAbstractPhysicalDevice, Qt3DInput::QAction, Qt3DInput::QAxis, Qt3DInput::QAxisSetting, Qt3DRender::QAbstractTexture, Qt3DRender::QAbstractTextureImage, Qt3DRender::QAttribute, Qt3DRender::QBuffer, Qt3DRender::QEffect, Qt3DRender::QFilterKey, Qt3DRender::QFrameGraphNode, Qt3DRender::QGeometry, Qt3DRender::QParameter, Qt3DRender::QPickingSettings, Qt3DRender::QRenderPass, Qt3DRender::QRenderState, Qt3DRender::QRenderTargetOutput, Qt3DRender::QShaderImage, Qt3DRender::QShaderProgram, Qt3DRender::QShaderProgramBuilder, Qt3DRender::QTechnique, and Qt3DRender::Quick::QScene2D
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▲
See also QEntity, QComponent
Member Type Documentation▲
enum QNode::PropertyTrackingMode▲
Property Documentation▲
defaultPropertyTrackingMode : PropertyTrackingMode▲
Holds the default property tracking mode which determines whether a QNode should be listening for property updates. This only applies to properties which haven't been overridden by a call to setPropertyTracking.
By default it is set to QNode::TrackFinalValues
Access functions:
-
defaultPropertyTrackingMode() const
-
void setDefaultPropertyTrackingMode( mode)
Notifier signal:
-
void defaultPropertyTrackingModeChanged( mode)
enabled : bool▲
Holds the QNode enabled flag. By default a QNode is always enabled.
the interpretation of what enabled means is aspect-dependent. Even if enabled is set to false, some aspects may still consider the node in some manner. This is documented on a class by class basis.
Access functions:
-
bool isEnabled() const
-
void setEnabled(bool isEnabled)
Notifier signal:
-
void enabledChanged(bool enabled)
parent : Qt3DCore::QNode*▲
Holds the immediate QNode parent, or null if the node has no parent.
Setting the parent will notify the backend aspects about current QNode instance's parent change.
if parent happens to be null, this will actually notify that the current QNode instance was removed from the scene.
Access functions:
-
*parentNode() const
-
void setParent( *parent)
Notifier signal:
-
void parentChanged( *parent)
Member Function Documentation▲
[explicit] QNode::QNode(Qt3DCore::QNode *parent = nullptr)▲
Creates a new QNode instance with parent parent.
The backend aspects will be notified that a QNode instance is part of the scene only if it has a parent; unless this is the root node of the Qt3D scene.
See Also▲
See also setParent()
bool QNode::blockNotifications(bool block)▲
If block is true, property change notifications sent by this object to aspects are blocked. If block is false, no such blocking will occur.
The return value is the previous value of notificationsBlocked().
Note that the other notification types will be sent even if the notifications for this object have been blocked.
See Also▲
See also notificationsBlocked()
Qt3DCore::QNodeVector QNode::childNodes() const▲
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.
Getter function for property defaultPropertyTrackingMode.
See Also▲
See also setDefaultPropertyTrackingMode()
Qt3DCore::QNodeId QNode::id() const▲
Returns the id that uniquely identifies the QNode instance.
void QNode::nodeDestroyed()▲
Emitted when the node is destroyed.
bool QNode::notificationsBlocked() const▲
Returns true if aspect notifications are blocked; otherwise returns false. By default, notifications are not blocked.
See Also▲
See also blockNotifications()
[protected] void QNode::notifyObservers(const Qt3DCore::QSceneChangePtr &change)▲
Sends the change QSceneChangePtr to any QBackendNodes in the registered aspects that correspond to this QNode.
You only need to call this function if you wish to send a specific type of change in place of the automatic handling.
Note: as of Qt 5.14, change messages are deprecated and should not be used, in particular for properties.
Qt3DCore::QNode::PropertyTrackingMode QNode::propertyTracking(const QString &propertyName) const▲
void QNode::setPropertyTracking(const QString &propertyName, Qt3DCore::QNode::PropertyTrackingMode trackMode)▲
Related Non-Members▲
QNodePtr▲
A shared pointer for QNode.
QNodeVector▲
List of QNode pointers.
Qt3DCore::QNodeId qIdForNode(Qt3DCore::QNode *node)▲
Returns node id for node.
Qt3DCore::QNodeIdVector qIdsForNodes(const T &nodes)▲
Returns vector of node ids for nodes.
Obsolete Members for QNode▲
The following members of class QNode are deprecated. We strongly advise against using them in new code.
Obsolete Member Function Documentation▲
[virtual protected] void QNode::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change)▲
This function is deprecated. We strongly advise against using it in new code.
Called when one or more backend aspects sends a notification change to the current Qt3DCore::QNode instance.
This method should be reimplemented in your subclasses to properly handle the change.
QNodeCommand::CommandId QNode::sendCommand(const QString &name, const QVariant &data = QVariant(), QNodeCommand::CommandId replyTo = QNodeCommand::CommandId())▲
This function is deprecated. We strongly advise against using it in new code.
Sends a command message to the backend node
Creates a QNodeCommand message and dispatches it to the backend node. The command is given and a name and some data which can be used in the backend node to perform various operations. This returns a CommandId which can be used to identify the initial command when receiving a message in reply. If the command message is to be sent in reply to another command, replyTo contains the id of that command.
See Also▲
See also QNodeCommand, QNode::sendReply
void QNode::sendReply(const Qt3DCore::QNodeCommandPtr &command)▲
This function is deprecated. We strongly advise against using it in new code.
Send a command back to the backend node.
Assumes the command is to be to sent back in reply to itself to the backend node.
See Also▲
See also QNodeCommand, QNode::sendCommand