QNode is the base class of all Qt3D node classes used to build a Qt3D scene. 更多...
QNode (Qt3DCore::QNode * parent = nullptr) | |
bool | blockNotifications (bool block ) |
Qt3DCore::QNodeVector | childNodes () const |
Qt3DCore::QNodeId | id () const |
bool | isEnabled () const |
bool | notificationsBlocked () const |
Qt3DCore::QNode * | parentNode () const |
void | setEnabled (bool isEnabled ) |
void | setParent (Qt3DCore::QNode * parent ) |
void | enabledChanged (bool enabled ) |
void | nodeDestroyed () |
void | parentChanged (QObject * parent ) |
QNodePtr | |
QNodeVector | |
Qt3DCore::QNodeId | qIdForNode (Qt3DCore::QNode * node ) |
Qt3DCore::QNodeIdVector | qIdsForNodes (const T & nodes ) |
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.
另请参阅 QEntity and QComponent .
保持 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.
访问函数:
bool | isEnabled () const |
void | setEnabled (bool isEnabled ) |
通知程序信号:
void | enabledChanged (bool enabled ) |
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.
访问函数:
Qt3DCore::QNode * | parentNode () const |
void | setParent (Qt3DCore::QNode * parent ) |
通知程序信号:
void | parentChanged (QObject * parent ) |
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.
另请参阅 setParent ().
[signal]
void
QNode::
nodeDestroyed
()
Emitted when the node is destroyed.
若
block
is
true
, property change notifications sent by this object to aspects are blocked. If
block
is
false
, no such blocking will occur.
返回值是先前值的 notificationsBlocked ().
Note that the other notification types will be sent even if the notifications for this object have been blocked.
另请参阅 notificationsBlocked ().
Returns a list filled with the QNode children of the current QNode 实例。
Returns the id that uniquely identifies the QNode 实例。
返回
true
if aspect notifications are blocked; otherwise returns
false
. By default, notifications are
not
blocked.
另请参阅 blockNotifications ().
[alias]
QNodePtr
共享指针为 QNode .
[alias]
QNodeVector
List of QNode pointers.
Returns node id for node .
Returns vector of node ids for nodes .