Navigation

Since: BlackBerry 10.3.1

#include <bb/cascades/Navigation>

Specifies trackpad navigation properties for a control, such as whether a control can get focus, and what the next controls in the navigation path are.


Overview

QML properties

defaultHighlightEnabled: bool
down: bb::cascades::Control
downAllowed: bool
focusPolicy: bb::cascades::NavigationFocusPolicy::Type
left: bb::cascades::Control
leftAllowed: bool
right: bb::cascades::Control
rightAllowed: bool
up: bb::cascades::Control
upAllowed: bool
wantsHighlight: bool [read-only]
attachedObjects: QDeclarativeListProperty< QObject > [read-only]Inherited
objectName: QStringInherited
parent: QObject [read-only]Inherited
ui: bb::cascades::UIConfig [read-only]Inherited

Public Functions Index

virtual ~Navigation ()
bb::cascades::Control *down () const
bb::cascades::NavigationFocusPolicy::TypefocusPolicy () const
boolisDefaultHighlightEnabled () const
boolisDownAllowed () const
boolisLeftAllowed () const
boolisRightAllowed () const
boolisUpAllowed () const
bb::cascades::Control *left () const
Q_SLOT voidresetDefaultHighlightEnabled ()
Q_SLOT voidresetDown ()
Q_SLOT voidresetDownAllowed ()
Q_SLOT voidresetFocusPolicy ()
Q_SLOT voidresetLeft ()
Q_SLOT voidresetLeftAllowed ()
Q_SLOT voidresetRight ()
Q_SLOT voidresetRightAllowed ()
Q_SLOT voidresetUp ()
Q_SLOT voidresetUpAllowed ()
bb::cascades::Control *right () const
Q_SLOT voidsetDefaultHighlightEnabled (bool enabled)
Q_SLOT voidsetDown (bb::cascades::Control *target)
Q_SLOT voidsetDownAllowed (bool allowed)
Q_SLOT voidsetFocusPolicy (bb::cascades::NavigationFocusPolicy::Type focusPolicy)
Q_SLOT voidsetLeft (bb::cascades::Control *target)
Q_SLOT voidsetLeftAllowed (bool allowed)
Q_SLOT voidsetRight (bb::cascades::Control *target)
Q_SLOT voidsetRightAllowed (bool allowed)
Q_SLOT voidsetUp (bb::cascades::Control *target)
Q_SLOT voidsetUpAllowed (bool allowed)
bb::cascades::Control *up () const
boolwantsHighlight () 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

voiddefaultHighlightEnabledChanged (bool enabled)
voiddownAllowedChanged (bool allowed)
voiddownChanged (bb::cascades::Control *target)
voidfocusPolicyChanged (bb::cascades::NavigationFocusPolicy::Type newFocusPolicy)
voidleftAllowedChanged (bool allowed)
voidleftChanged (bb::cascades::Control *target)
voidrightAllowedChanged (bool allowed)
voidrightChanged (bb::cascades::Control *target)
voidupAllowedChanged (bool allowed)
voidupChanged (bb::cascades::Control *target)
voidwantsHighlightChanged (bool wantsHighlight)
voidcreationCompleted ()Inherited
voidobjectNameChanged (const QString &objectName)Inherited

Properties

bool defaultHighlightEnabled

Specifies whether the control should show the default highlight when the control wants a navigation highlight.

Since:

BlackBerry 10.3.1

bb::cascades::Control down

Property for specifying which control should get focus when navigating down.

If the value is 0 the default navigation algorithm will be used.

The default value is 0.

Since:

BlackBerry 10.3.1

bool downAllowed

Property for specifying whether it should be possible to navigate down.

The default value is true.

Since:

BlackBerry 10.3.1

bb::cascades::NavigationFocusPolicy::Type focusPolicy

Specifies whether this control can get focus by navigating with the trackpad.

The default FocusPolicy value is Default. A disabled Control cannot have focus.

Since:

BlackBerry 10.3.1

bb::cascades::Control left

Property for specifying which control should get focus when navigating left.

If the value is 0 the default navigation algorithm will be used.

The default value is 0.

Since:

BlackBerry 10.3.1

bool leftAllowed

Property for specifying whether it should be possible to navigate left.

The default value is true.

Since:

BlackBerry 10.3.1

bb::cascades::Control right

Property for specifying which control should get focus when navigating right.

If the value is 0 the default navigation algorithm will be used.

The default value is 0.

Since:

BlackBerry 10.3.1

bool rightAllowed

Property for specifying whether it should be possible to navigate right.

The default value is true.

Since:

BlackBerry 10.3.1

bb::cascades::Control up

Property for specifying which control should get focus when navigating up.

If the value is 0 the default navigation algorithm will be used.

The default value is 0.

Since:

BlackBerry 10.3.1

bool upAllowed

Property for specifying whether it should be possible to navigate up.

The default value is true.

Since:

BlackBerry 10.3.1

bool wantsHighlight[read-only]

Read only property indicating whether the control wants a navigation highlight.

If defaultHighlightEnabled is true a default highlight will be shown when wantsHighlight is true.

Since:

BlackBerry 10.3.1

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

Destructor.

bb::cascades::Control * down ()

Gets the target of a down navigation from the control.

Ownership will not be transferred.

Return:

The target of a down navigation or 0 if the default navigation algorithm is used.

Since:

BlackBerry 10.3.1

bb::cascades::NavigationFocusPolicy::Type focusPolicy ()

Indicates whether this control can get focus by navigating with the trackpad.

Return:

The focus policy when navigating with the trackpad.

Since:

BlackBerry 10.3.1

bool isDefaultHighlightEnabled ()

Indicates whether the default highlight should be shown when wantsHighlight is true.

Return:

true if the default highlight is enabled, false otherwise.

Since:

BlackBerry 10.3.1

bool isDownAllowed ()

Indicates whether down navigation is allowed from the control.

Return:

true if down navigation is allowed, false otherwise.

Since:

BlackBerry 10.3.1

bool isLeftAllowed ()

Indicates whether left navigation is allowed from the control.

Return:

true if left navigation is allowed, false otherwise.

Since:

BlackBerry 10.3.1

bool isRightAllowed ()

Indicates whether right navigation is allowed from the control.

Return:

true if right navigation is allowed, false otherwise.

Since:

BlackBerry 10.3.1

bool isUpAllowed ()

Indicates whether up navigation is allowed from the control.

Return:

true if up navigation is allowed, false otherwise.

Since:

BlackBerry 10.3.1

bb::cascades::Control * left ()

Gets the target of a left navigation from the control.

Ownership will not be transferred.

Return:

The target of a left navigation or 0 if the default navigation algorithm is used.

Since:

BlackBerry 10.3.1

Q_SLOT void resetDefaultHighlightEnabled ()

Resets the defaultHighlightEnabled property to its default value.

Since:

BlackBerry 10.3.1

Q_SLOT void resetDown ()

Resets the target of a down navigation from the control to use the default navigation algorithm.

Ownership will not be transferred. If operation was successful, the downChanged() signal will be emitted.

Since:

BlackBerry 10.3.1

Q_SLOT void resetDownAllowed ()

Resets the downAllowed property to its default value.

Since:

BlackBerry 10.3.1

Q_SLOT void resetFocusPolicy ()

Resets the focusPolicy property to its default value.

Since:

BlackBerry 10.3.1

Q_SLOT void resetLeft ()

Resets the target of a left navigation from the control to use the default navigation algorithm.

Ownership will not be transferred. If operation was successful, the leftChanged() signal will be emitted.

Since:

BlackBerry 10.3.1

Q_SLOT void resetLeftAllowed ()

Resets the leftAllowed property to its default value.

Since:

BlackBerry 10.3.1

Q_SLOT void resetRight ()

Resets the target of a right navigation from the control to use the default navigation algorithm.

Ownership will not be transferred. If the operation is successful, the rightChanged() signal will be emitted.

Since:

BlackBerry 10.3.1

Q_SLOT void resetRightAllowed ()

Resets the rightAllowed property to its default value.

Since:

BlackBerry 10.3.1

Q_SLOT void resetUp ()

Resets the target of a up navigation from the control to use the default navigation algorithm.

Ownership will not be transferred. If operation was successful, the upChanged() signal will be emitted.

Since:

BlackBerry 10.3.1

Q_SLOT void resetUpAllowed ()

Resets the upAllowed property to its default value.

Since:

BlackBerry 10.3.1

bb::cascades::Control * right ()

Gets the target of a right navigation from the control.

Ownership will not be transferred.

Return:

The target of a right navigation or 0 if the default navigation algorithm is used.

Since:

BlackBerry 10.3.1

Q_SLOT void setDefaultHighlightEnabled (
  • boolenabled)

Sets whether the default highlight should be shown when wantsHighlight is true.

Parameters
enabled

true if the default highlight should be enabled, false otherwise.

Since:

BlackBerry 10.3.1

Q_SLOT void setDown (

Sets the target of a down navigation from the control.

Ownership will not be transferred. If operation was successful, the downChanged() signal will be emitted.

Parameters
target

The target of a down navigation. If target is 0 the default navigation algorithm will be used.

Since:

BlackBerry 10.3.1

Q_SLOT void setDownAllowed (
  • boolallowed)

Sets whether down navigation should be allowed from the control.

Parameters
allowed

true if down navigation is allowed, false otherwise.

Since:

BlackBerry 10.3.1

Q_SLOT void setFocusPolicy (

Sets whether this control can get focus by navigating with the trackpad.

Parameters
focusPolicy

The focus policy when navigating with the trackpad.

Since:

BlackBerry 10.3.1

Q_SLOT void setLeft (

Sets the target of a left navigation from the control.

Ownership will not be transferred. If operation was successful, the leftChanged() signal will be emitted.

Parameters
target

The target of a left navigation. If target is 0 the default navigation algorithm will be used.

Since:

BlackBerry 10.3.1

Q_SLOT void setLeftAllowed (
  • boolallowed)

Sets whether left navigation should be allowed from the control.

Parameters
allowed

true if left navigation is allowed, false otherwise.

Since:

BlackBerry 10.3.1

Q_SLOT void setRight (

Sets the target of a right navigation from the control.

Ownership will not be transferred. If the operation is successful, the rightChanged() signal will be emitted.

Parameters
target

The target of a right navigation. If target is 0 the default navigation algorithm will be used.

Since:

BlackBerry 10.3.1

Q_SLOT void setRightAllowed (
  • boolallowed)

Controls whether right navigation should be allowed from the control.

Parameters
allowed

true if right navigation is allowed, false otherwise.

Since:

BlackBerry 10.3.1

Q_SLOT void setUp (

Sets the target of a up navigation from the control.

Ownership will not be transferred. If operation was successful, the upChanged() signal will be emitted.

Parameters
target

The target of a up navigation. If target is 0 the default navigation algorithm will be used.

Since:

BlackBerry 10.3.1

Q_SLOT void setUpAllowed (
  • boolallowed)

Controls whether up navigation should be allowed from the control.

Parameters
allowed

true if up navigation is allowed, false otherwise.

Since:

BlackBerry 10.3.1

bb::cascades::Control * up ()

Gets the target of an up navigation from the control.

Ownership will not be transferred.

Return:

The target of a up navigation or 0 if the default navigation algorithm is used.

Since:

BlackBerry 10.3.1

bool wantsHighlight ()

Indicates whether the control wants a navigation highlight.

Return:

true if the control expects a highlight to be shown, false otherwise.

Since:

BlackBerry 10.3.1

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 defaultHighlightEnabledChanged (
  • boolenabled)

Emitted when the defaultHighlightEnabled property has changed.

Parameters
enabled

true if the default highlight is enabled, false otherwise.

Since:

BlackBerry 10.3.1

void downAllowedChanged (
  • boolallowed)

Emitted when the downAllowed property has changed.

Parameters
allowed

If true down navigation is allowed, if false down navigation is not allowed.

Since:

BlackBerry 10.3.1

void downChanged (

Emitted when the target of down navigation has changed.

Parameters
target

The new target of a down navigation.

Since:

BlackBerry 10.3.1

void focusPolicyChanged (

Emitted when the focusPolicy property has changed.

Parameters
newFocusPolicy

The focus policy when navigating with the trackpad.

Since:

BlackBerry 10.3.1

void leftAllowedChanged (
  • boolallowed)

Emitted when the leftAllowed property has changed.

Parameters
allowed

If true left navigation is allowed, if false left navigation is not allowed.

Since:

BlackBerry 10.3.1

void leftChanged (

Emitted when the target of left navigations has changed.

Parameters
target

The new target of a left navigation.

Since:

BlackBerry 10.3.1

void rightAllowedChanged (
  • boolallowed)

Emitted when the rightAllowed property has changed.

Parameters
allowed

If true right navigation is allowed, if false right navigation is not allowed.

Since:

BlackBerry 10.3.1

void rightChanged (

Emitted when the target of right navigation has changed.

Parameters
target

The new target of a right navigation.

Since:

BlackBerry 10.3.1

void upAllowedChanged (
  • boolallowed)

Emitted when the upAllowed property has changed.

Parameters
allowed

If true up navigation is allowed, if false up navigation is not allowed.

Since:

BlackBerry 10.3.1

void upChanged (

Emitted when the target of up navigation has changed.

Parameters
target

The new target of an up navigation.

Since:

BlackBerry 10.3.1

void wantsHighlightChanged (
  • boolwantsHighlight)

Emitted when the wantsHighlight property has changed.

Parameters
wantsHighlight

true if the control expects a highlight to be shown, false otherwise.

Since:

BlackBerry 10.3.1

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: 2015-03-26



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

comments powered by Disqus