VisualNode

Since: BlackBerry 10.0.0

#include <bb/cascades/VisualNode>

A visual node in the scene graph.

The position of a VisualNode in the scene graph is determined by two forms of input: the Control::layoutProperties set on the node, and the type of Layout of its parent node. In addition, extra transforms (translation, rotation, and scale) can be applied to offset the visual node from its layout placement. When rotating or scaling a node, the pivotX and pivotY properties can be used to change the anchoring point for the transition. The default pivot point for a visual node is (0,0), which represents the center of the node.

In addition to managing the transforms of a node, VisualNode also contains an opacity property for changing its transparency, and a visible property for specifying whether the visual node should be laid out in the scene. Setting the visible value to false is not the same as setting opacity to 0.0f (fully transparent). While the transparent node is still positioned by the layout and takes up room in the scene, a node that is not visible will not be rendered or positioned inside the scene.

Setting visible to false essentially removes the node from the scene without unlinking it from the scene graph. In this state, no touch events will be sent to the node. This is a convenient way of removing nodes to optimize the performance of the scene without actually unlinking them. It is highly recommended to use this property to hide visual nodes whenever possible.

Animating visual properties

For most of the visual properties of a VisualNode (translation, rotation, scale, and opacity), changing the value at runtime initiates a default implicit animation. For example, if the opacity property of a node is changed from 1.0 to 0.0, instead of becoming instantly transparent, the visuals are animated gradually (but, the actual property value is changed right away).

If implicit animations are not enough, a set of explicit animations can be added to a visual node (using VisualNode:animations) for animating its properties or the properties of the derived class:

  • FadeTransition: animates the opacity property

  • RotateTransition: animates the rotationZ property

  • ScaleTransition: animates the scaleX and scaleY properties

  • TranslateTranstion: animates the translationX and translationY properties

Touch events

The visual node receives touch events through two signals: touch() and touchCapture(). The first one receives events delivered in the PropagationPhase::AtTarget and PropagationPhase::Bubble phases, the second one receives events in the PropagationPhase::Capturing phase.


Overview

QML properties

eventHandlers: QDeclarativeListProperty [read-only]
opacity: float
overlapTouchPolicy: bb::cascades::OverlapTouchPolicy::Type
pivotX: float
pivotY: float
rotationZ: float
scaleX: float
scaleY: float
touchPropagationMode: bb::cascades::TouchPropagationMode::Type
translationX: float
translationY: float
visible: bool
attachedObjects: QDeclarativeListProperty< QObject > [read-only]Inherited
objectName: QStringInherited
parent: QObject [read-only]Inherited
ui: bb::cascades::UIConfig [read-only]Inherited

Properties Index

Public Functions Index

virtual ~VisualNode ()
voidaddAnimation (AbstractAnimation *animation)
Q_INVOKABLE voidaddEffect (bb::cascades::AbstractEffect *effect)
voidaddEventHandler (AbstractEventHandler *eventHandler)
voidaddGestureHandler (GestureHandler *gestureHandler)
voidaddTouchBehavior (TouchBehavior *touchBehavior)
AbstractAnimation *animationAt (int index) const
intanimationCount () const
boolisVisible () const
floatopacity () const
bb::cascades::OverlapTouchPolicy::TypeoverlapTouchPolicy () const
floatpivotX () const
floatpivotY () const
voidremoveAllAnimations ()
voidremoveAllEventHandlers ()
voidremoveAllGestureHandlers ()
voidremoveAllTouchBehaviors ()
boolremoveAnimation (AbstractAnimation *animation)
Q_INVOKABLE voidremoveEffect (bb::cascades::AbstractEffect *effect)
boolremoveEventHandler (AbstractEventHandler *eventHandler)
boolremoveGestureHandler (GestureHandler *gestureHandler)
boolremoveTouchBehavior (TouchBehavior *touchBehavior)
Q_SLOT voidresetOpacity ()
Q_SLOT voidresetOverlapTouchPolicy ()
Q_SLOT voidresetPivot ()
Q_SLOT voidresetPivotX ()
Q_SLOT voidresetPivotY ()
Q_SLOT voidresetRotationZ ()
Q_SLOT voidresetScale ()
Q_SLOT voidresetScaleX ()
Q_SLOT voidresetScaleY ()
Q_SLOT voidresetTouchPropagationMode ()
Q_SLOT voidresetTranslation ()
Q_SLOT voidresetTranslationX ()
Q_SLOT voidresetTranslationY ()
Q_SLOT voidresetVisible ()
floatrotationZ () const
floatscaleX () const
floatscaleY () const
Q_SLOT voidsetOpacity (float opacity)
Q_SLOT voidsetOverlapTouchPolicy (bb::cascades::OverlapTouchPolicy::Type policy)
Q_SLOT voidsetPivot (float pivotX, float pivotY)
Q_SLOT voidsetPivotX (float pivotX)
Q_SLOT voidsetPivotY (float pivotY)
Q_SLOT voidsetRotationZ (float rotationZ)
Q_SLOT voidsetScale (float scaleX, float scaleY)
Q_SLOT voidsetScale (float scaleXY)
Q_SLOT voidsetScaleX (float scaleX)
Q_SLOT voidsetScaleY (float scaleY)
Q_SLOT voidsetTouchPropagationMode (bb::cascades::TouchPropagationMode::Type mode)
Q_SLOT voidsetTranslation (float translationX, float translationY)
Q_SLOT voidsetTranslationX (float translationX)
Q_SLOT voidsetTranslationY (float translationY)
Q_SLOT voidsetVisible (bool visible)
TouchPropagationMode::TypetouchPropagationMode () const
floattranslationX () const
floattranslationY () const
virtual boolevent (QEvent *event)Inherited
voidsetObjectName (const QString &name)Inherited
virtual Q_INVOKABLE QStringtoDebugString () const Inherited
Q_INVOKABLE bb::cascades::UIConfig *ui () const Inherited

Protected Functions Index

Only has inherited protected functions

BaseObject (QObject *parent=0)Inherited
virtual voidconnectNotify (const char *signal)Inherited
virtual voiddisconnectNotify (const char *signal)Inherited

Signals Index

voidopacityChanged (float opacity)
voidopacityChanging (float opacity)
voidoverlapTouchPolicyChanged (bb::cascades::OverlapTouchPolicy::Type newOverlapTouchPolicy)
voidpivotXChanged (float pivotX)
voidpivotYChanged (float pivotY)
voidrotationZChanged (float rotationZ)
voidrotationZChanging (float rotationZ)
voidscaleXChanged (float scaleX)
voidscaleXChanging (float scaleX)
voidscaleYChanged (float scaleY)
voidscaleYChanging (float scaleY)
voidtouch (bb::cascades::TouchEvent *event)
voidtouchCapture (bb::cascades::TouchEvent *event)
voidtouchEnter (bb::cascades::TouchEnterEvent *event)
voidtouchExit (bb::cascades::TouchExitEvent *event)
voidtouchPropagationModeChanged (bb::cascades::TouchPropagationMode::Type newTouchPropagationMode)
voidtranslationXChanged (float translationX)
voidtranslationXChanging (float translationX)
voidtranslationYChanged (float translationY)
voidtranslationYChanging (float translationY)
voidvisibleChanged (bool visible)
voidcreationCompleted ()Inherited
voidobjectNameChanged (const QString &objectName)Inherited

Properties

QDeclarativeListProperty eventHandlers[read-only]

List of the touch behaviors added on the visual node.

Since:

BlackBerry 10.0.0

Since:

BlackBerry 10.0.0

This node will be used as the implicit target for the animations in this list.

Since:

BlackBerry 10.0.0

Since:

BlackBerry 10.3.0

,

BlackBerry 10.3.1

float opacity

The opacity of the visual node.

A value between 0.0 (transparent) and 1.0 (opaque). This is the local opacity of the visual node, i.e. not taking the ancestor opacities into account. The default opacity is 1.0 (opaque).

Since:

BlackBerry 10.0.0

bb::cascades::OverlapTouchPolicy::Type overlapTouchPolicy

Determines whether the visual node will prevent underlying (spatially overlapped) nodes from partaking in touch event propagation.

If overlap touch policy is OverlapTouchPolicy::Deny, overlapped nodes will be excluded from touch propagation at an early stage during the processing of touch input. This means a scene with many layers of visual nodes with overlap touch policy set to OverlapTouchPolicy::Allow, may affect touch performance negatively.

Note:

The policy has no effect if propagation mode is TouchPropagationMode::None for the same visual node.

The default policy is OverlapTouchPolicy::Deny.
Since:

BlackBerry 10.0.0

float pivotX

The position of pivot point of the visual node along the x-axis.

The pivot is used as the anchoring point when rotating and scaling the visual node. It is defined by the components pivotX, pivotY and pivotZ and is relative to the center of the visual node. The default position of the pivot point is (0.0, 0.0, 0.0), which means it is at the center of the visual node.

Since:

BlackBerry 10.0.0

float pivotY

The position of pivot point of the visual node along the y-axis.

The pivot is used as the anchoring point when rotating and scaling the visual node. It is defined by the components pivotX, pivotY and pivotZ and is relative to the center of the visual node. The default position of the pivot point is (0.0, 0.0, 0.0), which means it is at the center of the visual node.

Since:

BlackBerry 10.0.0

float rotationZ

The rotation of the visual node around the z-axis in degrees.

The visual node is rotated around the z-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default rotation is 0.0 degrees.

Since:

BlackBerry 10.0.0

float scaleX

The scale factor of the visual node along the x-axis.

The visual node is scaled along the x-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default scale factor is 1.0 (not scaled).

Since:

BlackBerry 10.0.0

float scaleY

The scale factor of the visual node along the y-axis.

The visual node is scaled along the y-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default scale factor is 1.0 (not scaled).

Since:

BlackBerry 10.0.0

bb::cascades::TouchPropagationMode::Type touchPropagationMode

The touch propagation mode for the visual node.

This property controls how the visual node and its subtree partakes in touch event propagation. There are three possible modes, as defined by TouchPropagationMode::Type:

TouchPropagationMode::None can be used as an optimization if you have complex, non-interactive content, that overlaps interactive controls.

The default propagation mode is TouchPropagationMode::Full.

Since:

BlackBerry 10.0.0

float translationX

The translation of the visual node along the x-axis.

The translationX and translationY correspond to pixels as long as the translationZ is 0.0.

The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any way.

See also:

Layout for more details.

Since:

BlackBerry 10.0.0

float translationY

The translation of the visual node along the y-axis.

The translationX and translationY correspond to pixels as long as the translationZ is 0.0.

The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any way.

See also:

Layout for more details.

Since:

BlackBerry 10.0.0

bool visible

Whether the visual node is laid out or not.

If the visible property is set to false, the visual node is neither laid out nor rendered. The default visible value is true.

Important: Setting the visible value to false is not the same as setting opacity to 0.0f (transparent). While a transparent node is still laid out taking up room in the scene, a node that is not visible, will neither be rendered nor laid out inside the scene. It will behave as if it was removed from the scene without actually been unlinked from the scene graph. No touch events will be sent to the node if the visible value is false. This a convenient way of removing nodes to optimize the performance of the scene without is actually unlinking them. It is highly recommended to use this property to hide visual nodes whenever possible.

Since:

BlackBerry 10.0.0

QDeclarativeListProperty< QObject > attachedObjectsInherited[read-only]

A hierarchical list of the UIObject's attached objects.

Since:

BlackBerry 10.0.0

QString objectNameInherited

This property is overridden from QObject.

See also:

QObject::objectName().

Since:

BlackBerry 10.0.0

QObject parentInherited[read-only]

A read-only property that represents this object's parent.

The parent of an object is specified using QObject::setParent(QObject*). The purpose of the property is to expose the object's parent to QML.

This property is read-only to prevent modifications from QML, where typically the parent is declaratively set. In C++ code, the parent can be explicitly set using QObject::setParent(QObject*), or implicitly set by adding it to a visual container.

The default value of this property is 0.

Since:

BlackBerry 10.0.0

bb::cascades::UIConfig uiInherited[read-only]

An object that gives access to unit conversion routines.

QML use:
        // Size using design units
        Container {
            preferredWidth: ui.du(12)
            preferredHeight: ui.du(5)
        }

        // Size using design units, snap to whole pixels
        Container {
            preferredWidth: ui.sdu(13.5)
            preferredHeight: ui.sdu(7.5)
        }

        // Size using absolute pixel values
        Container {
            preferredWidth: ui.px(150)
            preferredHeight: ui.px(50)
        }
C++ use:
Container *container1 = Container::create().background(Color::Red);
UIConfig *ui = container1->ui();
container1->setPreferredWidth(ui->du(12));
container1->setPreferredHeight(ui->du(5));

Container *container2 = Container::create().background(Color::Green);
container2->setPreferredWidth(ui->sdu(13.5));
container2->setPreferredHeight(ui->sdu(7.5));

Container *container3 = Container::create().background(Color::Blue);
container3->setPreferredWidth(ui->px(150));
container3->setPreferredHeight(ui->sdu(50));
Since:

Blackberry 10.3.0

Public Functions

virtual~VisualNode ()

Destructor.

Since:

BlackBerry 10.0.0

void addAnimation (

Adds an animation to the visual node.

Parameters
animation

The animation to add. The ownership of the added animation will be transferred to the visual node. If the added animation was previously added to another visual node, it will be removed from that node and added to (and owned by) this node.

See also:

removeAnimation(), removeAllAnimation(), animationCount(), animationAt()

Since:

BlackBerry 10.0.0

Q_INVOKABLE void addEffect (

Adds an effect to the visual node.

Parameters
effect

The effect to add. The ownership of the added effect will be transferred to the visual node. If the added effect was previously added to another visual node, it will be left on that node and added to this node.

See also:

removeEffect()

Since:

BlackBerry 10.3.1

void addEventHandler (

Adds an event handler to the visual node.

Parameters
eventHandler

The event handler to add. The ownership of the added event handler will be transferred to the visual node. If the added event handler was previously added to another visual node, it will be removed from that node and added to (and owned by) this node.

See also:

removeEventHandler(), removeAllEventHandlers(), bb::cascades::EventHandler

Since:

BlackBerry 10.3.0

void addGestureHandler (

Adds a gesture handler to the visual node.

For example usage, refer to documentation of bb::cascades::GestureHandler.

Parameters
gestureHandler

The gesture handler to add. The ownership of the added gesture handler will be transferred to the visual node. If the added gesture handler was previously added to another visual node, it will be removed from that node and added to (and owned by) this node.

Since:

BlackBerry 10.0.0

void addTouchBehavior (

Adds a touch behavior to the visual node.

Multiple behaviors can be added, they will get evaluated in parallel.

For example usage, refer to documentation of bb::cascades::TouchBehavior.

Parameters
touchBehavior

The touch behavior to add. The ownership of the added touch behavior will be transferred to the visual node. If the added touch behavior was previously added to another visual node, it will be removed from that node and added to (and owned by) this node.

Since:

BlackBerry 10.0.0

AbstractAnimation * animationAt (
  • intindex)

Returns an animation added at a specified index.

This function, together with animationCount(), is used for iterating over all animations:
 for (int i = 0; i < animationCount(); ++i) {
     AbstractAnimation* animation = animationAt(i);
     ...
 }
Parameters
index

The index of the animation to retrieve. It must in the range of [ 0, animationCount() [, otherwise the function will return 0;

Return:

The animation at the specified index; 0 if the index was out of range. The ownership is not changed by this call.

Since:

BlackBerry 10.0.0

int animationCount ()

Returns the number of animations added to the visual node.

This function, together with animationAt(), is used for iterating over all animations:
 for (int i = 0; i < animationCount(); ++i) {
     AbstractAnimation* animation = animationAt(i);
     ...
 }
See also:

animationAt()

Return:

The number of animations added to the visual node.

Since:

BlackBerry 10.0.0

bool isVisible ()

Checks whether the visual node is visible or not.

If the visible property is set to false, the visual node is neither laid out nor rendered. The default visible value is true.

Important: Setting the visible value to false is not the same as setting opacity to 0.0f (transparent). While a transparent node is still laid out taking up room in the scene, a node that is not visible, will neither be rendered nor laid out inside the scene. It will behave as if it was removed from the scene without actually been unlinked from the scene graph. No touch events will be sent to the node if the visible value is false. This a convenient way of removing nodes to optimize the performance of the scene without is actually unlinking them. It is highly recommended to use this property to hide visual nodes whenever possible.

Since:

BlackBerry 10.0.0

Return:

true if the visual node is visible, false otherwise.

Since:

BlackBerry 10.0.0

float opacity ()

Returns the opacity of the visual node.

A value between 0.0 (transparent) and 1.0 (opaque). This is the local opacity of the visual node, i.e. not taking the ancestor opacities into account. The default opacity is 1.0 (opaque).

Since:

BlackBerry 10.0.0

Return:

A value between between 0.0 (transparent) and 1.0 (opaque).

Since:

BlackBerry 10.0.0

bb::cascades::OverlapTouchPolicy::Type overlapTouchPolicy ()

Returns the overlap touch policy for the visual node.

If overlap touch policy is OverlapTouchPolicy::Deny, overlapped nodes will be excluded from touch propagation at an early stage during the processing of touch input. This means a scene with many layers of visual nodes with overlap touch policy set to OverlapTouchPolicy::Allow, may affect touch performance negatively.

Note:

The policy has no effect if propagation mode is TouchPropagationMode::None for the same visual node.

The default policy is OverlapTouchPolicy::Deny.
Since:

BlackBerry 10.0.0

Return:

The overlap touch policy for the visual node.

Since:

BlackBerry 10.0.0

float pivotX ()

Returns the position of pivot point of the visual node along the x-axis.

The pivot is used as the anchoring point when rotating and scaling the visual node. It is defined by the components pivotX, pivotY and pivotZ and is relative to the center of the visual node. The default position of the pivot point is (0.0, 0.0, 0.0), which means it is at the center of the visual node.

Since:

BlackBerry 10.0.0

Return:

The position of pivot point along the x-axis, relative to the center of the visual node.

Since:

BlackBerry 10.0.0

float pivotY ()

Returns the position of pivot point of the visual node along the y-axis.

The pivot is used as the anchoring point when rotating and scaling the visual node. It is defined by the components pivotX, pivotY and pivotZ and is relative to the center of the visual node. The default position of the pivot point is (0.0, 0.0, 0.0), which means it is at the center of the visual node.

Since:

BlackBerry 10.0.0

Return:

The position of pivot point along the y-axis, relative to the center of the visual node.

Since:

BlackBerry 10.0.0

void removeAllAnimations ()

Convenience function for removing and deleting all animations added to the visual node.

All animations added to the visual node will be removed and deleted.

Since:

BlackBerry 10.0.0

void removeAllEventHandlers ()

Removes and deletes all event handlers currently added to this visual node.

Since:

BlackBerry 10.3.0

void removeAllGestureHandlers ()

Removes and deletes all gesture handlers currently added to this visual node.

Since:

BlackBerry 10.0.0

void removeAllTouchBehaviors ()

Removes and deletes all touch behaviors currently added to this visual node.

Since:

BlackBerry 10.0.0

bool removeAnimation (

Removes an animation from the visual node.

Once the animation is removed, the visual node no longer references it, but it is still owned by the visual node. It is up to the application to either delete the removed animation, transfer its ownership (by setting its parent) to another object or leave it as a child of the visual node (in which case it will be deleted with the visual node).

Here is an example on how to remove and delete all animations added to the visual node:
 for (int i = 0; i < animationCount(); ++i) {
     AbstractAnimation* animation = animationAt(i);
     removeAnimation(animation);
     delete animation;
 }
See also:

removeAllAnimation(), animationCount(), animationAt(), addAnimation()

Parameters
animation

The animation to remove.

Return:

Returns False of the animation to remove wasn't added to the visual node or if the animation was 0, true otherwise.

Since:

BlackBerry 10.0.0

Q_INVOKABLE void removeEffect (

Removes an effect to the visual node.

Parameters
effect

The effect to remove. The ownership of the effect will remain until the effect is either deleted or set as effect on another node.

See also:

addEffect()

Since:

BlackBerry 10.3.1

bool removeEventHandler (

Removes a event handler from the visual node.

Once the event handler is removed, the visual node no longer references it, but it is still owned by the visual node. It is up to the application to either delete the removed event handler, transfer its ownership (by setting its parent) to another object or leave it as a child of the visual node (in which case it will be deleted with the visual node).

Parameters
eventHandler

The event handler to remove.

Return:

false if the event handler to remove wasn't removed from the visual node or if the event handler was 0, true otherwise.

Since:

BlackBerry 10.3.0

bool removeGestureHandler (

Removes a gesture handler from the visual node.

Once the gesture handler is removed, the visual node no longer references it, but it is still owned by the visual node. It is up to the application to either delete the removed gesture handler, transfer its ownership (by setting its parent) to another object or leave it as a child of the visual node (in which case it will be deleted with the visual node).

Parameters
gestureHandler

The gesture handler to remove.

Return:

false if the gesture handler to remove wasn't removed from the visual node or if the gesture handler was 0, true otherwise.

Since:

BlackBerry 10.0.0

bool removeTouchBehavior (

Removes a touch behavior from the visual node.

Once the touch behavior is removed, the visual node no longer references it, but it is still owned by the visual node. It is up to the application to either delete the removed touch behavior, transfer its ownership (by setting its parent) to another object or leave it as a child of the visual node (in which case it will be deleted with the visual node).

Parameters
touchBehavior

The touch behavior to remove.

Return:

Returns False if the touch behavior to remove wasn't removed from the visual node or if the touch behavior was 0, true otherwise.

Since:

BlackBerry 10.0.0

Q_SLOT void resetOpacity ()

Resets the opacity of the visual node to 1.0 (opaque).

A value between 0.0 (transparent) and 1.0 (opaque). This is the local opacity of the visual node, i.e. not taking the ancestor opacities into account. The default opacity is 1.0 (opaque).

Since:

BlackBerry 10.0.0

Since:

BlackBerry 10.0.0

Q_SLOT void resetOverlapTouchPolicy ()

Resets the overlap touch policy for the visual node to OverlapTouchPolicy::Deny.

If overlap touch policy is OverlapTouchPolicy::Deny, overlapped nodes will be excluded from touch propagation at an early stage during the processing of touch input. This means a scene with many layers of visual nodes with overlap touch policy set to OverlapTouchPolicy::Allow, may affect touch performance negatively.

Note:

The policy has no effect if propagation mode is TouchPropagationMode::None for the same visual node.

The default policy is OverlapTouchPolicy::Deny.
Since:

BlackBerry 10.0.0

Since:

BlackBerry 10.0.0

Q_SLOT void resetPivot ()

Convenience function for resetting the position of pivot point to 0.0 (center of node) along all axes.

The pivot is used as the anchoring point when rotating and scaling the visual node. It is defined by the components pivotX, pivotY and pivotZ and is relative to the center of the visual node. The default position of the pivot point is (0.0, 0.0, 0.0), which means it is at the center of the visual node.

Since:

BlackBerry 10.0.0

Since:

BlackBerry 10.0.0

Q_SLOT void resetPivotX ()

Resets the position of pivot point of the visual node along the x-axis to 0.0 (center of node).

The pivot is used as the anchoring point when rotating and scaling the visual node. It is defined by the components pivotX, pivotY and pivotZ and is relative to the center of the visual node. The default position of the pivot point is (0.0, 0.0, 0.0), which means it is at the center of the visual node.

Since:

BlackBerry 10.0.0

See also:

resetPivot()

Since:

BlackBerry 10.0.0

Q_SLOT void resetPivotY ()

Resets the position of pivot point of the visual node along the y-axis to 0.0 (center of node).

The pivot is used as the anchoring point when rotating and scaling the visual node. It is defined by the components pivotX, pivotY and pivotZ and is relative to the center of the visual node. The default position of the pivot point is (0.0, 0.0, 0.0), which means it is at the center of the visual node.

Since:

BlackBerry 10.0.0

See also:

resetPivot()

Since:

BlackBerry 10.0.0

Q_SLOT void resetRotationZ ()

Resets the rotation of the visual node around the z-axis to 0.0 degrees.

The visual node is rotated around the z-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default rotation is 0.0 degrees.

Since:

BlackBerry 10.0.0

See also:

resetRotation()

Since:

BlackBerry 10.0.0

Q_SLOT void resetScale ()

Resets the scale factor for all axis to 1.0 (no scaling).

Since:

BlackBerry 10.0.0

Q_SLOT void resetScaleX ()

Resets the scale factor of the visual node along the x-axis to 1.0 (no scaling).

The visual node is scaled along the x-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default scale factor is 1.0 (not scaled).

Since:

BlackBerry 10.0.0

See also:

resetScale()

Since:

BlackBerry 10.0.0

Q_SLOT void resetScaleY ()

Resets the scale factor of the visual node along the y-axis to 1.0 (no scaling).

The visual node is scaled along the y-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default scale factor is 1.0 (not scaled).

Since:

BlackBerry 10.0.0

See also:

resetScale()

Since:

BlackBerry 10.0.0

Q_SLOT void resetTouchPropagationMode ()

Resets the touch propagation mode for the visual node to TouchPropagationMode::Full.

This property controls how the visual node and its subtree partakes in touch event propagation. There are three possible modes, as defined by TouchPropagationMode::Type:

TouchPropagationMode::None can be used as an optimization if you have complex, non-interactive content, that overlaps interactive controls.

The default propagation mode is TouchPropagationMode::Full.

Since:

BlackBerry 10.0.0

Since:

BlackBerry 10.0.0

Q_SLOT void resetTranslation ()

Convenience function for resetting the translation along all axes.

The translationX and translationY correspond to pixels as long as the translationZ is 0.0.

The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any way.

See also:

Layout for more details.

Since:

BlackBerry 10.0.0

Since:

BlackBerry 10.0.0

Q_SLOT void resetTranslationX ()

Resets the translation of the visual node to 0.0 along the x-axis.

The translationX and translationY correspond to pixels as long as the translationZ is 0.0.

The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any way.

See also:

Layout for more details.

Since:

BlackBerry 10.0.0

Since:

BlackBerry 10.0.0

Q_SLOT void resetTranslationY ()

Resets the translation of the visual node to 0.0 along the y-axis.

The translationX and translationY correspond to pixels as long as the translationZ is 0.0.

The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any way.

See also:

Layout for more details.

Since:

BlackBerry 10.0.0

Since:

BlackBerry 10.0.0

Q_SLOT void resetVisible ()

Resets the visual node to be visible.

If the visible property is set to false, the visual node is neither laid out nor rendered. The default visible value is true.

Important: Setting the visible value to false is not the same as setting opacity to 0.0f (transparent). While a transparent node is still laid out taking up room in the scene, a node that is not visible, will neither be rendered nor laid out inside the scene. It will behave as if it was removed from the scene without actually been unlinked from the scene graph. No touch events will be sent to the node if the visible value is false. This a convenient way of removing nodes to optimize the performance of the scene without is actually unlinking them. It is highly recommended to use this property to hide visual nodes whenever possible.

Since:

BlackBerry 10.0.0

Since:

BlackBerry 10.0.0

float rotationZ ()

Returns the rotation of the visual node around the z-axis.

The visual node is rotated around the z-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default rotation is 0.0 degrees.

Since:

BlackBerry 10.0.0

Return:

The rotation around the z-axis in degrees.

Since:

BlackBerry 10.0.0

float scaleX ()

Returns the scale factor of the visual node along the x-axis.

The visual node is scaled along the x-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default scale factor is 1.0 (not scaled).

Since:

BlackBerry 10.0.0

Return:

The scale factor along the x-axis.

Since:

BlackBerry 10.0.0

float scaleY ()

Returns the scale factor of the visual node along the y-axis.

The visual node is scaled along the y-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default scale factor is 1.0 (not scaled).

Since:

BlackBerry 10.0.0

Return:

The scale factor along the y-axis.

Since:

BlackBerry 10.0.0

Q_SLOT void setOpacity (
  • floatopacity)

Sets the opacity of the visual node.

A value between 0.0 (transparent) and 1.0 (opaque). This is the local opacity of the visual node, i.e. not taking the ancestor opacities into account. The default opacity is 1.0 (opaque).

Since:

BlackBerry 10.0.0

Parameters
opacity

A value between between 0.0 (transparent) and 1.0 (opaque). If the value is outside the range it will be clamped to [0.0, 1.0].

Since:

BlackBerry 10.0.0

Q_SLOT void setOverlapTouchPolicy (

Sets the overlap touch policy for the visual node.

If overlap touch policy is OverlapTouchPolicy::Deny, overlapped nodes will be excluded from touch propagation at an early stage during the processing of touch input. This means a scene with many layers of visual nodes with overlap touch policy set to OverlapTouchPolicy::Allow, may affect touch performance negatively.

Note:

The policy has no effect if propagation mode is TouchPropagationMode::None for the same visual node.

The default policy is OverlapTouchPolicy::Deny.
Since:

BlackBerry 10.0.0

Parameters
policy

The new overlap touch policy for the visual node.

Since:

BlackBerry 10.0.0

Q_SLOT void setPivot (
  • floatpivotX,
  • floatpivotY )

Convenience function for setting the position of pivot point of the visual node along the x- and y-axes.

The pivot is used as the anchoring point when rotating and scaling the visual node. It is defined by the components pivotX, pivotY and pivotZ and is relative to the center of the visual node. The default position of the pivot point is (0.0, 0.0, 0.0), which means it is at the center of the visual node.

Since:

BlackBerry 10.0.0

Parameters
pivotX

The position of pivot point along the x-axis, relative to the center of the visual node.

pivotY

The position of pivot point along the y-axis, relative to the center of the visual node.

Since:

BlackBerry 10.0.0

Q_SLOT void setPivotX (
  • floatpivotX)

Sets the position of pivot point of the visual node along the x-axis.

The pivot is used as the anchoring point when rotating and scaling the visual node. It is defined by the components pivotX, pivotY and pivotZ and is relative to the center of the visual node. The default position of the pivot point is (0.0, 0.0, 0.0), which means it is at the center of the visual node.

Since:

BlackBerry 10.0.0

See also:

setPivot(float, float), setPivot(float, float, float)

Parameters
pivotX

The position of pivot point along the x-axis, relative to the center of the visual node.

Since:

BlackBerry 10.0.0

Q_SLOT void setPivotY (
  • floatpivotY)

Sets the position of pivot point of the visual node along the y-axis.

The pivot is used as the anchoring point when rotating and scaling the visual node. It is defined by the components pivotX, pivotY and pivotZ and is relative to the center of the visual node. The default position of the pivot point is (0.0, 0.0, 0.0), which means it is at the center of the visual node.

Since:

BlackBerry 10.0.0

See also:

setPivot(float, float), setPivot(float, float, float)

Parameters
pivotY

The position of pivot point along the y-axis, relative to the center of the visual node.

Since:

BlackBerry 10.0.0

Q_SLOT void setRotationZ (
  • floatrotationZ)

Sets the rotation of the visual node around the z-axis.

The visual node is rotated around the z-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default rotation is 0.0 degrees.

Since:

BlackBerry 10.0.0

Parameters
rotationZ

The rotation around the z-axis in degrees, anchored at (pivotX and pivotY).

Since:

BlackBerry 10.0.0

Q_SLOT void setScale (
  • floatscaleX,
  • floatscaleY )

Convenience function for setting the scale factor for each axes.

Parameters
scaleX

The scale factor along the x-axis, anchored at pivotX.

scaleY

The scale factor along the y-axis, anchored at pivotY.

Since:

BlackBerry 10.0.0

Q_SLOT void setScale (
  • floatscaleXY)

Convenience function for setting the same scale factor for all axes.

Parameters
scaleXY

The scale factor to set for all axes.

Since:

BlackBerry 10.0.0

Q_SLOT void setScaleX (
  • floatscaleX)

Sets the scale factor of the visual node along the x-axis.

The visual node is scaled along the x-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default scale factor is 1.0 (not scaled).

Since:

BlackBerry 10.0.0

Parameters
scaleX

The scale factor along the x-axis, anchored at pivotX.

Since:

BlackBerry 10.0.0

Q_SLOT void setScaleY (
  • floatscaleY)

Sets the scale factor of the visual node along the y-axis.

The visual node is scaled along the y-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default scale factor is 1.0 (not scaled).

Since:

BlackBerry 10.0.0

See also:

setScale()

Parameters
scaleY

The scale factor along the y-axis, anchored at pivotY.

See also:

setPivotY()

Since:

BlackBerry 10.0.0

Q_SLOT void setTouchPropagationMode (

Sets the touch propagation mode for the visual node.

This property controls how the visual node and its subtree partakes in touch event propagation. There are three possible modes, as defined by TouchPropagationMode::Type:

TouchPropagationMode::None can be used as an optimization if you have complex, non-interactive content, that overlaps interactive controls.

The default propagation mode is TouchPropagationMode::Full.

Since:

BlackBerry 10.0.0

Parameters
mode

The new touch propagation mode for the visual node.

Since:

BlackBerry 10.0.0

Q_SLOT void setTranslation (
  • floattranslationX,
  • floattranslationY )

Convenience function for setting the translation along all axes.

The translationX and translationY correspond to pixels as long as the translationZ is 0.0.

The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any way.

See also:

Layout for more details.

Since:

BlackBerry 10.0.0

Parameters
translationX

The translation along the the x-axis (pointing towards right).

translationY

The translation along the the y-axis (pointing downwards).

Since:

BlackBerry 10.0.0

Q_SLOT void setTranslationX (
  • floattranslationX)

Sets the translation of the visual node along the x-axis.

The translationX and translationY correspond to pixels as long as the translationZ is 0.0.

The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any way.

See also:

Layout for more details.

Since:

BlackBerry 10.0.0

See also:

setTranslation(float, float), setTranslation(float, float, float)

Parameters
translationX

The translation along the the x-axis (pointing towards right).

Since:

BlackBerry 10.0.0

Q_SLOT void setTranslationY (
  • floattranslationY)

Sets the translation of the visual node along the y-axis.

The translationX and translationY correspond to pixels as long as the translationZ is 0.0.

The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any way.

See also:

Layout for more details.

Since:

BlackBerry 10.0.0

See also:

setTranslation(float, float), setTranslation(float, float, float)

Parameters
translationY

The translation along the the y-axis (pointing downwards).

Since:

BlackBerry 10.0.0

Q_SLOT void setVisible (
  • boolvisible)

Sets whether the visual should be visible or not.

If the visible property is set to false, the visual node is neither laid out nor rendered. The default visible value is true.

Important: Setting the visible value to false is not the same as setting opacity to 0.0f (transparent). While a transparent node is still laid out taking up room in the scene, a node that is not visible, will neither be rendered nor laid out inside the scene. It will behave as if it was removed from the scene without actually been unlinked from the scene graph. No touch events will be sent to the node if the visible value is false. This a convenient way of removing nodes to optimize the performance of the scene without is actually unlinking them. It is highly recommended to use this property to hide visual nodes whenever possible.

Since:

BlackBerry 10.0.0

Parameters
visible

True to make the visual node visible, false otherwise.

Since:

BlackBerry 10.0.0

TouchPropagationMode::Type touchPropagationMode ()

Returns the touch propagation mode for the visual node.

This property controls how the visual node and its subtree partakes in touch event propagation. There are three possible modes, as defined by TouchPropagationMode::Type:

TouchPropagationMode::None can be used as an optimization if you have complex, non-interactive content, that overlaps interactive controls.

The default propagation mode is TouchPropagationMode::Full.

Since:

BlackBerry 10.0.0

Return:

The touch propagation mode for the visual node.

Since:

BlackBerry 10.0.0

float translationX ()

Returns the translation of the visual node along the x-axis.

The translationX and translationY correspond to pixels as long as the translationZ is 0.0.

The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any way.

See also:

Layout for more details.

Since:

BlackBerry 10.0.0

Return:

The translation along the the x-axis (pointing towards right).

Since:

BlackBerry 10.0.0

float translationY ()

Returns the translation of the visual node along the y-axis.

The translationX and translationY correspond to pixels as long as the translationZ is 0.0.

The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any way.

See also:

Layout for more details.

Since:

BlackBerry 10.0.0

Return:

The translation along the the y-axis (pointing downwards).

Since:

BlackBerry 10.0.0

virtual bool event (Inherited

Overloaded to implement the event mechanism in Cascades.

Warning!

If this function is overridden, it must be called by the derived class for events to work properly in Cascades.

Parameters
event

The received event.

Return:

True if the received event was recognized and processed, false otherwise.

Since:

BlackBerry 10.0.0

void setObjectName (Inherited

Sets the objectName property.

Parameters
name

The new name for the object.

Since:

BlackBerry 10.0.0

virtual Q_INVOKABLE QString toDebugString ()Inherited

Returns a debug string representing this object.

Return:

A debug string for the object.

Since:

BlackBerry 10.0.0

Q_INVOKABLE bb::cascades::UIConfig * ui ()Inherited

Returns the UIConfig for this ui object.

The UIConfig can be used to perform unit conversions from design units (du) and snapped design units (sdu) to pixels.

Ownership remains with Cascades.

C++ use:
Container *container1 = Container::create().background(Color::Red);
UIConfig *ui = container1->ui();
container1->setPreferredWidth(ui->du(12));
container1->setPreferredHeight(ui->du(5));

Container *container2 = Container::create().background(Color::Green);
container2->setPreferredWidth(ui->sdu(13.5));
container2->setPreferredHeight(ui->sdu(7.5));

Container *container3 = Container::create().background(Color::Blue);
container3->setPreferredWidth(ui->px(150));
container3->setPreferredHeight(ui->sdu(50));
Return:

The UIConfig for this ui object.

Since:

BlackBerry 10.3.0

Protected Functions

(Only has inherited protected functions)

BaseObject (Inherited

Constructs an instance of BaseObject's subclass.

Parameters
parent

An optional parent, defaults to 0.

Since:

BlackBerry 10.0.0

virtual void connectNotify (
  • const char *signal)
Inherited

Overloaded to implement the event mechanism in Cascades.

If this function is overridden, it must be called by the derived class for events to work properly in Cascades.

Parameters
signal

The connected signal.

Since:

BlackBerry 10.0.0

virtual void disconnectNotify (
  • const char *signal)
Inherited

Overloaded to implement the event mechanism in Cascades.

If this function is overridden, it must be called by the derived class for events to work properly in Cascades.

Parameters
signal

The disconnected signal.

Since:

BlackBerry 10.0.0

Signals

void opacityChanged (
  • floatopacity)

Emitted after the opacity of the visual node has changed.

A value between 0.0 (transparent) and 1.0 (opaque). This is the local opacity of the visual node, i.e. not taking the ancestor opacities into account. The default opacity is 1.0 (opaque).

Since:

BlackBerry 10.0.0

Parameters
opacity

The new opacity set on the visual node.

See also:

opacityChanging

Since:

BlackBerry 10.0.0

void opacityChanging (
  • floatopacity)

Emitted while the opacity of the visual node is changing.

A value between 0.0 (transparent) and 1.0 (opaque). This is the local opacity of the visual node, i.e. not taking the ancestor opacities into account. The default opacity is 1.0 (opaque).

Since:

BlackBerry 10.0.0

Parameters
opacity

The new opacity set on the visual node.

See also:

opacityChanged

Since:

BlackBerry 10.0.0

void overlapTouchPolicyChanged (

Emitted when the overlap touch policy of the visual node is changed.

If overlap touch policy is OverlapTouchPolicy::Deny, overlapped nodes will be excluded from touch propagation at an early stage during the processing of touch input. This means a scene with many layers of visual nodes with overlap touch policy set to OverlapTouchPolicy::Allow, may affect touch performance negatively.

Note:

The policy has no effect if propagation mode is TouchPropagationMode::None for the same visual node.

The default policy is OverlapTouchPolicy::Deny.
Since:

BlackBerry 10.0.0

Parameters
newOverlapTouchPolicy

The new overlap touch policy.

Note:

Due to a work around for a Qt Core issue with accessing enums from QML the argument of this signal doesn't follow naming convention for signals in which the signal arguments are typically named to match the associated property's name. Use the object's property to access current property value instead of the signal argument to avoid runtime errors (i.e. use overlapTouchPolicy instead of newOverlapTouchPolicy).

Since:

BlackBerry 10.0.0

void pivotXChanged (
  • floatpivotX)

Emitted after pivotX of the visual node has changed.

The pivot is used as the anchoring point when rotating and scaling the visual node. It is defined by the components pivotX, pivotY and pivotZ and is relative to the center of the visual node. The default position of the pivot point is (0.0, 0.0, 0.0), which means it is at the center of the visual node.

Since:

BlackBerry 10.0.0

Parameters
pivotX

The new position of pivot point along the x-axis, relative to the center of the visual node.

Since:

BlackBerry 10.0.0

void pivotYChanged (
  • floatpivotY)

Emitted after pivotY of the visual node has changed.

The pivot is used as the anchoring point when rotating and scaling the visual node. It is defined by the components pivotX, pivotY and pivotZ and is relative to the center of the visual node. The default position of the pivot point is (0.0, 0.0, 0.0), which means it is at the center of the visual node.

Since:

BlackBerry 10.0.0

Parameters
pivotY

The new position of pivot point along the y-axis, relative to the center of the visual node.

Since:

BlackBerry 10.0.0

void rotationZChanged (
  • floatrotationZ)

Emitted after rotationZ of the visual node has changed.

The visual node is rotated around the z-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default rotation is 0.0 degrees.

Since:

BlackBerry 10.0.0

Parameters
rotationZ

The new rotation around the z-axis in degrees.

Since:

BlackBerry 10.0.0

void rotationZChanging (
  • floatrotationZ)

Emitted while rotationZ of the visual node is changing.

The visual node is rotated around the z-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default rotation is 0.0 degrees.

Since:

BlackBerry 10.0.0

Parameters
rotationZ

The new rotation around the z-axis in degrees.

Since:

BlackBerry 10.0.0

void scaleXChanged (
  • floatscaleX)

Emitted after scaleX of the visual node has changed.

The visual node is scaled along the x-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default scale factor is 1.0 (not scaled).

Since:

BlackBerry 10.0.0

Parameters
scaleX

The new scale factor along the x-axis.

Since:

BlackBerry 10.0.0

void scaleXChanging (
  • floatscaleX)

Emitted while scaleX of the visual node is changing.

The visual node is scaled along the x-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default scale factor is 1.0 (not scaled).

Since:

BlackBerry 10.0.0

Parameters
scaleX

The new scale factor along the x-axis.

See also:

scaleXChanged()

Since:

BlackBerry 10.0.0

void scaleYChanged (
  • floatscaleY)

Emitted after scaleY of the visual node has changed.

The visual node is scaled along the y-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default scale factor is 1.0 (not scaled).

Since:

BlackBerry 10.0.0

Parameters
scaleY

The new scale factor along the y-axis.

Since:

BlackBerry 10.0.0

void scaleYChanging (
  • floatscaleY)

Emitted while scaleY of the visual node is changing.

The visual node is scaled along the y-axis, centered around a pivot point defined by the components pivotX, pivotY and pivotZ. The default scale factor is 1.0 (not scaled).

Since:

BlackBerry 10.0.0

Parameters
scaleY

The new scale factor along the y-axis.

See also:

scaleYChanged()

Since:

BlackBerry 10.0.0

void touch (

Emitted when a touch event is received.

Adding touch behaviors is a way to influence under what circumstances the node receives events.

Parameters
event

Pointer to the touch event.

Since:

BlackBerry 10.0.0

void touchCapture (

Emitted when a touch event is directed towards a child of this node.

Adding touch behaviors is a way to influence under what circumstances the node receives events.

Parameters
event

- Pointer to the touch event.

Since:

BlackBerry 10.0.0

void touchEnter (

Emitted when touch enters the enter/exit area of this node.

touchEnter is not emitted when touch down happens on the enter/exit area, but only when touch moves into the area from outside.

Enter/exit areas

An enter/exit area is defined by
  • the node where the listener is connected,

  • its subtree and

  • overlapping nodes that are not part of the subtree

combined with the properties
  • touchPropagationMode and

  • overlapTouchPolicy

touchPropagationMode

  • None means a node and its subtree does not count towards the enter/exit area.

  • PassThrough means a node does not count towards any enter/exit area, but its subtree does.

  • Full means a node and its subtree counts towards the enter/exit area.

overlapTouchPolicy

  • Deny means a node that overlaps an enter/exit area (and is not part of the enter/exit subtree) subtracts from the enter/exit area.

  • Allow means a node that overlaps an enter/exit area (and is not part of the enter/exit subtree) doesn't affect the enter/exit area.

An example.
Parameters
event

- Pointer to the touch enter event.

See also:

touchExit

Since:

BlackBerry 10.0.0

void touchExit (

Emitted when touch leaves the enter/exit area of this node.

touchExit is not emitted when touch up happens on the enter/exit area, but only when touch moves out from the area.

See touchEnter for more information.

Parameters
event

- Pointer to the touch exit event.

See also:

touchEnter

Since:

BlackBerry 10.0.0

void touchPropagationModeChanged (

Emitted when the touch propagation mode of the visual node is changed.

This property controls how the visual node and its subtree partakes in touch event propagation. There are three possible modes, as defined by TouchPropagationMode::Type:

TouchPropagationMode::None can be used as an optimization if you have complex, non-interactive content, that overlaps interactive controls.

The default propagation mode is TouchPropagationMode::Full.

Since:

BlackBerry 10.0.0

Parameters
newTouchPropagationMode

The new touch propagation mode for the visual node.

Note:

Due to a work around for a Qt Core issue with accessing enums from QML the argument of this signal doesn't follow naming convention for signals in which the signal arguments are typically named to match the associated property's name. Use the object's property to access current property value instead of the signal argument to avoid runtime errors (i.e. use touchPropagationMode instead of newTouchPropagationMode).

Since:

BlackBerry 10.0.0

void translationXChanged (
  • floattranslationX)

Emitted after translationX of the visual node has changed.

The translationX and translationY correspond to pixels as long as the translationZ is 0.0.

The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any way.

See also:

Layout for more details.

Since:

BlackBerry 10.0.0

Parameters
translationX

The translation along the the x-axis (pointing towards right)

Since:

BlackBerry 10.0.0

void translationXChanging (
  • floattranslationX)

Emitted while translationX of the visual node is changing.

The translationX and translationY correspond to pixels as long as the translationZ is 0.0.

The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any way.

See also:

Layout for more details.

Since:

BlackBerry 10.0.0

Parameters
translationX

The new translation along the the x-axis (pointing towards right)

Since:

BlackBerry 10.0.0

void translationYChanged (
  • floattranslationY)

Emitted after translationY of the visual node has changed.

The translationX and translationY correspond to pixels as long as the translationZ is 0.0.

The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any way.

See also:

Layout for more details.

Since:

BlackBerry 10.0.0

Parameters
translationY

The new translation along the the y-axis (pointing downwards).

Since:

BlackBerry 10.0.0

void translationYChanging (
  • floattranslationY)

Emitted while translationY of the visual node is changing.

The translationX and translationY correspond to pixels as long as the translationZ is 0.0.

The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any way.

See also:

Layout for more details.

Since:

BlackBerry 10.0.0

Parameters
translationY

The new translation along the the y-axis (pointing downwards).

Since:

BlackBerry 10.0.0

void visibleChanged (
  • boolvisible)

Emitted when the visible property of the visual node is changed.

If the visible property is set to false, the visual node is neither laid out nor rendered. The default visible value is true.

Important: Setting the visible value to false is not the same as setting opacity to 0.0f (transparent). While a transparent node is still laid out taking up room in the scene, a node that is not visible, will neither be rendered nor laid out inside the scene. It will behave as if it was removed from the scene without actually been unlinked from the scene graph. No touch events will be sent to the node if the visible value is false. This a convenient way of removing nodes to optimize the performance of the scene without is actually unlinking them. It is highly recommended to use this property to hide visual nodes whenever possible.

Since:

BlackBerry 10.0.0

Parameters
visible

The new visible property set on the visual node.

Since:

BlackBerry 10.0.0

void creationCompleted ()Inherited

Emitted when this object is instantiated as a result of loading a QML document and creating the root node (only after the root component that caused this instantiation has completed construction), or when the object is being constructed from its builder class.

This signal indicates that the construction and initialization of the object has been completed, the properties are initialized, and any QML binding values have been assigned to the object.

This signal is not emitted when the object is constructed from C++ using the constructor. If the object is constructed using its builder class, the signal is emitted when the the builder class returns the fully constructed object.

This signal can be used when there is an activity that needs to be performed, such as a property state integrity verification after the object is instantiated from a QML document or a builder, but before control is returned to the application.

See also:

QmlDocument

Since:

BlackBerry 10.0.0

void objectNameChanged (Inherited

This signal is emitted when the objectName property is changed.

Since:

BlackBerry 10.0.0

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus