QNode

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

Inheritance diagram of PySide2.Qt3DCore.Qt3DCore.QNode

Inherited by: QAbstractAnimationClip, QAbstractChannelMapping, QAbstractClipAnimator, QAbstractClipBlendNode, QAdditiveClipBlend, QAnimationClip, QAnimationClipLoader, QBlendedClipAnimator, QClipAnimator, QClock, QLerpClipBlend, QSkeletonMapping, QAbstractSkeleton, QArmature, QComponent, QEntity, QJoint, QSkeleton, QSkeletonLoader, QTransform, QAbstractCameraController, QAbstractSpriteSheet, QConeGeometry, QConeMesh, QCuboidGeometry, QCuboidMesh, QCylinderGeometry, QCylinderMesh, QDiffuseMapMaterial, QDiffuseSpecularMapMaterial, QDiffuseSpecularMaterial, QExtrudedTextGeometry, QExtrudedTextMesh, QFirstPersonCameraController, QForwardRenderer, QGoochMaterial, QMetalRoughMaterial, QMorphPhongMaterial, QNormalDiffuseMapAlphaMaterial, QNormalDiffuseMapMaterial, QNormalDiffuseSpecularMapMaterial, QOrbitCameraController, QPerVertexColorMaterial, QPhongAlphaMaterial, QPhongMaterial, QPlaneGeometry, QPlaneMesh, QSkyboxEntity, QSphereGeometry, QSphereMesh, QSpriteGrid, QSpriteSheet, QSpriteSheetItem, QText2DEntity, QTextureMaterial, QTorusGeometry, QTorusMesh, QAbstractActionInput, QAbstractAxisInput, QAbstractPhysicalDevice, QAction, QActionInput, QAnalogAxisInput, QAxis, QAxisAccumulator, QAxisSetting, QButtonAxisInput, QInputChord, QInputSequence, QInputSettings, QKeyboardDevice, QKeyboardHandler, QLogicalDevice, QMouseDevice, QMouseHandler, QFrameAction, QAbstractLight, QAbstractRayCaster, QAbstractTexture, QAbstractTextureImage, QAlphaCoverage, QAlphaTest, QAttribute, QBlendEquation, QBlendEquationArguments, QBlitFramebuffer, QBuffer, QBufferCapture, QCamera, QCameraLens, QCameraSelector, QClearBuffers, QClipPlane, QColorMask, QComputeCommand, QCullFace, QDepthTest, QDirectionalLight, QDispatchCompute, QDithering, QEffect, QEnvironmentLight, QFilterKey, QFrameGraphNode, QFrontFace, QFrustumCulling, QGeometry, QGeometryRenderer, QLayer, QLayerFilter, QLevelOfDetail, QLevelOfDetailSwitch, QLineWidth, QMaterial, QMemoryBarrier, QMesh, QMultiSampleAntiAliasing, QNoDepthMask, QNoDraw, QNoPicking, QObjectPicker, QPaintedTextureImage, QParameter, QPickingSettings, QPointLight, QPointSize, QPolygonOffset, QProximityFilter, QRayCaster, QRenderCapture, QRenderPass, QRenderPassFilter, QRenderSettings, QRenderState, QRenderStateSet, QRenderSurfaceSelector, QRenderTarget, QRenderTargetOutput, QRenderTargetSelector, QSceneLoader, QScissorTest, QScreenRayCaster, QSeamlessCubemap, QSetFence, QShaderData, QShaderImage, QShaderProgram, QShaderProgramBuilder, QSharedGLTexture, QSortPolicy, QSpotLight, QStencilMask, QStencilOperation, QStencilTest, QTechnique, QTechniqueFilter, QTexture1D, QTexture1DArray, QTexture2D, QTexture2DArray, QTexture2DMultisample, QTexture2DMultisampleArray, QTexture3D, QTextureBuffer, QTextureCubeMap, QTextureCubeMapArray, QTextureImage, QTextureLoader, QTextureRectangle, QViewport, QWaitFence

Synopsis

Functions

Virtual functions

Slots

Signals

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 QComponent

class PySide2.Qt3DCore.Qt3DCore.QNode([parent=None])

Creates a new QNode instance with parent parent .

Note

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

setParent()

PySide2.Qt3DCore.Qt3DCore.QNode.PropertyTrackingMode

Indicates how a QNode listens for property updates.

Constant

Description

Qt3DCore.QNode.TrackFinalValues

Tracks final values

Qt3DCore.QNode.DontTrackValues

Does not track values

Qt3DCore.QNode.TrackAllValues

Tracks all values

PySide2.Qt3DCore.Qt3DCore.QNode.blockNotifications(block)
Parameters:

block – bool

Return type:

bool

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.

PySide2.Qt3DCore.Qt3DCore.QNode.childNodes()
Return type:

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

PySide2.Qt3DCore.Qt3DCore.QNode.clearPropertyTracking(propertyName)
Parameters:

propertyName – str

Clears the tracking property called propertyName .

PySide2.Qt3DCore.Qt3DCore.QNode.clearPropertyTrackings()

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

PySide2.Qt3DCore.Qt3DCore.QNode.defaultPropertyTrackingMode()
Return type:

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 TrackFinalValues

PySide2.Qt3DCore.Qt3DCore.QNode.defaultPropertyTrackingModeChanged(mode)
Parameters:

modePropertyTrackingMode

PySide2.Qt3DCore.Qt3DCore.QNode.enabledChanged(enabled)
Parameters:

enabled – bool

PySide2.Qt3DCore.Qt3DCore.QNode.id()
Return type:

PySide2.Qt3DCore.Qt3DCore.QNodeId

Returns the id that uniquely identifies the QNode instance.

PySide2.Qt3DCore.Qt3DCore.QNode.isEnabled()
Return type:

bool

Holds the QNode enabled flag. By default a QNode is always enabled.

Note

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.

PySide2.Qt3DCore.Qt3DCore.QNode.nodeDestroyed()
PySide2.Qt3DCore.Qt3DCore.QNode.notificationsBlocked()
Return type:

bool

Returns true if aspect notifications are blocked; otherwise returns false . By default, notifications are not blocked.

PySide2.Qt3DCore.Qt3DCore.QNode.notifyObservers(change)
Parameters:

changeQSharedPointer

Note

This function is deprecated.

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.

PySide2.Qt3DCore.Qt3DCore.QNode.parentChanged(parent)
Parameters:

parentPySide2.QtCore.QObject

PySide2.Qt3DCore.Qt3DCore.QNode.parentNode()
Return type:

PySide2.Qt3DCore.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.

Note

if parent happens to be null, this will actually notify that the current QNode instance was removed from the scene.

PySide2.Qt3DCore.Qt3DCore.QNode.propertyTracking(propertyName)
Parameters:

propertyName – str

Return type:

PropertyTrackingMode

Returns the tracking mode of propertyName .

PySide2.Qt3DCore.Qt3DCore.QNode.sceneChangeEvent(change)
Parameters:

changeQSharedPointer

Note

This function is deprecated.

Called when one or more backend aspects sends a notification change to the current QNode instance.

Note

This method should be reimplemented in your subclasses to properly handle the change .

PySide2.Qt3DCore.Qt3DCore.QNode.sendReply(command)
Parameters:

commandQSharedPointer

Note

This function is deprecated.

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

QNodeCommand sendCommand

PySide2.Qt3DCore.Qt3DCore.QNode.setDefaultPropertyTrackingMode(mode)
Parameters:

modePropertyTrackingMode

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 TrackFinalValues

PySide2.Qt3DCore.Qt3DCore.QNode.setEnabled(isEnabled)
Parameters:

isEnabled – bool

Holds the QNode enabled flag. By default a QNode is always enabled.

Note

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.

PySide2.Qt3DCore.Qt3DCore.QNode.setParent(parent)
Parameters:

parentPySide2.Qt3DCore.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.

Note

if parent happens to be null, this will actually notify that the current QNode instance was removed from the scene.

PySide2.Qt3DCore.Qt3DCore.QNode.setPropertyTracking(propertyName, trackMode)
Parameters:

Sets the property tracking for propertyName and trackMode .