IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QNode Class

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

This class was introduced in Qt 5.5.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QNode Class

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

Property Documentation

 

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

Qt3DCore::QNodeVector QNode::childNodes() const

Returns a list filled with the QNode children of the current QNode instance.

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()

Related Non-Members

 

[alias] QNodePtr

A shared pointer for QNode.

[alias] 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.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+