DateTimePicker

Since: BlackBerry 10.0.0

#include <bb/cascades/DateTimePicker>

A control for selecting a date or time.

Example of what the DateTimePicker looks like
There are several modes that you can use with DateTimePicker, which are included in the DateTimePickerMode class:
  • Time: Shows two columns with hours and minutes.

  • Date: Shows three columns with day, month and year. (Default)

  • DateTime: Shows three columns with day, hours and minutes.

  • Timer: Shows three columns with hours (in 0 to 23 hour range), minutes and seconds.

To select a date and time create a QDateTime object with the specific date and time and use DateTimePicker.setValue().

In QML the DateTimePicker supports different date and time types when selecting the date and time:
  • date ("YYYY-MM-DD")

  • date and time ("YYYY-MM-DDTHH:MM:SS")

  • JavaScript Date object

When using the Time mode, a convenience function called dateFromTime() can be used to convert the time value to the correct format.

QML Examples

Here's an example of how to use the DateTimePicker in Date mode (the default mode):

Container {
    DateTimePicker {
        id: picker1
        title: "DateQml"
        value: "1980-04-15"
    }
}
With DateTime mode:
Container {
    DateTimePicker {
        id: picker2
        title: "DateTimeQml"
        mode: DateTimePickerMode.DateTime
        value: "1980-04-15T10:11:00"
    }
}
With Time mode, using dateFromTime():
Container {
    DateTimePicker {
        id: picker3
        title: "TimeQml"
        mode: DateTimePickerMode.Time
        value: picker.dateFromTime("10:11:00")
    }
}
With Timer mode, selecting first row in each column:
Container {
    DateTimePicker {
        id: picker4
        title: "TimerQml"
        mode: DateTimePickerMode.Timer
        value: picker.dateFromTime("00:00:00")
    }
}
Here's how to use a JavaScript Date object as the current date and time:
Container {
    DateTimePicker {
        id: picker5
        title: "DateTimeQml"
        mode: DateTimePickerMode.DateTime
        value: { new Date(); }
    }
}

C++ examples

Here's how to use the DateTimePicker in Date mode (the default mode):

DateTimePicker *dateTimePicker1 = DateTimePicker::create()
    .title("Date")
    .value(QDateTime(QDate(1980, 4, 15)));
With DateTime mode, using current date and time as selection:
DateTimePicker *dateTimePicker2 = DateTimePicker::create()
    .title("DateTime")
    .mode(DateTimePickerMode::DateTime);
With Time mode, using the convenience function dateFromTime() to set time 11:10 as the selection:
DateTimePicker *dateTimePicker3 = DateTimePicker::create()
    .title("Time")
    .mode(DateTimePickerMode::Time);
dateTimePicker3->setValue(dateTimePicker3->dateFromTime(QTime(11,10)));
With Timer mode, selecting first row in each column:
DateTimePicker *dateTimePicker4 = DateTimePicker::create()
    .title("Timer")
    .mode(DateTimePickerMode::Timer)
    .value(QDateTime(QDate::currentDate(), QTime(0, 0, 0)));


Overview

QML properties

expanded: bool
maximum: QDateTime
minimum: QDateTime
minuteInterval: int
mode: bb::cascades::DateTimePickerMode::Type
title: QString
value: QDateTime
accessibility: bb::cascades::AbstractA11yObject [read-only]Inherited
accessibilityMode: bb::cascades::A11yMode::TypeInherited
attachedObjects: QDeclarativeListProperty< QObject > [read-only]Inherited
keyListeners: QDeclarativeListProperty [read-only]Inherited
bottomMargin: floatInherited
bottomMarginSet: bool [read-only]Inherited
bottomPadding: floatInherited
builtInShortcutsEnabled: boolInherited
contextMenuHandler: bb::cascades::ContextMenuHandlerInherited
enabled: boolInherited
focusAutoShow: bb::cascades::FocusAutoShow::TypeInherited
focused: bool [read-only]Inherited
focusPolicy: bb::cascades::FocusPolicy::TypeInherited
focusRetentionPolicyFlags: bb::cascades::FocusRetentionPolicy::TypesInherited
horizontalAlignment: bb::cascades::HorizontalAlignment::TypeInherited
implicitLayoutAnimationsEnabled: boolInherited
inputRoute: bb::cascades::InputRouteProperties [read-only]Inherited
layoutProperties: bb::cascades::LayoutPropertiesInherited
leftMargin: floatInherited
leftMarginSet: bool [read-only]Inherited
leftPadding: floatInherited
locallyFocused: boolInherited
margin: bb::cascades::Spacings [read-only]Inherited
maxHeight: floatInherited
maxWidth: floatInherited
minHeight: floatInherited
minWidth: floatInherited
navigation: bb::cascades::Navigation [read-only]Inherited
objectName: QStringInherited
opacity: floatInherited
overlapTouchPolicy: bb::cascades::OverlapTouchPolicy::TypeInherited
parent: QObject [read-only]Inherited
pivotX: floatInherited
pivotY: floatInherited
preferredHeight: floatInherited
preferredHeightSet: bool [read-only]Inherited
preferredWidth: floatInherited
preferredWidthSet: bool [read-only]Inherited
rightMargin: floatInherited
rightMarginSet: bool [read-only]Inherited
rightPadding: floatInherited
rotationZ: floatInherited
scaleX: floatInherited
scaleY: floatInherited
topMargin: floatInherited
topMarginSet: bool [read-only]Inherited
topPadding: floatInherited
touchPropagationMode: bb::cascades::TouchPropagationMode::TypeInherited
translationX: floatInherited
translationY: floatInherited
ui: bb::cascades::UIConfig [read-only]Inherited
verticalAlignment: bb::cascades::VerticalAlignment::TypeInherited
visible: boolInherited

QML signals

onExpandedChanged: {}
onMaximumChanged: {}
onMinimumChanged: {}
onMinuteIntervalChanged: {}
onModeChanged: {}
onTitleChanged: {}
onValueChanged: {}
onAccessibilityModeChangedInherited: {}
onActionSetAddedInherited: {}
onActionSetRemovedInherited: {}
onBottomMarginChangedInherited: {}
onBottomMarginSetChangedInherited: {}
onBottomPaddingChangedInherited: {}
onBuiltInShortcutsEnabledChangedInherited: {}
onContextMenuHandlerChangedInherited: {}
onCreationCompletedInherited: {}
onEnabledChangedInherited: {}
onFocusAutoShowChangedInherited: {}
onFocusedChangedInherited: {}
onFocusPolicyChangedInherited: {}
onFocusRetentionPolicyFlagsChangedInherited: {}
onHorizontalAlignmentChangedInherited: {}
onImplicitLayoutAnimationsEnabledChangedInherited: {}
onLayoutPropertiesChangedInherited: {}
onLeftMarginChangedInherited: {}
onLeftMarginSetChangedInherited: {}
onLeftPaddingChangedInherited: {}
onLocallyFocusedChangedInherited: {}
onMaxHeightChangedInherited: {}
onMaxWidthChangedInherited: {}
onMinHeightChangedInherited: {}
onMinWidthChangedInherited: {}
onObjectNameChangedInherited: {}
onOpacityChangedInherited: {}
onOpacityChangingInherited: {}
onOverlapTouchPolicyChangedInherited: {}
onPivotXChangedInherited: {}
onPivotYChangedInherited: {}
onPreferredHeightChangedInherited: {}
onPreferredHeightSetChangedInherited: {}
onPreferredWidthChangedInherited: {}
onPreferredWidthSetChangedInherited: {}
onRightMarginChangedInherited: {}
onRightMarginSetChangedInherited: {}
onRightPaddingChangedInherited: {}
onRotationZChangedInherited: {}
onRotationZChangingInherited: {}
onScaleXChangedInherited: {}
onScaleXChangingInherited: {}
onScaleYChangedInherited: {}
onScaleYChangingInherited: {}
onTopMarginChangedInherited: {}
onTopMarginSetChangedInherited: {}
onTopPaddingChangedInherited: {}
onTouchInherited: {}
onTouchCaptureInherited: {}
onTouchEnterInherited: {}
onTouchExitInherited: {}
onTouchPropagationModeChangedInherited: {}
onTranslationXChangedInherited: {}
onTranslationXChangingInherited: {}
onTranslationYChangedInherited: {}
onTranslationYChangingInherited: {}
onVerticalAlignmentChangedInherited: {}
onVisibleChangedInherited: {}

Properties Index

boolexpanded
QDateTimemaximum
QDateTimeminimum
intminuteInterval
bb::cascades::DateTimePickerMode::Typemode
QStringtitle
QDateTimevalue
bb::cascades::AbstractA11yObjectaccessibility [read-only]Inherited
bb::cascades::A11yMode::TypeaccessibilityModeInherited
QDeclarativeListProperty< QObject >attachedObjects [read-only]Inherited
QDeclarativeListPropertykeyListeners [read-only]Inherited
floatbottomMarginInherited
boolbottomMarginSet [read-only]Inherited
floatbottomPaddingInherited
boolbuiltInShortcutsEnabledInherited
bb::cascades::ContextMenuHandlercontextMenuHandlerInherited
boolenabledInherited
bb::cascades::FocusAutoShow::TypefocusAutoShowInherited
boolfocused [read-only]Inherited
bb::cascades::FocusPolicy::TypefocusPolicyInherited
bb::cascades::FocusRetentionPolicy::TypesfocusRetentionPolicyFlagsInherited
bb::cascades::HorizontalAlignment::TypehorizontalAlignmentInherited
boolimplicitLayoutAnimationsEnabledInherited
bb::cascades::InputRoutePropertiesinputRoute [read-only]Inherited
bb::cascades::LayoutPropertieslayoutPropertiesInherited
floatleftMarginInherited
boolleftMarginSet [read-only]Inherited
floatleftPaddingInherited
boollocallyFocusedInherited
bb::cascades::Spacingsmargin [read-only]Inherited
floatmaxHeightInherited
floatmaxWidthInherited
floatminHeightInherited
floatminWidthInherited
bb::cascades::Navigationnavigation [read-only]Inherited
QStringobjectNameInherited
floatopacityInherited
bb::cascades::OverlapTouchPolicy::TypeoverlapTouchPolicyInherited
QObjectparent [read-only]Inherited
floatpivotXInherited
floatpivotYInherited
floatpreferredHeightInherited
boolpreferredHeightSet [read-only]Inherited
floatpreferredWidthInherited
boolpreferredWidthSet [read-only]Inherited
floatrightMarginInherited
boolrightMarginSet [read-only]Inherited
floatrightPaddingInherited
floatrotationZInherited
floatscaleXInherited
floatscaleYInherited
floattopMarginInherited
booltopMarginSet [read-only]Inherited
floattopPaddingInherited
bb::cascades::TouchPropagationMode::TypetouchPropagationModeInherited
floattranslationXInherited
floattranslationYInherited
bb::cascades::UIConfigui [read-only]Inherited
bb::cascades::VerticalAlignment::TypeverticalAlignmentInherited
boolvisibleInherited

Public Functions Index

DateTimePicker (Container *parent=0, bb::cascades::DateTimePickerMode::Type mode=bb::cascades::DateTimePickerMode::Date)
virtual ~DateTimePicker ()
Q_INVOKABLE QDateTimedateFromTime (const QTime &time)
boolisExpanded () const
QDateTimemaximum () const
QDateTimeminimum () const
intminuteInterval () const
bb::cascades::DateTimePickerMode::Typemode () const
Q_SLOT voidresetExpanded ()
Q_SLOT voidresetMaximum ()
Q_SLOT voidresetMinimum ()
Q_SLOT voidresetMinuteInterval ()
Q_SLOT voidresetMode ()
Q_SLOT voidresetTitle ()
Q_SLOT voidresetValue ()
Q_SLOT voidsetExpanded (bool expanded)
Q_SLOT voidsetMaximum (const QDateTime &value)
Q_SLOT voidsetMinimum (const QDateTime &value)
Q_SLOT voidsetMinuteInterval (int minuteInterval)
Q_SLOT voidsetMode (bb::cascades::DateTimePickerMode::Type mode)
Q_SLOT voidsetTitle (const QString &title)
Q_SLOT voidsetValue (const QDateTime &value)
QStringtitle () const
QDateTimevalue () const
bb::cascades::AbstractA11yObject *accessibility () const Inherited
bb::cascades::A11yMode::TypeaccessibilityMode () const Inherited
ActionSet *actionSetAt (int index) const Inherited
intactionSetCount () const Inherited
voidaddActionSet (bb::cascades::ActionSet *actionSet)Inherited
voidaddAnimation (AbstractAnimation *animation)Inherited
Q_INVOKABLE voidaddEffect (bb::cascades::AbstractEffect *effect)Inherited
voidaddEventHandler (AbstractEventHandler *eventHandler)Inherited
voidaddGestureHandler (GestureHandler *gestureHandler)Inherited
Q_INVOKABLE voidaddKeyListener (bb::cascades::KeyListener *keyListener)Inherited
Q_INVOKABLE voidaddShortcut (bb::cascades::AbstractShortcut *shortcut)Inherited
voidaddTouchBehavior (TouchBehavior *touchBehavior)Inherited
AbstractAnimation *animationAt (int index) const Inherited
intanimationCount () const Inherited
floatbottomMargin () const Inherited
floatbottomPadding () const Inherited
Q_INVOKABLE boolbuiltInShortcutsEnabled () const Inherited
bb::cascades::ContextMenuHandler *contextMenuHandler () const Inherited
Q_INVOKABLE voiddisableAllShortcuts ()Inherited
Q_INVOKABLE voidenableAllShortcuts ()Inherited
virtual boolevent (QEvent *event)Inherited
bb::cascades::FocusAutoShow::TypefocusAutoShow () const Inherited
bb::cascades::FocusPolicy::TypefocusPolicy () const Inherited
bb::cascades::FocusRetentionPolicy::TypesfocusRetentionPolicyFlags ()Inherited
bb::cascades::HorizontalAlignment::TypehorizontalAlignment () const Inherited
boolimplicitLayoutAnimationsEnabled () const Inherited
bb::cascades::InputRouteProperties *inputRoute () const Inherited
boolisBottomMarginSet () const Inherited
boolisEnabled () const Inherited
boolisFocused () const Inherited
boolisLeftMarginSet () const Inherited
boolisLocallyFocused () const Inherited
boolisPreferredHeightSet () const Inherited
boolisPreferredWidthSet () const Inherited
boolisRightMarginSet () const Inherited
boolisTopMarginSet () const Inherited
boolisVisible () const Inherited
Q_INVOKABLE bb::cascades::KeyListener *keyListenerAt (int index) const Inherited
Q_INVOKABLE intkeyListenerCount () const Inherited
bb::cascades::LayoutProperties *layoutProperties () const Inherited
floatleftMargin () const Inherited
floatleftPadding () const Inherited
Q_SLOT voidloseFocus ()Inherited
bb::cascades::Spacings *margin ()Inherited
floatmaxHeight () const Inherited
floatmaxWidth () const Inherited
floatminHeight () const Inherited
floatminWidth () const Inherited
bb::cascades::Navigation *navigation () const Inherited
floatopacity () const Inherited
bb::cascades::OverlapTouchPolicy::TypeoverlapTouchPolicy () const Inherited
floatpivotX () const Inherited
floatpivotY () const Inherited
floatpreferredHeight () const Inherited
floatpreferredWidth () const Inherited
boolremoveActionSet (bb::cascades::ActionSet *actionSet)Inherited
voidremoveAllActionSets ()Inherited
voidremoveAllAnimations ()Inherited
voidremoveAllEventHandlers ()Inherited
voidremoveAllGestureHandlers ()Inherited
Q_INVOKABLE voidremoveAllKeyListeners ()Inherited
Q_INVOKABLE voidremoveAllShortcuts ()Inherited
voidremoveAllTouchBehaviors ()Inherited
boolremoveAnimation (AbstractAnimation *animation)Inherited
Q_INVOKABLE voidremoveEffect (bb::cascades::AbstractEffect *effect)Inherited
boolremoveEventHandler (AbstractEventHandler *eventHandler)Inherited
boolremoveGestureHandler (GestureHandler *gestureHandler)Inherited
Q_INVOKABLE boolremoveKeyListener (bb::cascades::KeyListener *keyListener)Inherited
Q_INVOKABLE boolremoveShortcut (bb::cascades::AbstractShortcut *shortcut)Inherited
boolremoveTouchBehavior (TouchBehavior *touchBehavior)Inherited
Q_SLOT voidrequestFocus ()Inherited
Q_SLOT voidresetAccessibilityMode ()Inherited
Q_SLOT voidresetBottomMargin ()Inherited
Q_SLOT voidresetBottomPadding ()Inherited
Q_INVOKABLE voidresetBuiltInShortcutsEnabled ()Inherited
Q_SLOT voidresetContextMenuHandler ()Inherited
Q_SLOT voidresetEnabled ()Inherited
Q_SLOT voidresetFocusAutoShow ()Inherited
Q_SLOT voidresetFocusPolicy ()Inherited
Q_SLOT voidresetFocusRetentionPolicyFlags ()Inherited
Q_SLOT voidresetHorizontalAlignment ()Inherited
Q_SLOT voidresetImplicitLayoutAnimationsEnabled ()Inherited
Q_SLOT voidresetLayoutProperties ()Inherited
Q_SLOT voidresetLeftMargin ()Inherited
Q_SLOT voidresetLeftPadding ()Inherited
Q_SLOT voidresetLocallyFocused ()Inherited
Q_SLOT voidresetMaxHeight ()Inherited
Q_SLOT voidresetMaxWidth ()Inherited
Q_SLOT voidresetMinHeight ()Inherited
Q_SLOT voidresetMinWidth ()Inherited
Q_SLOT voidresetOpacity ()Inherited
Q_SLOT voidresetOverlapTouchPolicy ()Inherited
Q_SLOT voidresetPivot ()Inherited
Q_SLOT voidresetPivotX ()Inherited
Q_SLOT voidresetPivotY ()Inherited
Q_SLOT voidresetPreferredHeight ()Inherited
Q_SLOT voidresetPreferredSize ()Inherited
Q_SLOT voidresetPreferredWidth ()Inherited
Q_SLOT voidresetRightMargin ()Inherited
Q_SLOT voidresetRightPadding ()Inherited
Q_SLOT voidresetRotationZ ()Inherited
Q_SLOT voidresetScale ()Inherited
Q_SLOT voidresetScaleX ()Inherited
Q_SLOT voidresetScaleY ()Inherited
Q_SLOT voidresetTopMargin ()Inherited
Q_SLOT voidresetTopPadding ()Inherited
Q_SLOT voidresetTouchPropagationMode ()Inherited
Q_SLOT voidresetTranslation ()Inherited
Q_SLOT voidresetTranslationX ()Inherited
Q_SLOT voidresetTranslationY ()Inherited
Q_SLOT voidresetVerticalAlignment ()Inherited
Q_SLOT voidresetVisible ()Inherited
floatrightMargin () const Inherited
floatrightPadding () const Inherited
floatrotationZ () const Inherited
floatscaleX () const Inherited
floatscaleY () const Inherited
Q_SLOT voidsetAccessibilityMode (bb::cascades::A11yMode::Type accessibilityMode)Inherited
Q_SLOT voidsetBottomMargin (float bottomMargin)Inherited
Q_SLOT voidsetBottomPadding (float bottomPadding)Inherited
Q_INVOKABLE voidsetBuiltInShortcutEnabled (bb::cascades::SystemShortcuts::Type type, bool enabled)Inherited
Q_SLOT voidsetBuiltInShortcutsEnabled (bool enabled)Inherited
voidsetContextMenuHandler (bb::cascades::ContextMenuHandler *contextMenuHandler)Inherited
Q_SLOT voidsetEnabled (bool enabled)Inherited
Q_SLOT voidsetFocusAutoShow (const bb::cascades::FocusAutoShow::Type focusAutoShow)Inherited
Q_SLOT voidsetFocusPolicy (const bb::cascades::FocusPolicy::Type focusPolicy)Inherited
Q_SLOT voidsetFocusRetentionPolicyFlags (bb::cascades::FocusRetentionPolicy::Types policy)Inherited
Q_SLOT voidsetHorizontalAlignment (bb::cascades::HorizontalAlignment::Type horizontalAlignment)Inherited
Q_SLOT voidsetImplicitLayoutAnimationsEnabled (bool enable)Inherited
Q_SLOT voidsetLayoutProperties (bb::cascades::LayoutProperties *layoutProperties)Inherited
Q_SLOT voidsetLeftMargin (float leftMargin)Inherited
Q_SLOT voidsetLeftPadding (float leftPadding)Inherited
Q_SLOT voidsetLocallyFocused (bool locallyFocused)Inherited
Q_SLOT voidsetMaxHeight (float maxHeight)Inherited
Q_SLOT voidsetMaxWidth (float maxWidth)Inherited
Q_SLOT voidsetMinHeight (float minHeight)Inherited
Q_SLOT voidsetMinWidth (float minWidth)Inherited
voidsetObjectName (const QString &name)Inherited
Q_SLOT voidsetOpacity (float opacity)Inherited
Q_SLOT voidsetOverlapTouchPolicy (bb::cascades::OverlapTouchPolicy::Type policy)Inherited
Q_SLOT voidsetPivot (float pivotX, float pivotY)Inherited
Q_SLOT voidsetPivotX (float pivotX)Inherited
Q_SLOT voidsetPivotY (float pivotY)Inherited
Q_SLOT voidsetPreferredHeight (float preferredHeight)Inherited
Q_SLOT voidsetPreferredSize (float preferredWidth, float preferredHeight)Inherited
Q_SLOT voidsetPreferredWidth (float preferredWidth)Inherited
Q_SLOT voidsetRightMargin (float rightMargin)Inherited
Q_SLOT voidsetRightPadding (float rightPadding)Inherited
Q_SLOT voidsetRotationZ (float rotationZ)Inherited
Q_SLOT voidsetScale (float scaleX, float scaleY)Inherited
Q_SLOT voidsetScale (float scaleXY)Inherited
Q_SLOT voidsetScaleX (float scaleX)Inherited
Q_SLOT voidsetScaleY (float scaleY)Inherited
Q_SLOT voidsetTopMargin (float topMargin)Inherited
Q_SLOT voidsetTopPadding (float topPadding)Inherited
Q_SLOT voidsetTouchPropagationMode (bb::cascades::TouchPropagationMode::Type mode)Inherited
Q_SLOT voidsetTranslation (float translationX, float translationY)Inherited
Q_SLOT voidsetTranslationX (float translationX)Inherited
Q_SLOT voidsetTranslationY (float translationY)Inherited
Q_SLOT voidsetVerticalAlignment (bb::cascades::VerticalAlignment::Type verticalAlignment)Inherited
Q_SLOT voidsetVisible (bool visible)Inherited
Q_INVOKABLE bb::cascades::AbstractShortcut *shortcutAt (int index) const Inherited
Q_INVOKABLE intshortcutCount () const Inherited
virtual Q_INVOKABLE QStringtoDebugString () const Inherited
floattopMargin () const Inherited
floattopPadding () const Inherited
TouchPropagationMode::TypetouchPropagationMode () const Inherited
floattranslationX () const Inherited
floattranslationY () const Inherited
Q_INVOKABLE bb::cascades::UIConfig *ui () const Inherited
bb::cascades::VerticalAlignment::TypeverticalAlignment () const Inherited

Static Public Functions Index

Buildercreate ()

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

voidexpandedChanged (bool expanded)
voidmaximumChanged (QDateTime value)
voidminimumChanged (QDateTime value)
voidminuteIntervalChanged (int minuteInterval)
voidmodeChanged (bb::cascades::DateTimePickerMode::Type newMode)
voidtitleChanged (QString title)
voidvalueChanged (QDateTime value)
voidaccessibilityModeChanged (bb::cascades::A11yMode::Type newAccessibilityMode)Inherited
voidactionSetAdded (bb::cascades::ActionSet *actionSet)Inherited
voidactionSetRemoved (bb::cascades::ActionSet *actionSet)Inherited
voidbottomMarginChanged (float bottomMargin)Inherited
voidbottomMarginSetChanged (bool isSet)Inherited
voidbottomPaddingChanged (float bottomPadding)Inherited
voidbuiltInShortcutsEnabledChanged (bool builtInShortcutsEnabled)Inherited
voidcontextMenuHandlerChanged (bb::cascades::ContextMenuHandler *contextMenuHandler)Inherited
voidcreationCompleted ()Inherited
voidenabledChanged (bool enabled)Inherited
voidfocusAutoShowChanged (bb::cascades::FocusAutoShow::Type newFocusAutoShow)Inherited
voidfocusedChanged (bool focused)Inherited
voidfocusPolicyChanged (bb::cascades::FocusPolicy::Type newFocusPolicy)Inherited
voidfocusRetentionPolicyFlagsChanged (bb::cascades::FocusRetentionPolicy::Types policy)Inherited
voidhorizontalAlignmentChanged (bb::cascades::HorizontalAlignment::Type newHorizontalAlignment)Inherited
voidimplicitLayoutAnimationsEnabledChanged (bool implicitLayoutAnimationsEnabled)Inherited
voidlayoutPropertiesChanged (bb::cascades::LayoutProperties *layoutProperties)Inherited
voidleftMarginChanged (float leftMargin)Inherited
voidleftMarginSetChanged (bool isSet)Inherited
voidleftPaddingChanged (float leftPadding)Inherited
voidlocallyFocusedChanged (bool newLocallyFocused)Inherited
voidmaxHeightChanged (float maxHeight)Inherited
voidmaxWidthChanged (float maxWidth)Inherited
voidminHeightChanged (float minHeight)Inherited
voidminWidthChanged (float minWidth)Inherited
voidobjectNameChanged (const QString &objectName)Inherited
voidopacityChanged (float opacity)Inherited
voidopacityChanging (float opacity)Inherited
voidoverlapTouchPolicyChanged (bb::cascades::OverlapTouchPolicy::Type newOverlapTouchPolicy)Inherited
voidpivotXChanged (float pivotX)Inherited
voidpivotYChanged (float pivotY)Inherited
voidpreferredHeightChanged (float preferredHeight)Inherited
voidpreferredHeightSetChanged (bool isSet)Inherited
voidpreferredWidthChanged (float preferredWidth)Inherited
voidpreferredWidthSetChanged (bool isSet)Inherited
voidrightMarginChanged (float rightMargin)Inherited
voidrightMarginSetChanged (bool isSet)Inherited
voidrightPaddingChanged (float rightPadding)Inherited
voidrotationZChanged (float rotationZ)Inherited
voidrotationZChanging (float rotationZ)Inherited
voidscaleXChanged (float scaleX)Inherited
voidscaleXChanging (float scaleX)Inherited
voidscaleYChanged (float scaleY)Inherited
voidscaleYChanging (float scaleY)Inherited
voidtopMarginChanged (float topMargin)Inherited
voidtopMarginSetChanged (bool isSet)Inherited
voidtopPaddingChanged (float topPadding)Inherited
voidtouch (bb::cascades::TouchEvent *event)Inherited
voidtouchCapture (bb::cascades::TouchEvent *event)Inherited
voidtouchEnter (bb::cascades::TouchEnterEvent *event)Inherited
voidtouchExit (bb::cascades::TouchExitEvent *event)Inherited
voidtouchPropagationModeChanged (bb::cascades::TouchPropagationMode::Type newTouchPropagationMode)Inherited
voidtranslationXChanged (float translationX)Inherited
voidtranslationXChanging (float translationX)Inherited
voidtranslationYChanged (float translationY)Inherited
voidtranslationYChanging (float translationY)Inherited
voidverticalAlignmentChanged (bb::cascades::VerticalAlignment::Type newVerticalAlignment)Inherited
voidvisibleChanged (bool visible)Inherited

Properties

bool expanded

The expanded state as a boolean.

Since:

BlackBerry 10.0.0

QDateTime maximum

The maximum date and time value that can be selected.

If the selected value is outside of the maximum range the value will be clamped to either the maximum or minimum value.

By default the maximum value is not set.

Since:

BlackBerry 10.0.0

QDateTime minimum

The minimum date and time value that can be selected.

If the selected value is outside of the minimum range the value will be clamped to either the maximum or minimum value.

By default the minimum value is not set.

Since:

BlackBerry 10.0.0

int minuteInterval

The increment interval of the minutes.

Valid intervals are 1, 5, 10 or 15. Default is 5.

Since:

BlackBerry 10.0.0

bb::cascades::DateTimePickerMode::Type mode

The mode of the DateTimePicker.

This setting determines what type of data is presented in the picker is used, and it can be changed at runtime. The default mode is DateTimePickerMode::Date.
Since:

BlackBerry 10.0.0

QString title

The title of the DateTimePicker.

Since:

BlackBerry 10.0.0

QDateTime value

The date and time value that is selected.

The default value is the current date and time when the DateTimePicker is created.

Since:

BlackBerry 10.0.0

bb::cascades::AbstractA11yObject accessibilityInherited[read-only]

Defines the control's accessibility object.

Since:

BlackBerry 10.2.0

bb::cascades::A11yMode::Type accessibilityModeInherited

The accessibility mode for the control.

This property defines how the control and its subtree will be exposed to assistive technologies. The default value is Default which means that the framework automates accessibility mode based on accessible information and context. Typically accessibility information is assumed to be available, unless any parent is configured with accessibilityMode = Collapsed.

When accessibility information is available, the accessibility property will be used to define the accessibility properties.

See also:

accessibility

Since:

BlackBerry 10.2.0

QDeclarativeListProperty< QObject > attachedObjectsInherited[read-only]

A hierarchical list of the UIObject's attached objects.

Since:

BlackBerry 10.0.0

QDeclarativeListProperty keyListenersInherited[read-only]

A list of ActionSet object that are displayed in the control's context menu.

A list of key listeners attached to this control.

A list of shortcuts that can be triggered via user actions.

These action sets are displayed in the Context Menu for this control. When the context menu is opened, the first ActionSet object in the list is displayed initially, and the user can cycle through them in the order that they are added to the control.

See also:

ActionSet

Since:

BlackBerry 10.0.0

The order in which they are added will determine which shortcut will be triggered in case of an overlap. Note that predefined shortcuts have precedence over shortcuts defined via QString in case of a collision
Since:

BlackBerry 10.1.0

The order in which key listeners are added does not change their behavior
See also:

KeyListener

Since:

BlackBerry 10.1.0

float bottomMarginInherited

The bottom margin for the control.

Margins are positive values that specify the space around a control.

How the margin is actually used depends on how the control is laid out within it's parent container. When the control is laid out in a StackLayout, the margin is considered between the siblings in the layout direction. In that case the distance between two children in the layout direction will be the largest margin of the two adjacent margins in the layout direction.

Since:

BlackBerry 10.0.0

bool bottomMarginSetInherited[read-only]

Indicates whether the bottomMargin of a control is set.

If true the bottom Margin has been set on a control, if false the bottomMargin is not set. By default, bottomMargin is false, meaning that the control will use control-specific default

Since:

BlackBerry 10.0.0

float bottomPaddingInherited

The bottom padding for the control.

The default bottom padding is 0.

Bottom padding only works for the following controls, for all other controls bottom padding is undefined:

Negative padding values are supported in the ListView control, for all other controls negative padding is undefined.

Since:

BlackBerry 10.0.0

bool builtInShortcutsEnabledInherited

Enables or disables all Control's built-in shortcuts.

This property is used when all Control's built-in shortcuts should be enabled or disabled. Cotrol's built-in shortcuts are shortcuts like Navigation shortcuts in ScrollView and ListView.

Since:

BlackBerry 10.2.0

bb::cascades::ContextMenuHandler contextMenuHandlerInherited

The handler for interacting with the Context menu for this Control.

Setting this handler allows you to listen on events from the Context menu. For example the ContextMenuHandler::showing() signal is emitted when the Context menu is about to show, allowing you to update the content of your context actions just-in-time.

See also:

#contextActions, ContextMenuHandler::showing()

The default value is @0, indicating no ContextMenuHandler is set.
Since:

BlackBerry 10.0.0

bool enabledInherited

Indicates whether the control is enabled.

When a control is disabled, it does not respond to user input. The disabled control continues to receive events, but does not process them. Changing the enabled state may also affect the appearance of the control.

If true the control is enabled, if false it's disabled.

Since:

BlackBerry 10.0.0

bb::cascades::FocusAutoShow::Type focusAutoShowInherited

Indicates whether a control should automatically be made visible when it receives focus.

The default focusAutoShow value is Default.

Since:

BlackBerry 10.0.0

bool focusedInherited[read-only]

Indicates whether the control is focused.

If true the control is focused, if false it's not focused.

Since:

BlackBerry 10.0.0

bb::cascades::FocusPolicy::Type focusPolicyInherited

Indicates whether this control is focusable or not and what kind of user input focus can be received (touch and/or key).

The default focusPolicy value is None. A disabled Control can not have focus.

Since:

BlackBerry 10.0.0

bb::cascades::FocusRetentionPolicy::Types focusRetentionPolicyFlagsInherited

The focus retention policy that determines the conditions under which a control loses focus.

Normally, a control loses focus whenever a user touches outside of the control or on another control, or when scrolling a ListView (may differ from device to device). However, it may be convenient at times to retain focus. This property makes it possible to specify the conditions under which the control should lose focus and when it shouldn't. The property only affects focus changes initiated by user interaction, not when programmatically changing focus (i.e. by calling requestFocus() on a control).

Here's an example of how to set the focus retention policy in QML:

TextArea {
    focusRetentionPolicyFlags: FocusRetentionPolicy.LoseToNonFocusable |
            FocusRetentionPolicy.LoseOnScroll
    text: "Loses Focus"        
}
Since:

BlackBerry 10.0.0

bb::cascades::HorizontalAlignment::Type horizontalAlignmentInherited

Specifies the HorizontalAlignment for the control.

The default alignment is HorizontalAlignment::Left.

Since:

BlackBerry 10.0.0

bool implicitLayoutAnimationsEnabledInherited

Enables or disables implicit animations when layout-related properties for a Control are changed.

This property affects implicit animations on the following properties for a control.

  • positioning in a layout, including x and y coordinates and horizontal and vertical alignment

  • preferred height and width

  • maximum and minimum height and width

  • margins and padding

The default is true meaning that implicit animations are enabled.

For VisualNode properties, you can customize implicit animations by using ImplicitAnimationController. These properties include translation, rotation, scaling, pivoting, and opacity.

Since:

BlackBerry 10.0.0

bb::cascades::InputRouteProperties inputRouteInherited[read-only]

Defines this control's role in the propagation of input events.

QML usage:
Container {
    inputRoute.primaryKeyTarget: true

    Label {
        id: myLabel
        text: "Press a"
    }

    shortcuts: [
        Shortcut {
            key: "a"
            onTriggered: {
                myLabel.text = "Shortcut triggered!"
            }
        }
    ]
}
C++ usage:
Container *pContainer = new Container();
pContainer->inputRoute()->setPrimaryKeyTarget(true);
// Shortcuts on pContainer can now trigger.
C++ usage (with builder):
Container *pContainer = Container::create()
    .primaryKeyTarget(true)
    .add(Label::create()
            .text("My container will get key events!"));
Since:

BlackBerry 10.1.0

bb::cascades::LayoutProperties layoutPropertiesInherited

The layout properties for the control.

The layoutProperties property specifies how the parent container should position and size the control. The layoutProperties object must match the Layout type of the container. For example, if the parent container uses a stack layout, the layoutProperties should be a StackLayoutProperties object.

By default, a control's layoutProperties is 0. If the layoutProperties for a control is not explicitly set, the parent container uses the default layout properties for the type of layout that it's using.

Since:

BlackBerry 10.0.0

float leftMarginInherited

The left margin for the control.

Margins are positive values that specify the space around a control.

How the margin is actually used depends on how the control is laid out within its parent container. When the control is laid out in a StackLayout, the margin is considered between the siblings in the layout direction. In that case the distance between two children in the layout direction will be the largest margin of the two adjacent margins in the layout direction.

The default value depends on the actual control. For the Container class the value is 0.0.

Since:

BlackBerry 10.0.0

bool leftMarginSetInherited[read-only]

Indicates whether the leftMargin of a control is set.

If true the left margin has been set on a control, if false the leftMargin is not set. By default, leftMargin is false, meaning that the control will use control-specific default

Since:

BlackBerry 10.0.0

float leftPaddingInherited

The left padding for the control.

The default left padding is 0.

Left padding only works for the following controls, for all other controls left padding is undefined:

Negative padding values are supported in the ListView control, for all other controls negative padding is undefined.

Since:

BlackBerry 10.0.0

bool locallyFocusedInherited

Indicates whether the control has local focus.

Each focus scope keeps track of a local focus. The local focus can be used to set which control should get focus when navigating to the focus scope. If the focus scope contains the actual focus when setting local focus to true, actual will be requested by this control.

Since:

BlackBerry 10.3.1

bb::cascades::Spacings marginInherited[read-only]

Full margins for the control.

Margins are positive values that specify the space around a control.

How the margin is actually used depends on how the control is laid out within its parent, both Containers, ListViews and ScrollViews (and other controls that have children) can use the information to position their children.

For example when the control is laid out in a StackLayout, the margin is considered both for the distance from the side of the parent and between the siblings in the layout direction. In such a case the distance between two children in the layout direction will be the largest margin of the two adjacent children in the layout direction.

For DockLayout the margin values will affect only the position from the side of the parent to the child.

The Margin group property is not created until it's needed, default value for the margins of a control are undefined which means that the containing parent will decide. In the margins group property this is specified by the float values defaulting to NAN.

This is a new API that will replace the current version using topMargin et.c. but until the support is fully implemented in all Containing Controls, the old way is not deprecated. I the current version the difference between using the margin group property and separate margin properties (topMargin et.c.) is that the group property can be used both for the space between siblings in a StackLayout and StackListLayout but that the Layouts in a container also use it to position the children from the inside of the container. Lessening the need for extra layers of containers with padding.

Since:

BlackBerry 10.3.0

float maxHeightInherited

The maximum height for the control.

The max height is a positive value used by the layout system to position the control.

The default maxHeight is infinitely large (no limit). The control can determine the effective maxHeight of a control by combining the maxHeight with the size of contents of the control.

Since:

BlackBerry 10.0.0

float maxWidthInherited

The maximum width for the control.

The max width is a positive value used by the layout system to position the control.

The default maxWidth is infinitely large (no limit). The control can determine the effective maxWidth of a control by combining the maxWidth with the size of contents of the control.

Since:

BlackBerry 10.0.0

float minHeightInherited

The minimum height for the control.

The min height is a positive value used by the layout system to position the control.

The default minHeight for a control is 0.0. The control can determine the effective minHeight of a control by combining the minHeight with the size of contents of the control.

Since:

BlackBerry 10.0.0

float minWidthInherited

The minimum width for the control.

The min width is a positive value used by the layout system to position the control.

The default minWidth for a control is 0.0. The control can determine the effective minWidth of a control by combining the minWidth with the size of contents of the control.

Since:

BlackBerry 10.0.0

bb::cascades::Navigation navigationInherited[read-only]

Defines the behavior for navigation with trackpad and similar input.

Since:

BlackBerry 10.3.1

QString objectNameInherited

This property is overridden from QObject.

See also:

QObject::objectName().

Since:

BlackBerry 10.0.0

float opacityInherited

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 overlapTouchPolicyInherited

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

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

float pivotXInherited

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 pivotYInherited

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 preferredHeightInherited

The preferred height of the control.

The preferred height is a positive value used by the Layout of the parent Container to position the control. If the preferred height for a control is not set, the parent container ignores this value and uses the control-specific default height. See the API reference for a specific control for more details about its default height. You can check whether the preferredHeight of a control is set by calling isPreferredHeightSet().

However, just because the preferred height has been set on a control, does not mean it is being used. The preferred height is ignored by the parent container if it is smaller than the minimum size allowed for that control.

Since:

BlackBerry 10.0.0

bool preferredHeightSetInherited[read-only]

Indicates whether the preferredHeight of a control is set.

If true the preferred height has been set on a control, if false the preferred height is not set. By default, preferredHeightSet is false, meaning that the parent container ignores the preferred height and uses the control-specific default instead.

Since:

BlackBerry 10.0.0

float preferredWidthInherited

The preferred width of the control.

The preferred width is a positive value used by the Layout of the parent Container to position the control. If the preferred width for a control is not set (or was set but has since been reset), the parent container ignores this value and uses the control-specific default width. See the API reference for a specific control for more details about its default width. You can check whether the preferredWidth of a control is set by calling isPreferredWidthSet().

However, just because the preferred width has been set on a control, does not mean it is being used. The preferred width is ignored by the parent container if it is smaller than the minimum size allowed for that control.

Since:

BlackBerry 10.0.0

bool preferredWidthSetInherited[read-only]

Indicates whether the preferredWidth of a control is set.

If true the preferred width has been set on a control, if false the preferred width is not set. By default, preferredWidthSet is false, meaning that the parent container ignores the preferred width and uses the control-specific default instead.

Since:

BlackBerry 10.0.0

float rightMarginInherited

The right margin for the control.

Margins are positive values that specify the space around a control.

How the margin is actually used depends on how the control is laid out within it's parent container. When the control is laid out in a StackLayout, the margin is considered between the siblings in the layout direction. In that case the distance between two children in the layout direction will be the largest margin of the two adjacent margins in the layout direction.

The default value depends on the actual control. For the Container class the value is 0.0.

Since:

BlackBerry 10.0.0

bool rightMarginSetInherited[read-only]

Indicates whether the rightMargin of a control is set.

If true the right margin has been set on a control, if false the rightMargin is not set. By default, rightMargin is false, meaning that the control will use control-specific default

Since:

BlackBerry 10.0.0

float rightPaddingInherited

The right padding for the control.

The default right padding is 0.

Right padding only works for the following controls, for all other controls right padding is undefined:

Negative padding values are supported in the ListView control, for all other controls negative padding is undefined.

Since:

BlackBerry 10.0.0

float rotationZInherited

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 scaleXInherited

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 scaleYInherited

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

float topMarginInherited

The top margin for the control.

Margins are positive values that specify the space around a control.

How the margin is actually used depends on how the control is laid out within it's parent container. When the control is laid out in a StackLayout, the margin is considered between the siblings in the layout direction. In that case the distance between two children in the layout direction will be the largest margin of the two adjacent margins in the layout direction.

The default value depends on the actual control. For the Container class the value is 0.0.

Since:

BlackBerry 10.0.0

bool topMarginSetInherited[read-only]

Indicates whether the topMargin of a control is set.

If true the top Margin has been set on a control, if false the topMargin is not set. By default, topMargin is false, meaning that the control will use control-specific default

Since:

BlackBerry 10.0.0

float topPaddingInherited

The top padding for the control.

The default top padding is 0.

Top padding only works for the following controls, for all other controls top padding is undefined:

Negative padding values are supported in the ListView control, for all other controls negative padding is undefined.

Since:

BlackBerry 10.0.0

bb::cascades::TouchPropagationMode::Type touchPropagationModeInherited

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 translationXInherited

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 translationYInherited

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

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

bb::cascades::VerticalAlignment::Type verticalAlignmentInherited

Specifies the VerticalAlignment for the control.

The default alignment is VerticalAlignment::Top.

Since:

BlackBerry 10.0.0

bool visibleInherited

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

Public Functions

DateTimePicker (

Constructs a DateTimePicker with a parent and DateTimePickerMode::Date as its initial mode.

If not 0, the ownership of the constructed DateTimePicker will be transferred to the parent.

Parameters
parent

The parent container or 0. Optional and will default to 0 if not specified.

mode

The mode of the DateTimePicker. Default mode is DateTimePickerMode::Date

Since:

BlackBerry 10.0.0

virtual~DateTimePicker ()

Destructor.

Since:

BlackBerry 10.0.0

Q_INVOKABLE QDateTime dateFromTime (

Converts a QTime object to a QDateTime object.

This can be used when you want to specify only the time when Time mode is used.

Example when used in QML:

Container {
    DateTimePicker {
        id: picker3
        title: "TimeQml"
        mode: DateTimePickerMode.Time
        value: picker.dateFromTime("10:11:00")
    }
}
Since:

BlackBerry 10.0.0

bool isExpanded ()

Returns the current expanded state.

true means that the state is expanded. false means that the state is collapsed.

Return:

the current expanded state

Since:

BlackBerry 10.0.0

QDateTime maximum ()

Returns the current maximum date and time value.

Return:

The maximum date and time value. If the maximum value is not set an empty QDateTime is returned.

Since:

BlackBerry 10.0.0

QDateTime minimum ()

Returns the current minimum date and time value.

Return:

The minimum date and time value. If the minimum value is not set an empty QDateTime is returned.

Since:

BlackBerry 10.0.0

int minuteInterval ()

Returns the current minute interval value.

Return:

The minute interval value.

Since:

BlackBerry 10.0.0

bb::cascades::DateTimePickerMode::Type mode ()

Returns the current mode of the DateTimePicker.

The default mode is DateTimePickerMode::Date.

Return:

The mode of the DateTimePicker.

Since:

BlackBerry 10.0.0

Q_SLOT void resetExpanded ()

Resets the expanded state to false, i.e.

collapsed. expandedChanged(bool) signal is emitted.

Since:

BlackBerry 10.0.0

Q_SLOT void resetMaximum ()

Removes the maximum value.

Since:

BlackBerry 10.0.0

Q_SLOT void resetMinimum ()

Removes the minimum value.

Since:

BlackBerry 10.0.0

Q_SLOT void resetMinuteInterval ()

Resets the minute interval to the default value.

Since:

BlackBerry 10.0.0

Q_SLOT void resetMode ()

Resets the current mode to the default mode DateTimePickerMode::Date.

Since:

BlackBerry 10.0.0

Q_SLOT void resetTitle ()

Resets the title.

The titleChanged() signal will be emitted if operation was successful.

Since:

BlackBerry 10.0.0

Q_SLOT void resetValue ()

Resets the selected value to the current date and time.

If the current date and time is outside of the maximum or minimum range it will be clamped to either the maximum or minimum value.

Since:

BlackBerry 10.0.0

Q_SLOT void setExpanded (
  • boolexpanded)

Sets the expanded state.

In case of successful change expandedChanged(bool) signal is emitted.
Parameters
expanded

The new state to set. true means expanded, false means collapsed

Since:

BlackBerry 10.0.0

Q_SLOT void setMaximum (

Sets the latest date and time value that can be selected.

By default the maximum value is not set and an empty QDateTime will be returned when maximum() is called.

If the maximum value is lower than the minimum value neither minimum nor maximum values will have effect.

If the selected value is outside of the maximum range the value will be clamped to either the maximum or minimum value.

To remove the maximum value set an empty QDateTime as value or use resetMaximum().

The minimumChanged() signal will be emitted if operation was successful.

Parameters
value

The maximum date and time value.

Since:

BlackBerry 10.0.0

Q_SLOT void setMinimum (

Sets the earliest date and time value that can be selected.

By default the minimum value is not set and an empty QDateTime will be returned when minimum() is called.

If the minimum value is higher than the maximum value neither maximum nor minimum values will have effect.

If the selected value is outside of the minimum range the value will be clamped to either the maximum or minimum value.

To remove the minimum value set an empty QDateTime as value or use resetMinimum().

The minimumChanged() signal will be emitted if operation was successful.

Parameters
value

The minimum date and time value.

Since:

BlackBerry 10.0.0

Q_SLOT void setMinuteInterval (
  • intminuteInterval)

Sets the interval by which the minutes are incremented.

Valid values are 1, 5, 10 or 15. Default is 5. Any non valid values are ignored.

The minuteIntervalChanged() signal will be emitted if operation was successful.

Parameters
minuteInterval

The minute interval value.

Since:

BlackBerry 10.0.0

Q_SLOT void setMode (

Sets the mode of the DateTimePicker.

When the mode is changed, the current selected value is not affected.

The modeChanged() signal will be emitted if operation was successful.

Parameters
mode

The mode of the DateTimePicker.

Since:

BlackBerry 10.0.0

Q_SLOT void setTitle (

Sets the title of the DateTimePicker.

The titleChanged() signal will be emitted if operation was successful.

Parameters
title

The title.

Since:

BlackBerry 10.0.0

Q_SLOT void setValue (

Sets the date and time value that is selected in the DateTimePicker.

If the value is outside of the maximum or minimum range the value will be clamped to either the maximum or minimum value.

Note: Minute value will be rounded to nearest interval set with setMinuteInterval() Second will be reset to 0

C++ example for selecting current date and time:

QDateTime dt = QDateTime(QDate::currentDate(), QTime::currentTime());
DateTimePicker *dateTimePicker5 =  DateTimePicker::create()
    .title("DateTime")
    .mode(DateTimePickerMode::DateTime);
dateTimePicker5->setValue(dt);
QML example for selecting current date and time:
Container {
    DateTimePicker {
        id: picker5
        title: "DateTimeQml"
        mode: DateTimePickerMode.DateTime
        value: { new Date(); }
    }
}
The valueChanged() signal will be emitted if operation was successful.
Parameters
value

The date and time value to select.

Since:

BlackBerry 10.0.0

QString title ()

Returns the title of the DateTimePicker.

Return:

The title.

Since:

BlackBerry 10.0.0

QDateTime value ()

Returns the current selected date and time value.

Return:

The value of the selected date and time value.

Since:

BlackBerry 10.0.0

bb::cascades::AbstractA11yObject * accessibility ()Inherited

Returns the accessibility object.

Return:

The accessibility object.

bb::cascades::A11yMode::Type accessibilityMode ()Inherited

Return the current value of the accessibilityMode property.

Return:

The A11yMode of the control.

Since:

BlackBerry 10.2.0

ActionSet * actionSetAt (
  • intindex)
Inherited

Returns an ActionSet at a specified index.

Ownership of the ActionSet object remains with the control.

See also:

Control::contextActions

Parameters
index

The index of the ActionSet.

Return:

The requested ActionSet if the index was valid, 0 otherwise.

Since:

BlackBerry 10.0.0

int actionSetCount ()Inherited

Returns the number of ActionSet objects.

See also:

Control::contextActions

Return:

The number of ActionSet objects.

Since:

BlackBerry 10.0.0

void addActionSet (Inherited

Adds an ActionSet to the control.

The control takes ownership of the ActionSet object, since ActionSet objects should not typically be shared. If the ActionSet is 0 or it already belongs to the control, the action set is not added. Once completed, the actionSetAdded() signal is emitted.

See also:

Control::contextActions

Parameters
actionSet

The ActionSet to add to the Control.

Since:

BlackBerry 10.0.0

void addAnimation (Inherited

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

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

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

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

Q_INVOKABLE void addKeyListener (Inherited

Adds a key listener to the Control.

The Control will always take ownership as a key listener should never be shared. If the key listener already belongs to the Control or the key listener is 0, nothing will happen.

Parameters
keyListener

The KeyListener to add to the Control.

Since:

BlackBerry 10.1.0

Q_INVOKABLE void addShortcut (Inherited

Adds a shortcut to the Control.

The Control will always take ownership as shortcuts should never be shared. If the shortcut already belongs to the Control or the shortcut is 0, nothing will happen. The order in which shortcuts are added will determine which shortcut will be triggered in case of an overlap.

Parameters
shortcut

The AbstractShortcut to add to the Control.

Since:

BlackBerry 10.1.0

void addTouchBehavior (Inherited

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

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

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

float bottomMargin ()Inherited

Returns the bottomMargin for the control.

Return:

The bottom margin for the control.

Since:

BlackBerry 10.0.0

float bottomPadding ()Inherited

Returns the bottom padding on the control.

Return:

The bottom padding.

Since:

BlackBerry 10.0.0

Q_INVOKABLE bool builtInShortcutsEnabled ()Inherited

Returns an builtInShortcutsEnabled property value.

Return:

true if builtInShortcutsEnabled property is set to true and false otherwise

Since:

BlackBerry 10.2.0

bb::cascades::ContextMenuHandler * contextMenuHandler ()Inherited

Return:

The ContextMenuHandler that was set or 0 if no handler was set.

Since:

BlackBerry 10.0.0

Q_INVOKABLE void disableAllShortcuts ()Inherited

Disables all shortcuts attached to the Control.

Shortcuts that are attached afterward will use the default enabled state.

Since:

BlackBerry 10.1.0

Q_INVOKABLE void enableAllShortcuts ()Inherited

Enables all shortcuts attached to the Control.

Since:

BlackBerry 10.1.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

bb::cascades::FocusAutoShow::Type focusAutoShow ()Inherited

Returns the focusAutoShow property of the control.

Return:

The focusAutoShow state of the control

Since:

BlackBerry 10.0.0

bb::cascades::FocusPolicy::Type focusPolicy ()Inherited

Returns the focusPolicy property of the control.

Return:

The focusPolicy state of the control as a FocusPolicy

Since:

BlackBerry 10.0.0

bb::cascades::FocusRetentionPolicy::Types focusRetentionPolicyFlags ()Inherited

Gets the focus retention policy.

The policy describes under which condtions the control will lose focus

Return:

The focus retention policy for this control.

Since:

BlackBerry 10.0.0

bb::cascades::HorizontalAlignment::Type horizontalAlignment ()Inherited

Returns the horizontal alignment for the control.

Return:

The horizontal alignment for the control.

Since:

BlackBerry 10.0.0

bool implicitLayoutAnimationsEnabled ()Inherited

Return the current value of the implicitLayoutAnimationsEnabled property.

Return:

If true layout changes will implicitely trigger animations, if false the animations are disabled.

Since:

BlackBerry 10.0.0

bb::cascades::InputRouteProperties * inputRoute ()Inherited

Returns the input route properties object.

Return:

The input route properties object.

Since:

BlackBerry 10.1.0

bool isBottomMarginSet ()Inherited

Indicates whether the bottomMargin of the control is set.

Return:

true if the bottom margin is set, false otherwise.

Since:

BlackBerry 10.0.0

bool isEnabled ()Inherited

Returns the enabled state of the control.

Return:

true if the control is enabled, false otherwise.

Since:

BlackBerry 10.0.0

bool isFocused ()Inherited

Returns the focused state of the control.

Return:

true if the control is focused, false otherwise.

Since:

BlackBerry 10.0.0

bool isLeftMarginSet ()Inherited

Indicates whether the leftMargin of the control is set.

Return:

true if the left margin is set, false otherwise.

Since:

BlackBerry 10.0.0

bool isLocallyFocused ()Inherited

Returns the locallyFocused state of the control.

Return:

true if the controls locallyFocused property is set, false otherwise.

Since:

BlackBerry 10.3.1

bool isPreferredHeightSet ()Inherited

Indicates whether the preferredHeight of the control is set.

Return:

true if the preferred height is set, false otherwise.

Since:

BlackBerry 10.0.0

bool isPreferredWidthSet ()Inherited

Indicates whether the preferredWidth of the control is set.

Return:

true if the preferred width is set, false otherwise.

Since:

BlackBerry 10.0.0

bool isRightMarginSet ()Inherited

Indicates whether the rightMargin of the control is set.

Return:

true if the right margin is set, false otherwise.

Since:

BlackBerry 10.0.0

bool isTopMarginSet ()Inherited

Indicates whether the topMargin of the control is set.

Return:

true if the top margin is set, false otherwise.

Since:

BlackBerry 10.0.0

bool isVisible ()Inherited

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

Q_INVOKABLE bb::cascades::KeyListener * keyListenerAt (
  • intindex)
Inherited

Returns a key listener at the specified index.

Ownership of the key listener remains with the Control.

Parameters
index

The index of the key listener.

Return:

The requested key listener if the index was valid, 0 otherwise.

Since:

BlackBerry 10.1.0

Q_INVOKABLE int keyListenerCount ()Inherited

Returns the number of key listeners.

Return:

The number of key listeners.

Since:

BlackBerry 10.1.0

bb::cascades::LayoutProperties * layoutProperties ()Inherited

Returns the LayoutProperties object for the control.

Ownership of the LayoutProperties object remains unchanged.

Return:

The layout properties for the control.

Since:

BlackBerry 10.0.0

float leftMargin ()Inherited

Returns the leftMargin for the control.

Return:

The left margin for the control.

Since:

BlackBerry 10.0.0

float leftPadding ()Inherited

Returns the left padding on the control.

Return:

The left padding.

Since:

BlackBerry 10.0.0

Q_SLOT void loseFocus ()Inherited

Called when the control should lose its focus.

If succeeded, the focusedChanged() signal is emitted with false as its parameter.

Since:

BlackBerry 10.0.0

bb::cascades::Spacings * margin ()Inherited

Returns the margin group property for the control.

Return:

The margin property for the control.

Since:

BlackBerry 10.3.0

float maxHeight ()Inherited

Returns the maxHeight of the control.

Return:

The maximum height of the control.

Since:

BlackBerry 10.0.0

float maxWidth ()Inherited

Returns the maxWidth of the control.

Return:

The maximum width of the control.

Since:

BlackBerry 10.0.0

float minHeight ()Inherited

Returns the minHeight of the control.

Return:

The minimum height of the control.

Since:

BlackBerry 10.0.0

float minWidth ()Inherited

Returns the minWidth of the control.

Return:

The minimum width of the control.

Since:

BlackBerry 10.0.0

bb::cascades::Navigation * navigation ()Inherited

Returns a Navigation object that specifies the behavior for navigation with trackpad and similar input.

@ return A Navigation object that specifies the behavior for navigation with trackpad and similar input.

Since:

BlackBerry 10.3.1

float opacity ()Inherited

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

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

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

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

float preferredHeight ()Inherited

Returns the preferredHeight of the control.

To check whether the preferred height is set for a control, call isPreferredHeightSet().

Return:

The preferred height of a control as a positive number, or 0 if the preferred width is not set.

Since:

BlackBerry 10.0.0

float preferredWidth ()Inherited

Returns the preferredWidth of the control.

To check whether the preferred width is set for the control, call isPreferredWidthSet().

Return:

The preferred width of a control as a positive number, or 0 if the preferred width is not set.

Since:

BlackBerry 10.0.0

bool removeActionSet (Inherited

Removes an ActionSet from the control.

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

Once completed, the actionSetRemoved() signal is emitted.

See also:

Control::contextActions

Parameters
actionSet

The actionSet to remove.

Return:

true if the ActionSet was owned by the Control, false otherwise.

Since:

BlackBerry 10.0.0

void removeAllActionSets ()Inherited

Removes all ActionSet objects from the control and deletes them.

Once completed, the actionSetRemoved() signal is emitted with 0 as its parameter.

See also:

Control::contextActions

Since:

BlackBerry 10.0.0

void removeAllAnimations ()Inherited

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

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

Since:

BlackBerry 10.3.0

void removeAllGestureHandlers ()Inherited

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

Since:

BlackBerry 10.0.0

Q_INVOKABLE void removeAllKeyListeners ()Inherited

Removes all of a Control's key listeners and frees up their memory.

Since:

BlackBerry 10.1.0

Q_INVOKABLE void removeAllShortcuts ()Inherited

Removes all of a control's shortcuts and frees up their memory.

Since:

BlackBerry 10.1.0

void removeAllTouchBehaviors ()Inherited

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

Since:

BlackBerry 10.0.0

bool removeAnimation (Inherited

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

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

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

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

Q_INVOKABLE bool removeKeyListener (Inherited

Removes a key listener from the Control.

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

Parameters
keyListener

The KeyListener to remove.

Return:

true if the key listener was owned by the Control, false otherwise.

Since:

BlackBerry 10.1.0

Q_INVOKABLE bool removeShortcut (Inherited

Removes a shortcut from the Control.

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

Parameters
shortcut

The AbstractShortcut to remove.

Return:

true if the shortcut was owned by the Control, false otherwise.

Since:

BlackBerry 10.1.0

bool removeTouchBehavior (Inherited

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

Requests focus to this control.

When requesting focus for a control, you must ensure that the control is currently a part of the scene.

A common use case for requesting focus is when a new Page is loaded into the scene. For example, on a page that requires text input from the user, you might want to request focus on a TextField as soon as the page loads so that the keyboard is automatically displayed. In this scenario, the natural assumption might be to request focus within the page's BaseObject::creationCompleted() signal, which is emitted once the object's construction is complete. However, this approach is incorrect. Even though the object has been created, it has not yet been added to the UI tree, so the call would fail.

Here are two different methods that you can use for requesting focus. The first method involves listening for changes to the Application::scene property. Here's a .qml file called RequestFocusPage.qml, which contains a TextField that you want to request focus for as soon as the page loads. The page contains a variant property that is bound to the application's scene property. When you declare a variable in QML, a value-change signal is implicitly created as well. So, whenever this page gets added to the scene, the onAppSceneChanged() signal handler is called where it's safe to request focus for the control.

import bb.cascades 1.2

Page {
    property variant appScene: Application.scene
    Container {
        TextArea {
            id: theTextArea
            text: "Give me focus!"
        }
    }
    onAppSceneChanged: {
        // This triggers focus if the application scene is set to
        // this QML Page.
        theTextArea.requestFocus();
    }
}
The second method involves using a ComponentDefinition to load the pages. Here's another version called RequestFocusPage2.qml. It contains a Boolean property called readyForFocus which is initialized to false. When the value changes, the onreadyForFocusChanged() signal handler is called and focus is requested.
import bb.cascades 1.2

Page {
    property bool readyForFocus: false
    Container {
        TextArea {
            id: theTextArea
            text: "I want some focus too!"
        }
    }
    onReadyForFocusChanged: {
        if (readyForFocus) {
            // This triggers focus if the Page is created using a
            // ComponentDefinition.
            theTextArea.requestFocus();
        }
    }
}
Here's how you can create the Page and set the readyForFocus property from a ComponentDefinition in a NavigationPane:
import bb.cascades 1.2

NavigationPane {
    id: nav
    RequestFocusPage {
        actions: ActionItem {
            ActionBar.placement: ActionBarPlacement.OnBar
            title: "Navigate"
            onTriggered: {
                var page = refocusPage.createObject();
                nav.push(page);

                // Here it is ok to trigger the focus request since the page is added to
                // the UI tree as it is pushed to the NavigationPane.
                page.readyForFocus = true;
            }
        }
    }
    attachedObjects: ComponentDefinition {
        id: refocusPage
        source: "RequestFocusPage2.qml"
    }
    onPopTransitionEnded: {
        page.destroy()
    }
}
If succeeded, the focusedChanged() signal is emitted with true as its parameter.
Since:

BlackBerry 10.0.0

Q_SLOT void resetAccessibilityMode ()Inherited

Resets the accessibilityMode property to its default value of Default.

Since:

BlackBerry 10.2.0

Q_SLOT void resetBottomMargin ()Inherited

Resets the bottomMargin.

Since:

BlackBerry 10.0.0

Q_SLOT void resetBottomPadding ()Inherited

Resets the bottom padding to its default.

The default bottom padding is 0.

After the padding is reset, the bottomPaddingChanged() signal is emitted.

Since:

BlackBerry 10.0.0

Q_INVOKABLE void resetBuiltInShortcutsEnabled ()Inherited

Resets an builtInShortcutsEnabled property to default value.

Default value is true.

Since:

BlackBerry 10.2.0

Q_SLOT void resetContextMenuHandler ()Inherited

Resets the contextMenuHandler property to the default value of 0.

Removes the ContextMenuHandler from this control by resetting it to 0.

Since:

BlackBerry 10.0.0

Q_SLOT void resetEnabled ()Inherited

Resets the enabled state of the control to true.

Since:

BlackBerry 10.0.0

Q_SLOT void resetFocusAutoShow ()Inherited

Resets the focusAutoShow to its default value.

Since:

BlackBerry 10.0.0

Q_SLOT void resetFocusPolicy ()Inherited

Resets the focusPolicy to its default value of FOCUSPOLICY_NONE.

Since:

BlackBerry 10.0.0

Q_SLOT void resetFocusRetentionPolicyFlags ()Inherited

Reset the focus retention policy to default value.

Since:

BlackBerry 10.0.0

Q_SLOT void resetHorizontalAlignment ()Inherited

Resets the horizontal alignment to its default.

The default alignment is HorizontalAlignment::Left.

After the horizontal alignment is reset, the horizontalAlignmentChanged() signal is emitted.

Since:

BlackBerry 10.0.0

Q_SLOT void resetImplicitLayoutAnimationsEnabled ()Inherited

Resets the implicitLayoutAnimationsEnabled property to its default value.

Since:

BlackBerry 10.0.0

Q_SLOT void resetLayoutProperties ()Inherited

Resets the layoutProperties for the control to 0 (automatic selection of LayoutProperties).

Since:

BlackBerry 10.0.0

Q_SLOT void resetLeftMargin ()Inherited

Resets the leftMargin.

Since:

BlackBerry 10.0.0

Q_SLOT void resetLeftPadding ()Inherited

Resets the left padding to its default.

The default left padding is 0.

After the padding is reset, the leftPaddingChanged() signal is emitted.

Since:

BlackBerry 10.0.0

Q_SLOT void resetLocallyFocused ()Inherited

Resets the locallyFocused to its default value.

Since:

BlackBerry 10.3.1

Q_SLOT void resetMaxHeight ()Inherited

Resets the maxHeight of the control.

Since:

BlackBerry 10.0.0

Q_SLOT void resetMaxWidth ()Inherited

Resets the maxWidth of the control.

Since:

BlackBerry 10.0.0

Q_SLOT void resetMinHeight ()Inherited

Resets the minHeight of the control.

Since:

BlackBerry 10.0.0

Q_SLOT void resetMinWidth ()Inherited

Resets the minWidth of the control.

Since:

BlackBerry 10.0.0

Q_SLOT void resetOpacity ()Inherited

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

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

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

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

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

Resets the preferredHeight to its default value of 0.

Since:

BlackBerry 10.0.0

Q_SLOT void resetPreferredSize ()Inherited

Resets the preferred width and height of the control.

A convenience function for resetting both the preferred width and height. It is equivalent to calling both resetPreferredWidth() and resetPreferredHeight().

Since:

BlackBerry 10.0.0

Q_SLOT void resetPreferredWidth ()Inherited

Resets the preferredWidth to its default value of 0.

Since:

BlackBerry 10.0.0

Q_SLOT void resetRightMargin ()Inherited

Resets the rightMargin.

Since:

BlackBerry 10.0.0

Q_SLOT void resetRightPadding ()Inherited

Resets the right padding to its default.

The default right padding is 0.

After the padding is reset, the rightPaddingChanged() signal is emitted.

Since:

BlackBerry 10.0.0

Q_SLOT void resetRotationZ ()Inherited

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

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

Since:

BlackBerry 10.0.0

Q_SLOT void resetScaleX ()Inherited

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

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

Resets the topMargin.

Since:

BlackBerry 10.0.0

Q_SLOT void resetTopPadding ()Inherited

Resets the top padding to its default.

The default top padding is 0.

After the padding is reset, the topPaddingChanged() signal is emitted.

Since:

BlackBerry 10.0.0

Q_SLOT void resetTouchPropagationMode ()Inherited

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

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

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

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

Resets the vertical alignment to its default.

The default alignment is VerticalAlignment::Top.

After the vertical alignment is reset, the verticalAlignmentChanged() signal is emitted.

Since:

BlackBerry 10.0.0

Q_SLOT void resetVisible ()Inherited

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

Returns the rightMargin for the control.

Return:

The right margin for the control.

Since:

BlackBerry 10.0.0

float rightPadding ()Inherited

Returns the right padding on the control.

Return:

The right padding.

Since:

BlackBerry 10.0.0

float rotationZ ()Inherited

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

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

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 setAccessibilityMode (Inherited

Controls how the control is exposed to assistive technologies.

Parameters
accessibilityMode

The A11yMode to set on the control

Since:

BlackBerry 10.2.0

Q_SLOT void setBottomMargin (
  • floatbottomMargin)
Inherited

Sets the bottomMargin for the control.

Parameters
bottomMargin

The bottom margin for control; must be greater than or equal to 0.0.

Since:

BlackBerry 10.0.0

Q_SLOT void setBottomPadding (
  • floatbottomPadding)
Inherited

Sets the bottom padding for the control.

After the padding is set, the bottomPaddingChanged() signal is emitted.

Parameters
bottomPadding

The new left padding.

Since:

BlackBerry 10.0.0

Q_INVOKABLE void setBuiltInShortcutEnabled (Inherited

Sets the enabled state of the built-in shortcut attached to the Control at a system level.

Built-in Shortcuts that are attached afterward will use the specified enabled state.

Note:

Selected Built-In shortcut can be enabled or disabled only if Control::builtInShortcutsEnabled property is set to true.

Parameters
type

The system shortcut type

enabled

If true the shortcut is enabled, and if false the shortcut is disabled.

Since:

BlackBerry 10.2.0

Q_SLOT void setBuiltInShortcutsEnabled (
  • boolenabled)
Inherited

Sets the enabled state of all built-in shortcuts attached to the Control at a system level.

Built-in Shortcuts that are attached afterward will use the specified enabled state.

Parameters
enabled

If true all built-in shortcuts are enabled, and if false all built-in shortcut are disabled.

Since:

BlackBerry 10.2.0

void setContextMenuHandler (Inherited

Sets the ContextMenuHandler for this Control.

The control takes ownership of the ContextMenuHandler object. Once completed, the contextMenuHandlerChanged() signal is emitted. The replaced context menu handler (if one was set) remains owned by the control.

Parameters
contextMenuHandler

The ContextMenuHandler to set or 0 to remove currently set ContextMenuHandler.

Since:

BlackBerry 10.0.0

Q_SLOT void setEnabled (
  • boolenabled)
Inherited

Sets the enabled state of the control.

Parameters
enabled

If true the control is enabled and if false the control is disabled.

Since:

BlackBerry 10.0.0

Q_SLOT void setFocusAutoShow (Inherited

Sets the focusAutoShow of the control.

Parameters
focusAutoShow

The focusAutoShow state of the Control.

Since:

BlackBerry 10.0.0

Q_SLOT void setFocusPolicy (Inherited

Sets the focusPolicy of the control.

Parameters
focusPolicy

The focusPolicy state of the Control as a FocusPolicy.

See also:

FocusPolicy

Since:

BlackBerry 10.0.0

Q_SLOT void setFocusRetentionPolicyFlags (
  • bb::cascades::FocusRetentionPolicy::Typespolicy)
Inherited

Sets the focus retention policy.

The policy describes under which condtions the control will lose focus.

Parameters
policy

The new policy.

Since:

BlackBerry 10.0.0

Q_SLOT void setHorizontalAlignment (Inherited

Sets the horizontal alignment for the control.

After the horizontal alignment is set, the horizontalAlignmentChanged() signal is emitted.

Parameters
horizontalAlignment

The horizontal alignment for the control.

Since:

BlackBerry 10.0.0

Q_SLOT void setImplicitLayoutAnimationsEnabled (
  • boolenable)
Inherited

Controls whether layout changes trigger automatic animations or not.

Parameters
enable

If true trigger animations, if false do not

Since:

BlackBerry 10.0.0

Q_SLOT void setLayoutProperties (Inherited

Sets the layoutProperties for the control.

The control takes ownership of the LayoutProperties object if no other control owns it already. If the LayoutProperties object already has an owner, the properties are applied to the control, but ownership of the LayoutProperties object remains unchanged. If the control already owns a LayoutProperties object, the existing settings are replaced by the specified LayoutProperties object and the container retains ownership of both.

Parameters
layoutProperties

The new layout properties for the control.

Since:

BlackBerry 10.0.0

Q_SLOT void setLeftMargin (
  • floatleftMargin)
Inherited

Sets the leftMargin for the control.

Parameters
leftMargin

The left margin for control; must be greater than or equal to 0.0.

Since:

BlackBerry 10.0.0

Q_SLOT void setLeftPadding (
  • floatleftPadding)
Inherited

Sets the left padding for the control.

After the padding is set, the leftPaddingChanged() signal is emitted.

Parameters
leftPadding

The new left padding.

Since:

BlackBerry 10.0.0

Q_SLOT void setLocallyFocused (
  • boollocallyFocused)
Inherited

Sets the locallyFocused of the control.

Parameters
locallyFocused

The locallyFocused state of the Control.

Since:

BlackBerry 10.3.1

Q_SLOT void setMaxHeight (
  • floatmaxHeight)
Inherited

Sets the maxHeight of the control.

Parameters
maxHeight

The new maximum height of the control; must be greater than or equal to 0.0.

Since:

BlackBerry 10.0.0

Q_SLOT void setMaxWidth (
  • floatmaxWidth)
Inherited

Sets the maxWidth of the control.

Parameters
maxWidth

The new maximum width of the control; must be greater than or equal to 0.0.

Since:

BlackBerry 10.0.0

Q_SLOT void setMinHeight (
  • floatminHeight)
Inherited

Sets the minHeight of the control.

Parameters
minHeight

The new minimum height of the control; must be greater than or equal to 0.0.

Since:

BlackBerry 10.0.0

Q_SLOT void setMinWidth (
  • floatminWidth)
Inherited

Sets the minWidth of the control.

Parameters
minWidth

The new minimum width of the control; must be greater than or equal to 0.0.

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

Q_SLOT void setOpacity (
  • floatopacity)
Inherited

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

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

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

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

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 setPreferredHeight (
  • floatpreferredHeight)
Inherited

Sets the preferredHeight of the control.

Parameters
preferredHeight

The preferred height of the control as a positive, non-zero number.

Since:

BlackBerry 10.0.0

Q_SLOT void setPreferredSize (
  • floatpreferredWidth,
  • floatpreferredHeight )
Inherited

Sets the preferred width and height of the control.

A convenience function for setting both preferred width and height. It is equivalent to calling both setPreferredWidth() and setPreferredHeight().

Parameters
preferredWidth

The preferred width of the control as a positive, non-zero number.

preferredHeight

The preferred height of the control as a positive, non-zero number.

Since:

BlackBerry 10.0.0

Q_SLOT void setPreferredWidth (
  • floatpreferredWidth)
Inherited

Sets the preferredWidth of the control.

Parameters
preferredWidth

The preferred width of the control as a positive, non-zero number.

Since:

BlackBerry 10.0.0

Q_SLOT void setRightMargin (
  • floatrightMargin)
Inherited

Sets the rightMargin for the control.

Parameters
rightMargin

The right margin for control; must be greater than or equal to 0.0.

Since:

BlackBerry 10.0.0

Q_SLOT void setRightPadding (
  • floatrightPadding)
Inherited

Sets the right padding for the control.

After the padding is set, the rightPaddingChanged() signal is emitted.

Parameters
rightPadding

The new left padding.

Since:

BlackBerry 10.0.0

Q_SLOT void setRotationZ (
  • floatrotationZ)
Inherited

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

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

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

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

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 setTopMargin (
  • floattopMargin)
Inherited

Sets the topMargin for the control.

Parameters
topMargin

The top margin for control; must be greater than or equal to 0.0.

Since:

BlackBerry 10.0.0

Q_SLOT void setTopPadding (
  • floattopPadding)
Inherited

Sets the top padding for the control.

After the padding is set, the topPaddingChanged() signal is emitted.

Parameters
topPadding

The new left padding.

Since:

BlackBerry 10.0.0

Q_SLOT void setTouchPropagationMode (Inherited

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

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

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

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 setVerticalAlignment (Inherited

Sets the vertical alignment for the control.

After the vertical alignment is set, the verticalAlignmentChanged() signal is emitted.

Parameters
verticalAlignment

The vertical alignment for the control.

Since:

BlackBerry 10.0.0

Q_SLOT void setVisible (
  • boolvisible)
Inherited

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

Q_INVOKABLE bb::cascades::AbstractShortcut * shortcutAt (
  • intindex)
Inherited

Returns a shortcut at the specified index.

Ownership of the shortcut remains with the Control.

Parameters
index

The index of the shortcut.

Return:

The requested shortcut if the index was valid, 0 otherwise.

Since:

BlackBerry 10.1.0

Q_INVOKABLE int shortcutCount ()Inherited

Returns the number of shortcuts.

Return:

The number of shortcuts.

Since:

BlackBerry 10.1.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

float topMargin ()Inherited

Returns the topMargin for the control.

Return:

The top margin for the control.

Since:

BlackBerry 10.0.0

float topPadding ()Inherited

Returns the top padding on the control.

Return:

The top padding.

Since:

BlackBerry 10.0.0

TouchPropagationMode::Type touchPropagationMode ()Inherited

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

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

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

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

bb::cascades::VerticalAlignment::Type verticalAlignment ()Inherited

Returns the vertical alignment for the control.

Return:

The vertical alignment for the control.

Since:

BlackBerry 10.0.0

Static Public Functions

Builder create ()

Creates and returns a builder for constructing a DateTimePicker.

Using the builder to create a DateTimePicker:

DateTimePicker *dateTimePicker2 = DateTimePicker::create()
    .title("DateTime")
    .mode(DateTimePickerMode::DateTime);
Return:

A builder used for constructing a DateTimePicker control.

Since:

BlackBerry 10.0.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 expandedChanged (
  • boolexpanded)

Emitted when the expanded state has been changed.

Parameters
expanded

The newly set expanded state

Since:

BlackBerry 10.0.0

void maximumChanged (

Emitted when the maximum value of the date and time has changed.

Parameters
value

The new maximum value of the date and time.

Since:

BlackBerry 10.0.0

void minimumChanged (

Emitted when the minimum value of the date and time has changed.

Parameters
value

The new minimum value of the date and time.

Since:

BlackBerry 10.0.0

void minuteIntervalChanged (
  • intminuteInterval)

Emitted when the minute interval value has changed.

Parameters
minuteInterval

The new minute interval value.

Since:

BlackBerry 10.0.0

void modeChanged (

Emitted when the mode has changed.

Parameters
newMode

The new selected mode of the DateTimePicker.

Since:

BlackBerry 10.0.0

void titleChanged (

Emitted when the title has changed.

Parameters
title

The new title.

Since:

BlackBerry 10.0.0

void valueChanged (

Emitted when the value of the date and time has changed.

Parameters
value

The new value of the date and time.

Since:

BlackBerry 10.0.0

void accessibilityModeChanged (Inherited

Emitted when the accessibilityMode property on the control changes.

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 accessibilityMode property to access the current property value instead of the signal argument to avoid runtime errors.

Parameters
newAccessibilityMode

The new value.

Since:

BlackBerry 10.2.0

void actionSetAdded (Inherited

Emitted when an ActionSet has been added to the Control.

Parameters
actionSet

The ActionSet that has been added.

Since:

BlackBerry 10.0.0

void actionSetRemoved (Inherited

Emitted when an ActionSet has been removed from the control.

Parameters
actionSet

The ActionSet that has been removed. 0 if emitted by removeAllActionSets().

Since:

BlackBerry 10.0.0

void bottomMarginChanged (
  • floatbottomMargin)
Inherited

Emitted when the bottomMargin of the control changes.

Parameters
bottomMargin

The new bottom margin for the control.

Since:

BlackBerry 10.0.0

void bottomMarginSetChanged (
  • boolisSet)
Inherited

Emitted when the bottomMarginSet of the control changes.

Parameters
isSet

information whether the preferred Width is now set.

Since:

BlackBerry 10.0.0

void bottomPaddingChanged (
  • floatbottomPadding)
Inherited

Emitted when the bottomPadding property changes.

Parameters
bottomPadding

The new bottom padding.

Since:

BlackBerry 10.0.0

void builtInShortcutsEnabledChanged (
  • boolbuiltInShortcutsEnabled)
Inherited

Emitted when the builtInShortcutsEnabled property changes.

Parameters
builtInShortcutsEnabled

The new value.

Since:

BlackBerry 10.2.0

void contextMenuHandlerChanged (Inherited

Emitted when a ContextMenuHandler has been set for the Control.

Parameters
contextMenuHandler

The ContextMenuHandler that has been set, or 0 if it was reset.

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

Emitted when the enabled property on the control changes.

Parameters
enabled

If true the control is enabled, if false the control is disabled.

Since:

BlackBerry 10.0.0

void focusAutoShowChanged (Inherited

Emitted when the focusAutoShow of the control changes.

Parameters
newFocusAutoShow

The new focusAutoShow state of the control.

Since:

BlackBerry 10.0.0

void focusedChanged (
  • boolfocused)
Inherited

Emitted when the focused property on the control changes.

Parameters
focused

If true the control is focused, if false the control is not focused.

Since:

BlackBerry 10.0.0

void focusPolicyChanged (Inherited

Emitted when the focusPolicy of the control changes.

Parameters
newFocusPolicy

The new focusPolicy state of the control.

Since:

BlackBerry 10.0.0

void focusRetentionPolicyFlagsChanged (
  • bb::cascades::FocusRetentionPolicy::Typespolicy)
Inherited

Emitted when the focusRetentionPolicyFlags property on the control changes.

Parameters
policy

The new focusRetentionPolicy.

Since:

BlackBerry 10.0.0

void horizontalAlignmentChanged (Inherited

Emitted when the horizontalAlignment property changes.

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 horizontalAlignment instead of newHorizontalAlignment).

Parameters
newHorizontalAlignment

The new horizontal alignment for the control.

Since:

BlackBerry 10.0.0

void implicitLayoutAnimationsEnabledChanged (
  • boolimplicitLayoutAnimationsEnabled)
Inherited

Emitted when the implicitLayoutAnimationsEnabled property on the control changes.

Parameters
implicitLayoutAnimationsEnabled

The new value.

Since:

BlackBerry 10.0.0

void layoutPropertiesChanged (Inherited

Emitted when the layoutProperties of the control changes.

Parameters
layoutProperties

The new layout properties for the control.

Since:

BlackBerry 10.0.0

void leftMarginChanged (
  • floatleftMargin)
Inherited

Emitted when the leftMargin of the control changes.

Parameters
leftMargin

The new left margin for the control.

Since:

BlackBerry 10.0.0

void leftMarginSetChanged (
  • boolisSet)
Inherited

Emitted when the leftMarginSet of the control changes.

Parameters
isSet

information whether the preferred Width is now set.

Since:

BlackBerry 10.0.0

void leftPaddingChanged (
  • floatleftPadding)
Inherited

Emitted when the leftPadding property changes.

Parameters
leftPadding

The new left padding.

Since:

BlackBerry 10.0.0

void locallyFocusedChanged (
  • boolnewLocallyFocused)
Inherited

Emitted when the locallyFocused of the control changes.

Parameters
newLocallyFocused

The new locallyFocused state of the control.

Since:

BlackBerry 10.3.1

void maxHeightChanged (
  • floatmaxHeight)
Inherited

Emitted when the maxHeight of the control changes.

Parameters
maxHeight

The new maximum height for the control.

Since:

BlackBerry 10.0.0

void maxWidthChanged (
  • floatmaxWidth)
Inherited

Emitted when the maxWidth of the control changes.

Parameters
maxWidth

The new maximum width for the control.

Since:

BlackBerry 10.0.0

void minHeightChanged (
  • floatminHeight)
Inherited

Emitted when the minHeight of the control changes.

Parameters
minHeight

The new minimum height for the control.

Since:

BlackBerry 10.0.0

void minWidthChanged (
  • floatminWidth)
Inherited

Emitted when the minWidth of the control changes.

Parameters
minWidth

The new minimum width for the control.

Since:

BlackBerry 10.0.0

void objectNameChanged (Inherited

This signal is emitted when the objectName property is changed.

Since:

BlackBerry 10.0.0

void opacityChanged (
  • floatopacity)
Inherited

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

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

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

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

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 preferredHeightChanged (
  • floatpreferredHeight)
Inherited

Emitted when the preferredHeight of the control changes.

Parameters
preferredHeight

The new preferred height; will always be positive.

Since:

BlackBerry 10.0.0

void preferredHeightSetChanged (
  • boolisSet)
Inherited

Emitted when the preferredHeightSet of the control changes.

Parameters
isSet

information whether the preferred height is now set.

Since:

BlackBerry 10.0.0

void preferredWidthChanged (
  • floatpreferredWidth)
Inherited

Emitted when the preferredWidth of the control changes.

Parameters
preferredWidth

The new preferred width; will always be positive.

Since:

BlackBerry 10.0.0

void preferredWidthSetChanged (
  • boolisSet)
Inherited

Emitted when the preferredWidthSet of the control changes.

Parameters
isSet

information whether the preferred width is now set.

Since:

BlackBerry 10.0.0

void rightMarginChanged (
  • floatrightMargin)
Inherited

Emitted when the rightMargin of the control changes.

Parameters
rightMargin

The new right margin for the control.

Since:

BlackBerry 10.0.0

void rightMarginSetChanged (
  • boolisSet)
Inherited

Emitted when the rightMarginSet of the control changes.

Parameters
isSet

information whether the preferred Width is now set.

Since:

BlackBerry 10.0.0

void rightPaddingChanged (
  • floatrightPadding)
Inherited

Emitted when the rightPadding property changes.

Parameters
rightPadding

The new right padding.

Since:

BlackBerry 10.0.0

void rotationZChanged (
  • floatrotationZ)
Inherited

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

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

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

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

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

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 topMarginChanged (
  • floattopMargin)
Inherited

Emitted when the topMargin of the control changes.

Parameters
topMargin

The new top margin for the control.

Since:

BlackBerry 10.0.0

void topMarginSetChanged (
  • boolisSet)
Inherited

Emitted when the topMarginSet of the control changes.

Parameters
isSet

information whether the preferred Width is now set.

Since:

BlackBerry 10.0.0

void topPaddingChanged (
  • floattopPadding)
Inherited

Emitted when the topPadding property changes.

Parameters
topPadding

The new top padding.

Since:

BlackBerry 10.0.0

void touch (Inherited

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

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

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

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

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

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

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

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

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 verticalAlignmentChanged (Inherited

Emitted when the verticalAlignment property changes.

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 verticalAlignment instead of newVerticalAlignment).

Parameters
newVerticalAlignment

The new vertical alignment for the control.

Since:

BlackBerry 10.0.0

void visibleChanged (
  • boolvisible)
Inherited

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

Last modified: 2014-09-30



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

comments powered by Disqus