ListView
Since: BlackBerry 10.0.0
#include <bb/cascades/ListView>
A scrollable container used to display a list of items.

The implementation of a ListView follows an MVC (model-view-controller) architecture, with the ListView representing the controller. It accepts input from the user (such as item selections or scrolling) and instructs the model and view to perform actions based on that input. The model for a ListView is provided by the DataModel, and is a requirement for every ListView. The view for a ListView can be handled a few different ways, and the implementation is different whether you're using C++ or QML. If you're using C++, the visuals are managed by ListItemProvider. If you're using QML, you'll likely use ListItemComponent (though it's also possible to use ListItemProvider).
A ListView must have a DataModel connected to it in order to show any list items. The DataModel is used to provide data for each item, which can be displayed in the view. The DataModel can contain items in a tree structure many levels deep, but ListView only shows items from the first two levels below the root element (see rootIndexPath).
A DataModel can come in a number of different forms, including XmlDataModel (data from an XML file), QListDataModel (a DataModel template that is very similar to a QList), and GroupDataModel (can contain QVariantMap objects and/or QObject pointers).
ListView takes ownership of any QObject object returned (wrapped in QVariant) by DataModel::data(), if the returned object doesn't already have a parent, and if the user type of the QVariant is QMetaType::QObjectStar. Custom QVariant types are ignored, even if the type in question inherits QObject. QObject objects owned by ListView are deleted when the item they belong to is scrolled out of the visible area, or when the ListView itself is deleted.
Creating a list
Here's how to create a simple list from an XmlDataModel. The XML source would be located in a file called model.xml. The root index path is changed to [1] so that only the European cities are displayed in the list, with no header item.
Page { content: Container { background: Color.White ListView { rootIndexPath: [1] dataModel: XmlDataModel { source: "model.xml" } } } }
<model> <header title="North America"> <item title="Toronto" /> <item title="New York" /> </header> <header title="Europe"> <item title="Copenhagen" /> <item title="Malmo" /> </header> </model>
List visuals in QML

In QML, it's possible to define list item visuals in two ways: using ListItemProvider or ListItemComponent. Because of the declarative nature of QML, using ListItemComponent is the preferred method.
A ListItemComponent is a QML template that's used by the ListView to present data from the model. A ListItemComponent can be attached to a ListView using the ListView::listItemComponents property, and it can contain whatever visual controls that you want to display in your list item.
If item visuals are created from a ListItemComponent, ListView makes the following properties available on the root element of the item visual:
ListItem.initialized - States whether the item visual is initialized or not. true when initialization of the item visual is finished (all properties have been updated to reflect the current item), false when the item visuals become disconnected due to recycling. Explicit animations etc must not be started when the value of initialized is false.
ListItem.data - The QVariant returned by DataModel::data() for this item. Typically a QVariantMap or QObject* which means that data has properties of its own (e.g. ListItem.data.firstName), but could also be just a QString if that's the kind of QVariant the currently connected DataModel returns.
ListItem.indexInSection - The index for this item amongst its siblings. The siblings are those items that have the same parent as this item.
ListItem.indexPath - The index path identifying this item in its DataModel.
ListItem.sectionSize - The number of child items that the parent item of this item has.
ListItem.view - The ListView in which this item is visible. The item is in a context separate from the ListView, so any symbols from the ListView context that are to be accessible from items must be placed as dynamic properties on the ListView.
ListItem.component - The ListItemComponent that this item visual has been created from. The item visuals are in a context of their own, so any symbols from the ListItemComponent context that are to be accessible from item visuals must be placed as dynamic properties on the ListItemComponent.
ListItem.active - true if this item is active, false otherwise. An item is typically active if the user is holding a finger on it.
ListItem.selected - true if this item is selected, false otherwise. An item is typically selected if the user intends to access details for the item, or to perform an action on the item.
The ListItem.* symbols listed above only have values on the root element in the item visuals, so they must be prefixed by the id of the root element if used on any element further down in the tree. For convenience, ListView therefore also makes the symbol ListItemData available as an alias for ListItem.data. In contrast to ListItem.data, ListItemData is available in the entire context of the item visual, so no prefix is needed.
Here's how to create a list in QML, with a contact list item:
ListView { dataModel: XmlDataModel { source: "model.xml" } listItemComponents: [ ListItemComponent { type: "contact" Container { id: itemRoot ImageView { image: ListItemData.imagePath opacity: itemRoot.ListItem.selected ? 1.0 : 0.5 } Label { text: ListItemData.name } } } ] }
A ListItemComponent has a different scope than the rest of a QML document. If you create a list in QML and need to access variables placed in the ListView in a ListItemComponent, you can access the variables using the ListItem.view property. If you need to access a property that is outside the scope of the ListView, you need to alias the property in the ListView before you can access it.
ListView { property string myText: "Example text" dataModel: XmlDataModel { source: "model.xml" } listItemComponents: [ ListItemComponent { type: "listItem" CustomListItem { id: itemRoot dividerVisible: true highlightAppearance: HighlightAppearance.Frame Container { Label { text: ListItemData.title + " " + itemRoot.ListItem.view.myText } } } } ] }
List visuals in C++

A ListItemProvider can be assigned to the ListView in order to provide VisualNode objects to be shown as items in the ListView. ListItemProvider::updateItem() is then called whenever an item visual should be updated with data for a specific item.
The VisualNode objects are recycled when scrolling in a ListView. Those scrolled out of the visible area are kept in an internal cache by ListView, in order to be connected to new data and used again when another item of the same type scrolls into the visible area. Therefore, it is not possible to store any states in the VisualNode objects, as all item specific data must be stored in the DataModel.
If the VisualNode objects implement the ListItemListener interface, ListView calls ListItemListener::reset() on them right before they are shown. ListView also calls ListItemListener::select() and ListItemListener::activate() whenever those visualization states should change for an already visible item.
The default list visuals
If no ListItemProvider is assigned and no ListItemComponent of a matching type can be found, the default behavior for ListView is to use Header for items of the type "header" and StandardListItem for all other types of items. This approach works great if you want just a standard list without any major visual customizations. Header and StandardListItem contain a standard set of visuals, including titles, descriptions, and images.
In this scenario the ListView tries to assign the data returned from DataModel::data() to Header::title or StandardListItem::title.
Here's a C++ example of a very simple ListView showing three StandardListItem items with "Hey", "Hello" and "Bye" as title texts:
ListView *pListView = new ListView(); pListView->setDataModel(new QListDataModel<QString> (QList<QString>() << "Hey" << "Hello" << "Bye"));
ListView calls DataModel::itemType() for each item in order to know its type. In QML this can be overridden by declaring the function itemType(data, indexPath) on the ListView element. The ListView then calls that function instead of the DataModel function.
Here's how to create a list in QML that creates a Header for all items on the top level, and a StandardListItem for each item below the top level:
ListView { dataModel: XmlDataModel { source: "model.xml" } function itemType(data, indexPath) { return (indexPath.length == 1 ? 'header' : 'item'); } }
If no itemType() function has been declared in QML, DataModel::itemType() can instead be overridden by assigning a ListItemTypeMapper in C++ by calling setListItemTypeMapper(). The ListView then calls ListItemTypeMapper::itemType() instead of the DataModel function.
Index paths
Index paths are used for identifying items in ListView, DataModel and all related classes. In C++, an index path is a QVariantList object containing a number of QVariant integers, one for each ancestor (including the root item) of the specified item. The reason for index paths being QVariantList objects in C++ is that QVariantList objects are the C++ equivalent of QML JavaScript arrays.
In QML, an index path is simply an array containing integers. For an item that is a direct child of the root item, the index path contains a single integer. A child of that item would instead have an index path consisting of two integers, etc.
Examples of index paths:
[3] - index path for the fourth child of the root item
[3,0] - index path for the first child of the fourth child of the root item
Example of accessing indexes from index paths in C++:
indexPath[0].toInt() - gets the top level index from this index path
indexPath[1].toInt() - gets the second level index from this index path (if the index path contains that many levels)
In the graphic below, the index path for 'A' would be [0] while the index for Astaroff Krytinisz would be [0,3], if the rootIndexPath is [] (an empty index path, i.e. the root of the DataModel).

See index paths for more information.
Multi selection
By default, selection is handled by the multiSelectHandler. Within the multiSelectHandler, you can define a set of actions that are invoked when multi selection occurs. These actions are used to populate the context menu that's displayed when you long-press on a control (in this case, the list item). For example, in an application that displays a list of images, the user might want to be able to select multiple pictures and delete them. In this case, you could use the multiSelectHandler to populate the context menu with the number of pictures that are being selected for deletion
Sizing
By default, the width and height are adjusted automatically to fill its parent container.
The width is adjustable using the Control::preferredWidth, Control::minWidth and Control::maxWidth properties.
The height is adjustable using the Control::preferredHeight, Control::minHeight and Control::maxHeight and properties.
ListView contains padding properties. Padding is applied to each side of the ListLayout used by the ListView, to create space between the list and any surrounding components. These padding properties can also support negative padding values.
Overview
Inheritance
bb::cascades::BaseObject | |||||
bb::cascades::UIObject | |||||
bb::cascades::VisualNode | |||||
bb::cascades::Control | |||||
bb::cascades::ListView |
QML properties
bufferedScrollingEnabled | : bool |
dataModel | : bb::cascades::DataModel |
flickMode | : bb::cascades::FlickMode::Type |
layout | : bb::cascades::ListLayout |
leadingVisual | : bb::cascades::VisualNode |
leadingVisualSnapThreshold | : float |
listItemProvider | : bb::cascades::ListItemProvider |
multiSelectAction | : bb::cascades::MultiSelectActionItem |
multiSelectHandler | : bb::cascades::MultiSelectHandler [read-only] |
rearrangeHandler | : bb::cascades::RearrangeHandler [read-only] |
rootIndexPath | : QVariantList |
scrollIndicatorMode | : bb::cascades::ScrollIndicatorMode::Type |
scrollRole | : bb::cascades::ScrollRole::Type |
snapMode | : bb::cascades::SnapMode::Type |
stickToEdgePolicy | : bb::cascades::ListViewStickToEdgePolicy::Type |
accessibility | : bb::cascades::AbstractA11yObject [read-only]![]() |
accessibilityMode | : bb::cascades::A11yMode::Type![]() |
attachedObjects | : QDeclarativeListProperty< QObject > [read-only]![]() |
keyListeners | : QDeclarativeListProperty [read-only]![]() |
bottomMargin | : float![]() |
bottomMarginSet | : bool [read-only]![]() |
bottomPadding | : float![]() |
builtInShortcutsEnabled | : bool![]() |
contextMenuHandler | : bb::cascades::ContextMenuHandler![]() |
enabled | : bool![]() |
focusAutoShow | : bb::cascades::FocusAutoShow::Type![]() |
focused | : bool [read-only]![]() |
focusPolicy | : bb::cascades::FocusPolicy::Type![]() |
focusRetentionPolicyFlags | : bb::cascades::FocusRetentionPolicy::Types![]() |
horizontalAlignment | : bb::cascades::HorizontalAlignment::Type![]() |
implicitLayoutAnimationsEnabled | : bool![]() |
inputRoute | : bb::cascades::InputRouteProperties [read-only]![]() |
layoutProperties | : bb::cascades::LayoutProperties![]() |
leftMargin | : float![]() |
leftMarginSet | : bool [read-only]![]() |
leftPadding | : float![]() |
locallyFocused | : bool![]() |
margin | : bb::cascades::Spacings [read-only]![]() |
maxHeight | : float![]() |
maxWidth | : float![]() |
minHeight | : float![]() |
minWidth | : float![]() |
navigation | : bb::cascades::Navigation [read-only]![]() |
objectName | : QString![]() |
opacity | : float![]() |
overlapTouchPolicy | : bb::cascades::OverlapTouchPolicy::Type![]() |
parent | : QObject [read-only]![]() |
pivotX | : float![]() |
pivotY | : float![]() |
preferredHeight | : float![]() |
preferredHeightSet | : bool [read-only]![]() |
preferredWidth | : float![]() |
preferredWidthSet | : bool [read-only]![]() |
rightMargin | : float![]() |
rightMarginSet | : bool [read-only]![]() |
rightPadding | : float![]() |
rotationZ | : float![]() |
scaleX | : float![]() |
scaleY | : float![]() |
topMargin | : float![]() |
topMarginSet | : bool [read-only]![]() |
topPadding | : float![]() |
touchPropagationMode | : bb::cascades::TouchPropagationMode::Type![]() |
translationX | : float![]() |
translationY | : float![]() |
ui | : bb::cascades::UIConfig [read-only]![]() |
verticalAlignment | : bb::cascades::VerticalAlignment::Type![]() |
visible | : bool![]() |
QML signals
Properties Index
Public Static Attributes Index
const QVariantList | AllItems |
Public Functions Index
ListView (Container *parent=0) | |
ListView (bb::cascades::DataModel *dataModel, Container *parent=0) | |
virtual | ~ListView () |
Q_SLOT void | clearSelection () |
DataModel * | dataModel () const |
bb::cascades::FlickMode::Type | flickMode () const |
bool | isBufferedScrollingEnabled () const |
Q_INVOKABLE bool | isSelected (const QVariantList &indexPath) const |
bb::cascades::ListLayout * | layout () const |
bb::cascades::VisualNode * | leadingVisual () const |
float | leadingVisualSnapThreshold () const |
ListItemProvider * | listItemProvider () const |
ListItemTypeMapper * | listItemTypeMapper () const |
bb::cascades::MultiSelectActionItem * | multiSelectAction () const |
bb::cascades::MultiSelectHandler * | multiSelectHandler () const |
Q_SLOT RearrangeHandler * | rearrangeHandler () |
Q_SLOT void | resetBufferedScrollingEnabled () |
Q_SLOT void | resetDataModel () |
Q_SLOT void | resetFlickMode () |
Q_SLOT void | resetLayout () |
Q_SLOT void | resetLeadingVisual () |
Q_SLOT void | resetLeadingVisualSnapThreshold () |
Q_SLOT void | resetListItemProvider () |
Q_SLOT void | resetListItemTypeMapper () |
Q_SLOT void | resetMultiSelectAction () |
Q_SLOT void | resetRootIndexPath () |
Q_SLOT void | resetScrollIndicatorMode () |
Q_SLOT void | resetScrollRole () |
Q_SLOT void | resetSnapMode () |
Q_SLOT void | resetStickToEdgePolicy () |
QVariantList | rootIndexPath () const |
Q_SLOT void | scroll (float offset, bb::cascades::ScrollAnimation::Type scrollAnimation=bb::cascades::ScrollAnimation::Default) |
bb::cascades::ScrollIndicatorMode::Type | scrollIndicatorMode () const |
bb::cascades::ScrollRole::Type | scrollRole () const |
Q_INVOKABLE QVariantList | scrollStops () const |
Q_SLOT void | scrollToItem (const QVariantList &indexPath, bb::cascades::ScrollAnimation::Type scrollAnimation=bb::cascades::ScrollAnimation::Default) |
Q_SLOT void | scrollToPosition (bb::cascades::ScrollPosition::Type position, bb::cascades::ScrollAnimation::Type scrollAnimation=bb::cascades::ScrollAnimation::Default) |
Q_SLOT void | select (const QVariantList &indexPath, bool select=true) |
Q_SLOT void | selectAll () |
Q_INVOKABLE QVariantList | selected () const |
Q_INVOKABLE QVariantList | selectionList () const |
Q_SLOT void | setBufferedScrollingEnabled (bool bufferedScrollingEnabled) |
Q_SLOT void | setDataModel (bb::cascades::DataModel *pDataModel) |
Q_SLOT void | setFlickMode (bb::cascades::FlickMode::Type mode) |
Q_SLOT void | setLayout (bb::cascades::ListLayout *layout) |
Q_SLOT void | setLeadingVisual (bb::cascades::VisualNode *pLeadingVisual) |
Q_SLOT void | setLeadingVisualSnapThreshold (float leadingVisualSnapThreshold) |
Q_SLOT void | setListItemProvider (bb::cascades::ListItemProvider *pItemProvider) |
void | setListItemTypeMapper (ListItemTypeMapper *pItemTypeMapper) |
Q_SLOT void | setMultiSelectAction (bb::cascades::MultiSelectActionItem *multiSelectAction) |
Q_SLOT void | setRootIndexPath (const QVariantList &rootIndexPath) |
Q_SLOT void | setScrollIndicatorMode (bb::cascades::ScrollIndicatorMode::Type mode) |
Q_SLOT void | setScrollRole (bb::cascades::ScrollRole::Type scrollRole) |
Q_INVOKABLE void | setScrollStops (const QVariantList &indexPaths) |
Q_SLOT void | setSnapMode (bb::cascades::SnapMode::Type mode) |
Q_SLOT void | setStickToEdgePolicy (bb::cascades::ListViewStickToEdgePolicy::Type policy) |
bb::cascades::SnapMode::Type | snapMode () const |
bb::cascades::ListViewStickToEdgePolicy::Type | stickToEdgePolicy () const |
Q_SLOT void | toggleSelection (const QVariantList &indexPath) |
bb::cascades::AbstractA11yObject * | accessibility () const ![]() |
bb::cascades::A11yMode::Type | accessibilityMode () const ![]() |
ActionSet * | actionSetAt (int index) const ![]() |
int | actionSetCount () const ![]() |
void | addActionSet (bb::cascades::ActionSet *actionSet)![]() |
void | addAnimation (AbstractAnimation *animation)![]() |
Q_INVOKABLE void | addEffect (bb::cascades::AbstractEffect *effect)![]() |
void | addEventHandler (AbstractEventHandler *eventHandler)![]() |
void | addGestureHandler (GestureHandler *gestureHandler)![]() |
Q_INVOKABLE void | addKeyListener (bb::cascades::KeyListener *keyListener)![]() |
Q_INVOKABLE void | addShortcut (bb::cascades::AbstractShortcut *shortcut)![]() |
void | addTouchBehavior (TouchBehavior *touchBehavior)![]() |
AbstractAnimation * | animationAt (int index) const ![]() |
int | animationCount () const ![]() |
float | bottomMargin () const ![]() |
float | bottomPadding () const ![]() |
Q_INVOKABLE bool | builtInShortcutsEnabled () const ![]() |
bb::cascades::ContextMenuHandler * | contextMenuHandler () const ![]() |
Q_INVOKABLE void | disableAllShortcuts ()![]() |
Q_INVOKABLE void | enableAllShortcuts ()![]() |
virtual bool | event (QEvent *event)![]() |
bb::cascades::FocusAutoShow::Type | focusAutoShow () const ![]() |
bb::cascades::FocusPolicy::Type | focusPolicy () const ![]() |
bb::cascades::FocusRetentionPolicy::Types | focusRetentionPolicyFlags ()![]() |
bb::cascades::HorizontalAlignment::Type | horizontalAlignment () const ![]() |
bool | implicitLayoutAnimationsEnabled () const ![]() |
bb::cascades::InputRouteProperties * | inputRoute () const ![]() |
bool | isBottomMarginSet () const ![]() |
bool | isEnabled () const ![]() |
bool | isFocused () const ![]() |
bool | isLeftMarginSet () const ![]() |
bool | isLocallyFocused () const ![]() |
bool | isPreferredHeightSet () const ![]() |
bool | isPreferredWidthSet () const ![]() |
bool | isRightMarginSet () const ![]() |
bool | isTopMarginSet () const ![]() |
bool | isVisible () const ![]() |
Q_INVOKABLE bb::cascades::KeyListener * | keyListenerAt (int index) const ![]() |
Q_INVOKABLE int | keyListenerCount () const ![]() |
bb::cascades::LayoutProperties * | layoutProperties () const ![]() |
float | leftMargin () const ![]() |
float | leftPadding () const ![]() |
Q_SLOT void | loseFocus ()![]() |
bb::cascades::Spacings * | margin ()![]() |
float | maxHeight () const ![]() |
float | maxWidth () const ![]() |
float | minHeight () const ![]() |
float | minWidth () const ![]() |
bb::cascades::Navigation * | navigation () const ![]() |
float | opacity () const ![]() |
bb::cascades::OverlapTouchPolicy::Type | overlapTouchPolicy () const ![]() |
float | pivotX () const ![]() |
float | pivotY () const ![]() |
float | preferredHeight () const ![]() |
float | preferredWidth () const ![]() |
bool | removeActionSet (bb::cascades::ActionSet *actionSet)![]() |
void | removeAllActionSets ()![]() |
void | removeAllAnimations ()![]() |
void | removeAllEventHandlers ()![]() |
void | removeAllGestureHandlers ()![]() |
Q_INVOKABLE void | removeAllKeyListeners ()![]() |
Q_INVOKABLE void | removeAllShortcuts ()![]() |
void | removeAllTouchBehaviors ()![]() |
bool | removeAnimation (AbstractAnimation *animation)![]() |
Q_INVOKABLE void | removeEffect (bb::cascades::AbstractEffect *effect)![]() |
bool | removeEventHandler (AbstractEventHandler *eventHandler)![]() |
bool | removeGestureHandler (GestureHandler *gestureHandler)![]() |
Q_INVOKABLE bool | removeKeyListener (bb::cascades::KeyListener *keyListener)![]() |
Q_INVOKABLE bool | removeShortcut (bb::cascades::AbstractShortcut *shortcut)![]() |
bool | removeTouchBehavior (TouchBehavior *touchBehavior)![]() |
Q_SLOT void | requestFocus ()![]() |
Q_SLOT void | resetAccessibilityMode ()![]() |
Q_SLOT void | resetBottomMargin ()![]() |
Q_SLOT void | resetBottomPadding ()![]() |
Q_INVOKABLE void | resetBuiltInShortcutsEnabled ()![]() |
Q_SLOT void | resetContextMenuHandler ()![]() |
Q_SLOT void | resetEnabled ()![]() |
Q_SLOT void | resetFocusAutoShow ()![]() |
Q_SLOT void | resetFocusPolicy ()![]() |
Q_SLOT void | resetFocusRetentionPolicyFlags ()![]() |
Q_SLOT void | resetHorizontalAlignment ()![]() |
Q_SLOT void | resetImplicitLayoutAnimationsEnabled ()![]() |
Q_SLOT void | resetLayoutProperties ()![]() |
Q_SLOT void | resetLeftMargin ()![]() |
Q_SLOT void | resetLeftPadding ()![]() |
Q_SLOT void | resetLocallyFocused ()![]() |
Q_SLOT void | resetMaxHeight ()![]() |
Q_SLOT void | resetMaxWidth ()![]() |
Q_SLOT void | resetMinHeight ()![]() |
Q_SLOT void | resetMinWidth ()![]() |
Q_SLOT void | resetOpacity ()![]() |
Q_SLOT void | resetOverlapTouchPolicy ()![]() |
Q_SLOT void | resetPivot ()![]() |
Q_SLOT void | resetPivotX ()![]() |
Q_SLOT void | resetPivotY ()![]() |
Q_SLOT void | resetPreferredHeight ()![]() |
Q_SLOT void | resetPreferredSize ()![]() |
Q_SLOT void | resetPreferredWidth ()![]() |
Q_SLOT void | resetRightMargin ()![]() |
Q_SLOT void | resetRightPadding ()![]() |
Q_SLOT void | resetRotationZ ()![]() |
Q_SLOT void | resetScale ()![]() |
Q_SLOT void | resetScaleX ()![]() |
Q_SLOT void | resetScaleY ()![]() |
Q_SLOT void | resetTopMargin ()![]() |
Q_SLOT void | resetTopPadding ()![]() |
Q_SLOT void | resetTouchPropagationMode ()![]() |
Q_SLOT void | resetTranslation ()![]() |
Q_SLOT void | resetTranslationX ()![]() |
Q_SLOT void | resetTranslationY ()![]() |
Q_SLOT void | resetVerticalAlignment ()![]() |
Q_SLOT void | resetVisible ()![]() |
float | rightMargin () const ![]() |
float | rightPadding () const ![]() |
float | rotationZ () const ![]() |
float | scaleX () const ![]() |
float | scaleY () const ![]() |
Q_SLOT void | setAccessibilityMode (bb::cascades::A11yMode::Type accessibilityMode)![]() |
Q_SLOT void | setBottomMargin (float bottomMargin)![]() |
Q_SLOT void | setBottomPadding (float bottomPadding)![]() |
Q_INVOKABLE void | setBuiltInShortcutEnabled (bb::cascades::SystemShortcuts::Type type, bool enabled)![]() |
Q_SLOT void | setBuiltInShortcutsEnabled (bool enabled)![]() |
void | setContextMenuHandler (bb::cascades::ContextMenuHandler *contextMenuHandler)![]() |
Q_SLOT void | setEnabled (bool enabled)![]() |
Q_SLOT void | setFocusAutoShow (const bb::cascades::FocusAutoShow::Type focusAutoShow)![]() |
Q_SLOT void | setFocusPolicy (const bb::cascades::FocusPolicy::Type focusPolicy)![]() |
Q_SLOT void | setFocusRetentionPolicyFlags (bb::cascades::FocusRetentionPolicy::Types policy)![]() |
Q_SLOT void | setHorizontalAlignment (bb::cascades::HorizontalAlignment::Type horizontalAlignment)![]() |
Q_SLOT void | setImplicitLayoutAnimationsEnabled (bool enable)![]() |
Q_SLOT void | setLayoutProperties (bb::cascades::LayoutProperties *layoutProperties)![]() |
Q_SLOT void | setLeftMargin (float leftMargin)![]() |
Q_SLOT void | setLeftPadding (float leftPadding)![]() |
Q_SLOT void | setLocallyFocused (bool locallyFocused)![]() |
Q_SLOT void | setMaxHeight (float maxHeight)![]() |
Q_SLOT void | setMaxWidth (float maxWidth)![]() |
Q_SLOT void | setMinHeight (float minHeight)![]() |
Q_SLOT void | setMinWidth (float minWidth)![]() |
void | setObjectName (const QString &name)![]() |
Q_SLOT void | setOpacity (float opacity)![]() |
Q_SLOT void | setOverlapTouchPolicy (bb::cascades::OverlapTouchPolicy::Type policy)![]() |
Q_SLOT void | setPivot (float pivotX, float pivotY)![]() |
Q_SLOT void | setPivotX (float pivotX)![]() |
Q_SLOT void | setPivotY (float pivotY)![]() |
Q_SLOT void | setPreferredHeight (float preferredHeight)![]() |
Q_SLOT void | setPreferredSize (float preferredWidth, float preferredHeight)![]() |
Q_SLOT void | setPreferredWidth (float preferredWidth)![]() |
Q_SLOT void | setRightMargin (float rightMargin)![]() |
Q_SLOT void | setRightPadding (float rightPadding)![]() |
Q_SLOT void | setRotationZ (float rotationZ)![]() |
Q_SLOT void | setScale (float scaleX, float scaleY)![]() |
Q_SLOT void | setScale (float scaleXY)![]() |
Q_SLOT void | setScaleX (float scaleX)![]() |
Q_SLOT void | setScaleY (float scaleY)![]() |
Q_SLOT void | setTopMargin (float topMargin)![]() |
Q_SLOT void | setTopPadding (float topPadding)![]() |
Q_SLOT void | setTouchPropagationMode (bb::cascades::TouchPropagationMode::Type mode)![]() |
Q_SLOT void | setTranslation (float translationX, float translationY)![]() |
Q_SLOT void | setTranslationX (float translationX)![]() |
Q_SLOT void | setTranslationY (float translationY)![]() |
Q_SLOT void | setVerticalAlignment (bb::cascades::VerticalAlignment::Type verticalAlignment)![]() |
Q_SLOT void | setVisible (bool visible)![]() |
Q_INVOKABLE bb::cascades::AbstractShortcut * | shortcutAt (int index) const ![]() |
Q_INVOKABLE int | shortcutCount () const ![]() |
virtual Q_INVOKABLE QString | toDebugString () const ![]() |
float | topMargin () const ![]() |
float | topPadding () const ![]() |
TouchPropagationMode::Type | touchPropagationMode () const ![]() |
float | translationX () const ![]() |
float | translationY () const ![]() |
Q_INVOKABLE bb::cascades::UIConfig * | ui () const ![]() |
bb::cascades::VerticalAlignment::Type | verticalAlignment () const ![]() |
Static Public Functions Index
Builder | create () |
Protected Functions Index
Only has inherited protected functions
BaseObject (QObject *parent=0)![]() | |
virtual void | connectNotify (const char *signal)![]() |
virtual void | disconnectNotify (const char *signal)![]() |
Signals Index
void | activationChanged (QVariantList indexPath, bool active) |
void | bufferedScrollingEnabledChanged (bool bEnabled) |
void | dataModelChanged (bb::cascades::DataModel *dataModel) |
void | flickModeChanged (bb::cascades::FlickMode::Type newFlickMode) |
void | layoutChanged (bb::cascades::ListLayout *layout) |
void | leadingVisualChanged (bb::cascades::VisualNode *pLeadingVisual) |
void | leadingVisualSnapThresholdChanged (float leadingVisualSnapThreshold) |
void | listItemProviderChanged (bb::cascades::ListItemProvider *listItemProvider) |
void | multiSelectActionChanged (bb::cascades::MultiSelectActionItem *multiSelectAction) |
void | rootIndexPathChanged (QVariantList rootIndexPath) |
void | scrollIndicatorModeChanged (bb::cascades::ScrollIndicatorMode::Type newScrollIndicatorMode) |
void | scrollRoleChanged (bb::cascades::ScrollRole::Type newScrollRole) |
void | selectionChanged (QVariantList indexPath, bool selected) |
void | selectionChangeEnded () |
void | selectionChangeStarted () |
void | snapModeChanged (bb::cascades::SnapMode::Type newSnapMode) |
void | stickToEdgePolicyChanged (bb::cascades::ListViewStickToEdgePolicy::Type newStickToEdgePolicy) |
void | triggered (QVariantList indexPath) |
void | accessibilityModeChanged (bb::cascades::A11yMode::Type newAccessibilityMode)![]() |
void | actionSetAdded (bb::cascades::ActionSet *actionSet)![]() |
void | actionSetRemoved (bb::cascades::ActionSet *actionSet)![]() |
void | bottomMarginChanged (float bottomMargin)![]() |
void | bottomMarginSetChanged (bool isSet)![]() |
void | bottomPaddingChanged (float bottomPadding)![]() |
void | builtInShortcutsEnabledChanged (bool builtInShortcutsEnabled)![]() |
void | contextMenuHandlerChanged (bb::cascades::ContextMenuHandler *contextMenuHandler)![]() |
void | creationCompleted ()![]() |
void | enabledChanged (bool enabled)![]() |
void | focusAutoShowChanged (bb::cascades::FocusAutoShow::Type newFocusAutoShow)![]() |
void | focusedChanged (bool focused)![]() |
void | focusPolicyChanged (bb::cascades::FocusPolicy::Type newFocusPolicy)![]() |
void | focusRetentionPolicyFlagsChanged (bb::cascades::FocusRetentionPolicy::Types policy)![]() |
void | horizontalAlignmentChanged (bb::cascades::HorizontalAlignment::Type newHorizontalAlignment)![]() |
void | implicitLayoutAnimationsEnabledChanged (bool implicitLayoutAnimationsEnabled)![]() |
void | layoutPropertiesChanged (bb::cascades::LayoutProperties *layoutProperties)![]() |
void | leftMarginChanged (float leftMargin)![]() |
void | leftMarginSetChanged (bool isSet)![]() |
void | leftPaddingChanged (float leftPadding)![]() |
void | locallyFocusedChanged (bool newLocallyFocused)![]() |
void | maxHeightChanged (float maxHeight)![]() |
void | maxWidthChanged (float maxWidth)![]() |
void | minHeightChanged (float minHeight)![]() |
void | minWidthChanged (float minWidth)![]() |
void | objectNameChanged (const QString &objectName)![]() |
void | opacityChanged (float opacity)![]() |
void | opacityChanging (float opacity)![]() |
void | overlapTouchPolicyChanged (bb::cascades::OverlapTouchPolicy::Type newOverlapTouchPolicy)![]() |
void | pivotXChanged (float pivotX)![]() |
void | pivotYChanged (float pivotY)![]() |
void | preferredHeightChanged (float preferredHeight)![]() |
void | preferredHeightSetChanged (bool isSet)![]() |
void | preferredWidthChanged (float preferredWidth)![]() |
void | preferredWidthSetChanged (bool isSet)![]() |
void | rightMarginChanged (float rightMargin)![]() |
void | rightMarginSetChanged (bool isSet)![]() |
void | rightPaddingChanged (float rightPadding)![]() |
void | rotationZChanged (float rotationZ)![]() |
void | rotationZChanging (float rotationZ)![]() |
void | scaleXChanged (float scaleX)![]() |
void | scaleXChanging (float scaleX)![]() |
void | scaleYChanged (float scaleY)![]() |
void | scaleYChanging (float scaleY)![]() |
void | topMarginChanged (float topMargin)![]() |
void | topMarginSetChanged (bool isSet)![]() |
void | topPaddingChanged (float topPadding)![]() |
void | touch (bb::cascades::TouchEvent *event)![]() |
void | touchCapture (bb::cascades::TouchEvent *event)![]() |
void | touchEnter (bb::cascades::TouchEnterEvent *event)![]() |
void | touchExit (bb::cascades::TouchExitEvent *event)![]() |
void | touchPropagationModeChanged (bb::cascades::TouchPropagationMode::Type newTouchPropagationMode)![]() |
void | translationXChanged (float translationX)![]() |
void | translationXChanging (float translationX)![]() |
void | translationYChanged (float translationY)![]() |
void | translationYChanging (float translationY)![]() |
void | verticalAlignmentChanged (bb::cascades::VerticalAlignment::Type newVerticalAlignment)![]() |
void | visibleChanged (bool visible)![]() |
Properties
bool
Enables the ListView to prebuffer item data during certain scroll operations in order to optimize quality and speed of layout operations.
This functionality is currently in an experimental stage and is disabled by default. It should be used with caution and followed up with thorough testing. Examples of risks involved when when using it:
Degraded performance. For example, if the contents of a ListView change continuously and rapidly, the buffered data can become unusable.
Scroll latency. Items of considerable byte size (e.g. containing large images) will introduce higher latency from the point of the API call to actually reaching visible target.
Currently doesn't support GridListLayout. When using this type of layout the buffering property will be silently ignored. For all other layout types, the buffering functionality (once enabled) will be effective for the remainder of the lifetime of the ListView.
scrollToItem(), scrollToPosition When scrolling to items or named positions with ScrollAnimation::None, all items required to fill the visible area of the listview will be transferred to the server cache before performing the actual scroll operation. The actual layout will be perceived as instant. However the latency until jumping to the target location is dependent on the workload of transferring the items to the server.
For any other kind of scroll operation or scroll animation, the buffer functionality is disabled.
BlackBerry 10.0.0
bb::cascades::DataModel
Specifies a DataModel to use as source for item data in this ListView.
The default value is 0, which means that no items are shown.
BlackBerry 10.0.0
bb::cascades::FlickMode::Type
Specifies the scroll behavior of the list in response to a flick gesture.
The default value is FlickMode::Default, which lets the framework decide the flick mode.
BlackBerry 10.0.0
bb::cascades::ListLayout
The ListLayout for the ListView.
How a ListView positions its items is determined by the type of layout it has. The default layout for a ListView is a StackListLayout, but you can also use GridListLayout and FlowListLayout.
BlackBerry 10.0.0
bb::cascades::VisualNode
An optional VisualNode that the ListView can use as a leading visual.
The leading visual is placed before the first item in the list and can be reached by dragging towards the beginning of the list.
The default value is 0.
BlackBerry 10.0.0
float
A fraction of the ListView size that determines if the ListView should snap back from its leading visual to its leading edge when scrolling ends.
The leading visual snap threshold is the fraction of the ListView size that determines how much of the leading visual that must be visible to prevent the ListView from snapping back to its leading edge when scrolling ends. For example a value of 0 will cause the ListView to never snap back from the leading visual, a value of 0.5 will cause the list view to snap back to its leading edge if scrolling ends with the leading visual occupying less than half of the ListView size in the layout direction.
The default value is 0.2.
BlackBerry 10.0.0
bb::cascades::ListItemProvider
Specifies a ListItemProvider to use as source for item visualizations in this ListView.
The default value is 0, which means that this ListView creates a Header for items of the type "header" and a StandardListItem for all other types of items. In that case this ListView also tries to assign the data returned from DataModel::data() to Header::title or StandardListItem::title.
BlackBerry 10.0.0
bb::cascades::MultiSelectActionItem
A global multi-select action to show in the context menu for the list items.
This property is mainly for convenience. Typically, when you want to show a multi-select action, you add it to an ActionSet on each list item. But for convenience, you can use this property to add a multi-select action for all the list items.
If a list item already has a MultiSelectActionItem added to it, this property will be ignored and the one added to the item will be used.
The list item must have an ActionSet in order for this multi-select action to be added to it. The ActionSet can be empty.
BlackBerry 10.0.0
bb::cascades::MultiSelectHandler
The handler used during multiple selection to populate the Context menu.
Activating the multi-select handler will put the ListView in multiple selection mode, which shows the context menu populated with the actions from this handler.
This is a grouped property, meaning there is always a multi-select handler attached to a ListView. For convenience this object has a default MultiSelectHandler::multiSelectAction object set on it. If this is not needed, you will need to remove or reset it manually.
ListView { id: theListView // This multi-select action will be placed inside the ActionSets of each // list item that doesn't have a MultiSelectActionItem of its own. multiSelectAction: MultiSelectActionItem {} multiSelectHandler { // These actions will be shown during multiple selection, while this // multiSelectHandler is active actions: [ ActionItem {title: "Multi-select action"}, DeleteActionItem {} ] status: "None selected" onActiveChanged: { if (active == true) { console.log("Multiple selection is activated"); } else { console.log("Multiple selection is deactivated"); } } } // Change the status text in the multiSelectHandler to show how many items // are selected onSelectionChanged: { if(selectionList().length > 1) { multiSelectHandler.status = selectionList().length + " items selected"; } else if(selectionList().length == 1) { multiSelectHandler.status = "1 item selected"; } else { multiSelectHandler.status = "None selected"; } } listItemComponents: [ ListItemComponent { id: photo // These actions will be shown in the Context Menu this list item is // long-pressed contextActions: [ ActionSet { ActionItem {title: "Single-select action"} DeleteActionItem {} } ] } ] }
BlackBerry 10.0.0
bb::cascades::RearrangeHandler
The handler used for managing interactive rearrange sessions controlled by user touch input.
Activating the rearrange handler will put the ListView in rearrange mode. Visual "grabber" overlays appears on all leaf items which then can be lifted and dragged by the user.
This is a grouped property, meaning there is always a rearrange handler attached to a ListView.
For more information about rearranging lists, see the [Rearranging lists documentation]("https://developer.blackberry.com/native/documentation/cascades/ui/lists/list_view_selection.html#rearranginglists").
BlackBerry 10.3.0
QVariantList
Specifies which node in the connected DataModel this ListView should use as the root.
The default value is an empty QVariantList, which means that the root node of the DataModel is used as root node by this ListView.
See index paths for more information.
BlackBerry 10.0.0
bb::cascades::ScrollIndicatorMode::Type
Specifies if and how a scroll indicator should be shown.
The default value is ScrollIndicatorMode::Default, which means that the framework decides if and how a scroll indicator is shown.
BlackBerry 10.0.0
bb::cascades::ScrollRole::Type
Indicates this control's scroll role on the page.
Scroll role is an abstract concept that indicates to the framework which scrollable control can be considered as main/root scrollable and therefore connected to various appropriate features such as automatically hiding the action bar. Typical characteristics for a main scrollable is that it covers a big part of the screen, that it doesn't have any siblings and that it doesn't have any other scrollable controls as ancestors. The action bar might not hide automatically when user scrolls list if there is not much content left to scroll list down. Controls with scrollRole set to bb::cascades::ScrollRole::None are ignored and can't become a main scrollable control of the page. All scrollable controls with scrollRole set to bb::cascades::ScrollRole::Main are considered as main scrollable controls of the page. Scrollable control with scrollRole set to bb::cascades::ScrollRole::Default might be considered as the main scrollable control of the page if it satisfies default requirements.
The default value is bb::cascades::ScrollRole::Default.
BlackBerry 10.1.0
bb::cascades::SnapMode::Type
Specifies if and how the scroll position should snap to items in the list.
If set to SnapMode::LeadingEdge, the ListView makes sure that, in a top-to-bottom layout, the first visible item is always aligned to the top of the ListView when the list is not in motion (that is, when the user is not touching and dragging the list). In a bottom-to-top layout, the bottom of the last visible item is aligned to the bottom of the ListView, and so on.

The illustration shows how the user can drag the list to a point where the top item is not aligned with the top of the visible area. If snapMode is set to SnapMode::LeadingEdge, ListView continues the scrolling after the user lifts their finger, until an item is aligned with the top of the visible area.
If the list is currently scrolled all the way to the beginning, or all the way to the end, ListView will not snap away from that position, regardless of what snap mode is currently set on this property.
The default value is SnapMode::Default, which lets the framework decide the snap mode.
BlackBerry 10.0.0
bb::cascades::ListViewStickToEdgePolicy::Type
Specifies how the list should stick to its edges when the list or its content changes size.
Changes in the DataModel, changing item size, list size or padding can trigger an instantaneous change in scroll position without the user interacting with the list. This property can be used to enable specific behavior in those cases when the scroll position is at the beginning or end.
The default value is ListViewStickToEdgePolicy::Default, which lets the framework decide.
BlackBerry 10.1.0
bb::cascades::AbstractA11yObject
Defines the control's accessibility object.
BlackBerry 10.2.0
bb::cascades::A11yMode::Type
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.
BlackBerry 10.2.0
QDeclarativeListProperty< QObject >
A hierarchical list of the UIObject's attached objects.
BlackBerry 10.0.0
QDeclarativeListProperty
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.
BlackBerry 10.0.0
BlackBerry 10.1.0
BlackBerry 10.1.0
float
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.
BlackBerry 10.0.0
bool
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
BlackBerry 10.0.0
float
The bottom padding for the control.
bool
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.
BlackBerry 10.2.0
bool
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.
BlackBerry 10.0.0
bb::cascades::FocusAutoShow::Type
Indicates whether a control should automatically be made visible when it receives focus.
The default focusAutoShow value is Default.
BlackBerry 10.0.0
bool
Indicates whether the control is focused.
If true the control is focused, if false it's not focused.
BlackBerry 10.0.0
bb::cascades::FocusPolicy::Type
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.
BlackBerry 10.0.0
bb::cascades::FocusRetentionPolicy::Types
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" }
BlackBerry 10.0.0
bb::cascades::HorizontalAlignment::Type
Specifies the HorizontalAlignment for the control.
The default alignment is HorizontalAlignment::Left.
BlackBerry 10.0.0
bool
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.
BlackBerry 10.0.0
bb::cascades::InputRouteProperties
Defines this control's role in the propagation of input events.
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!"));
BlackBerry 10.1.0
bb::cascades::LayoutProperties
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.
BlackBerry 10.0.0
float
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.
BlackBerry 10.0.0
bool
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
BlackBerry 10.0.0
float
The left padding for the control.
The default left padding is 0.
Negative padding values are supported in the ListView control, for all other controls negative padding is undefined.
BlackBerry 10.0.0
bool
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.
BlackBerry 10.3.1
bb::cascades::Spacings
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.
BlackBerry 10.3.0
float
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.
BlackBerry 10.0.0
float
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.
BlackBerry 10.0.0
float
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.
BlackBerry 10.0.0
float
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.
BlackBerry 10.0.0
QString
This property is overridden from QObject.
QObject::objectName().
BlackBerry 10.0.0
float
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).
BlackBerry 10.0.0
bb::cascades::OverlapTouchPolicy::Type
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.
The policy has no effect if propagation mode is TouchPropagationMode::None for the same visual node.
BlackBerry 10.0.0
QObject
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.
BlackBerry 10.0.0
float
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.
BlackBerry 10.0.0
float
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.
BlackBerry 10.0.0
float
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.
BlackBerry 10.0.0
bool
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.
BlackBerry 10.0.0
float
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.
BlackBerry 10.0.0
bool
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.
BlackBerry 10.0.0
float
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.
BlackBerry 10.0.0
bool
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
BlackBerry 10.0.0
float
The right padding for the control.
The default right padding is 0.
Negative padding values are supported in the ListView control, for all other controls negative padding is undefined.
BlackBerry 10.0.0
float
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.
BlackBerry 10.0.0
float
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).
BlackBerry 10.0.0
float
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).
BlackBerry 10.0.0
float
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.
BlackBerry 10.0.0
bool
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
BlackBerry 10.0.0
float
The top padding for the control.
bb::cascades::TouchPropagationMode::Type
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::Full means that touch events will be fully propagated to the visual node and it's subtree.
TouchPropagationMode::None means no touch events will be propagated to the visual node or its subtree. The subtree is practically invisible to the touch system.
TouchPropagationMode::PassThrough means touch events will not be handled by the visual node itself, but its subtree will get touch events as usual.
The default propagation mode is TouchPropagationMode::Full.
BlackBerry 10.0.0
float
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.
Layout for more details.
BlackBerry 10.0.0
float
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.
Layout for more details.
BlackBerry 10.0.0
bb::cascades::UIConfig
An object that gives access to unit conversion routines.
// 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));
Blackberry 10.3.0
bb::cascades::VerticalAlignment::Type
Specifies the VerticalAlignment for the control.
The default alignment is VerticalAlignment::Top.
BlackBerry 10.0.0
bool
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.
BlackBerry 10.0.0
Public Static Attributes
const QVariantList
A parameter sent by the selectionChanged() signal in response to the selectAll() and clearSelection() functions.
BlackBerry 10.0.0
Public Functions
Constructs a ListView with a parent.
If parent is not 0, the ownership of the constructed ListView is transfered to the parent.
Parameters | |
---|---|
parent |
The parent container or 0. The parent is optional and will default to 0 if not specified. |
BlackBerry 10.0.0
Constructs a ListView with an optional parent using a specified DataModel.
virtual
Destructor.
Q_SLOT void
Makes all items deselected.
This function does not cause signals to be emitted for individual items. Instead, a single selectionChanged() is emitted with ListView::AllItems and false as parameters.
BlackBerry 10.0.0
DataModel *
Gets the DataModel assigned to this ListView.
bb::cascades::FlickMode::Type
Gets the flickMode used by the ListView.
The flickMode currently used by the ListView.
BlackBerry 10.0.0
bool
Gets the bufferedScrollingEnabled property for the ListView.
The bufferedScrollingEnabled flag.
BlackBerry 10.0.0
Q_INVOKABLE bool
Checks if a specific item is currently selected.
Parameters | |
---|---|
indexPath |
Specifies an item in the DataModel connected to this ListView. See index paths for more information. |
true if the specified item is selected, false otherwise.
BlackBerry 10.0.0
bb::cascades::ListLayout *
If the layout has not been set to anything else, the default StackListLayout will be returned.
The layout of the ListView, or 0 if there's no layout associated with the ListView.
BlackBerry 10.0.0
bb::cascades::VisualNode *
Gets the leadingVisual property for the ListView.
Ownership of the leading visual will not be transferred from the ListView.
The leading visual.
BlackBerry 10.0.0
float
Gets the leadingVisualSnapThreshold property for the ListView.
The leading visual snap threshold.
BlackBerry 10.0.0
ListItemProvider *
Gets the ListItemProvider assigned to this ListView.
The ListItemProvider assigned to this ListView.
BlackBerry 10.0.0
ListItemTypeMapper *
Gets the ListItemTypeMapper assigned to this ListView.
The ListItemTypeMapper assigned to this ListView.
BlackBerry 10.0.0
bb::cascades::MultiSelectActionItem *
Returns the multiSelectAction to show in the context menu for the list items.
The multiSelectActionn or 0 if it is not set.
BlackBerry 10.0.0
bb::cascades::MultiSelectHandler *
Returns the multiSelectHandler set in this action.
The multiSelectHandler. This is never 0, since multiSelectHandler is a grouped property.
BlackBerry 10.0.0
Q_SLOT RearrangeHandler *
Retrieves the rearrange handler attached to the ListView.
The rearrange handler is used for 2-way communication between the application and the ListView during rearrange mode.
BlackBerry 10.3.0
Q_SLOT void
Resets the bufferedScrollingEnabled property to its default value of false.
BlackBerry 10.0.0
Q_SLOT void
Resets the DataModel reference in this ListView, effectively leaving the ListView without an assigned DataModel.
BlackBerry 10.0.0
Q_SLOT void
Resets the flickMode for the ListView to the default value (FlickMode::Default).
BlackBerry 10.0.0
Q_SLOT void
Resets the layout to the default layout.
BlackBerry 10.0.0
Q_SLOT void
Resets the leadingVisual property to its default value of 0.
BlackBerry 10.0.0
Q_SLOT void
Resets the leadingVisualSnapThreshold property to its default value of 0.2f.
BlackBerry 10.0.0
Q_SLOT void
Resets the ListItemProvider reference for this ListView, effectively leaving this ListView without an assigned ListItemProvider.
BlackBerry 10.0.0
Q_SLOT void
Resets ListView::listItemTypeMapper, effectively leaving this ListView without an assigned ListItemTypeMapper.
BlackBerry 10.0.0
Q_SLOT void
Resets the multiSelectAction to 0.
This means no multiSelectAction will be displayed in the context menu.
BlackBerry 10.0.0
Q_SLOT void
Resets the rootIndexPath to its default value.
This causes the ListView to reference the top level of its DataModel.
BlackBerry 10.0.0
Q_SLOT void
Resets the property ListView::scrollIndicatorMode to its default value, which is ScrollIndicatorMode::Default.
BlackBerry 10.0.0
Q_SLOT void
Resets a control's scrollRole property.
Default value is ScrollRole::Default.
BlackBerry 10.1.0
Q_SLOT void
Resets the snapMode for the ListView to the default value (SnapMode::Default).
BlackBerry 10.0.0
Q_SLOT void
Resets the stickToEdgePolicy used by this ListView to the default value (ListViewStickToEdgePolicy::Default).
BlackBerry 10.1.0
QVariantList
Gets the rootIndexPath used by the ListView when referencing data in the DataModel.
The rootIndexPath used by this ListView.
BlackBerry 10.0.0
Q_SLOT void
Scrolls the list with the specified pixel offset.
Specifying a positive offset value will scroll the list forward in scroll space regardless of item sort order. For example, in a vertical list positive offsets will always move scroll position from top to bottom, even if item sort order is set to bottom-to-top.
IMPORTANT: This function is intended to be used for short scrolling distances, preferably not targeting positions or items outside the current view. For longer scrolling operations it is recommended to use either scrollToItem() or scrollTo().
Parameters | |
---|---|
offset |
The positive or negative pixel offset to scroll the list. |
scrollAnimation |
The type of animation to be used when scrolling. |
BlackBerry 10.0.0
bb::cascades::ScrollIndicatorMode::Type
Returns the current value of the property ListView::scrollIndicatorMode.
The scroll indicator mode currently used by this ListView.
BlackBerry 10.0.0
bb::cascades::ScrollRole::Type
Gets the current ListView scrollRole.
The ListView scrollRole.
BlackBerry 10.1.0
Q_INVOKABLE QVariantList
Get the scrollStops currently specified for the ListView.
Note that the index paths retrieved by this method might differ from the list earlier passed to setScrollStops.
The scrollStops index paths as a QVariantList of QVariantList objects.
BlackBerry 10.0.0
Q_SLOT void
Scrolls to an item so that the item is placed in the top of the visible area of this ListView.
When this function is called on a device with a trackpad or similar input, and the ListView is focused or has a focused descendant, scrollToItem will try setting focus on the item being scrolled to at the end of the programmatic scroll.
Parameters | |
---|---|
indexPath |
Specifies which item to jump to. See index paths for more information. |
scrollAnimation |
Specifies which animation type to use when scrolling. |
BlackBerry 10.0.0
Q_SLOT void
Scrolls to a predefined position in this ListView.
Parameters | |
---|---|
position |
Specifies which position to scroll to. |
scrollAnimation |
Specifies which animation type to use when scrolling. |
BlackBerry 10.0.0
Q_SLOT void
Selects or deselects the specified item.
If the selection state of an item changes, the signal selectionChanged() is emitted.
Parameters | |
---|---|
indexPath |
Specifies an item in the DataModel connected to this ListView. See index paths for more information. |
select |
The value to set for the selected state of the specified item. |
toggleSelection(), isSelected(), selected(), selectionList()
BlackBerry 10.0.0
Q_SLOT void
Makes all items selected.
Does not cause signals to be emitted for individual items. Instead a single selectionChanged() is emitted with ListView::AllItems and true as parameters.
BlackBerry 10.0.0
Q_INVOKABLE QVariantList
Gets the index path of the selected item.
Index path of the first found selected item, or an empty QVariantList if no item is currently selected in this ListView.
select(), toggleSelection(), selectAll(), clearSelection(), isSelected(), selectionList()
BlackBerry 10.0.0
Q_INVOKABLE QVariantList
Gets a list of all selected items.
Returns a list of index paths for all the selected items. The returned list is of the type QVariantList so that it can be used in QML. Index paths are also QVariantList objects, so they can be used in QML. The returned object is a QVariantList containing other QVariantList objects (one such object for each selected item). The selection list is cleared when the MultiSelectHandler becomes inactive.
select(), toggleSelection(), selectAll(), clearSelection(), isSelected(), selected()
BlackBerry 10.0.0
Q_SLOT void
Sets the bufferedScrollingEnabled property to be used by this ListView.
Parameters | |
---|---|
bufferedScrollingEnabled |
The new value for the buffered scrolling property. |
BlackBerry 10.0.0
Q_SLOT void
Assigns a DataModel to this ListView.
This ListView will use the DataModel to populate itself with list items. If pDataModel has no parent, this ListView takes ownership of it and sets itself as parent to it (which means that ListView deletes it when ListView is deleted). Any previously set DataModel is unaffected by this call, its parent won't change, and it won't be deleted as a result of calling setDataModel().
Parameters | |
---|---|
pDataModel |
The DataModel to assign to this ListView. |
BlackBerry 10.0.0
Q_SLOT void
Sets the flickMode to be used by the ListView.
Parameters | |
---|---|
mode |
The new flickMode to use. |
BlackBerry 10.0.0
Q_SLOT void
Sets a layout on the ListView.
Once completed, ownership of the layout is assigned to the ListView.
Parameters | |
---|---|
layout |
The layout to be set on the ListView. |
BlackBerry 10.0.0
Q_SLOT void
Sets the leadingVisual property to be used by this ListView.
If pLeadingVisual has no parent, this ListView takes ownership of it and sets itself as parent to it (which means that ListView deletes it when ListView is deleted). Any previously set leading visual is unaffected by this call; its parent won't change and it won't be deleted as a result of calling setLeadingVisual().
Q_SLOT void
Sets the leadingVisualSnapThreshold property to be used by this ListView.
Parameters | |
---|---|
leadingVisualSnapThreshold |
The new leadingVisualSnapThreshold. |
BlackBerry 10.0.0
Q_SLOT void
Assigns a ListItemProvider to this ListView.
This ListView will use ListItemProvider when it needs to create or update its list items. If pItemProvider has no parent, ListView takes ownership of it and sets itself as parent of it (which means that ListView deletes it when ListView is deleted). Any previously set ListItemProvider is unaffected by this call, its parent won't change, and it won't be deleted as a result of calling setListItemProvider().
Parameters | |
---|---|
pItemProvider |
The ListItemProvider to assign to this ListView. |
BlackBerry 10.0.0
void
Assigns a ListItemTypeMapper to this ListView.
If this ListView has a ListItemTypeMapper, it calls ListItemTypeMapper::itemType() instead of DataModel::itemType() whenever the type of an item is needed.
ListView does not take ownership of the supplied ListItemTypeMapper. Instead, the caller of this function is responsible for deleting the ListItemTypeMapper when it is no longer needed. This can be accomplished by implementing the ListItemTypeMapper as a QObject, and setting this ListView as parent.
Parameters | |
---|---|
pItemTypeMapper |
The ListItemTypeMapper to assign to this ListView. |
BlackBerry 10.0.0
Q_SLOT void
Sets the multiSelectAction to show in the context menu for the list items.
The ListView will take the ownership of the multi-select action, so actions cannot be shared. If the action already has a parent or if multiSelectAction is 0, nothing will happen.
Parameters | |
---|---|
multiSelectAction |
The multiSelectAction to set. |
BlackBerry 10.0.0
Q_SLOT void
Sets the rootIndexPath for the ListView when it references data in the DataModel.
The default value is an empty QVariantList, which causes this ListView to reference the top level of the DataModel.
Parameters | |
---|---|
rootIndexPath |
The rootIndexPath to use. See index paths for more information. |
BlackBerry 10.0.0
Q_SLOT void
Sets a value for the property ListView::scrollIndicatorMode.
Parameters | |
---|---|
mode |
The new value for the property. |
BlackBerry 10.0.0
Q_SLOT void
Sets the ListView scrollRole.
Parameters | |
---|---|
scrollRole |
Specifies a control's ScrollRole value. |
BlackBerry 10.1.0
Q_INVOKABLE void
Sets the scrollStops index paths for the list.
Scrolling in the list will stop at the positions of the items located at the given index paths.
When items are added or removed in the list, the server will internally compensate by modifying the index paths to match the original items. As a result, the original list of index paths might differ from the actual one used on the server. In order to make changes in the list of stop items, it is recommended to first aquire it by using scrollStops() and make any modifications accordingly, rather than keeping the list that was originally passed to this function.
Here's a C++ example of setting two scroll stops on index path 0,2 and 2,2:
QVariantList stopIndexPaths, firstStop, secondStop; firstStop << 0 << 2; secondStop << 2 << 2; stopIndexPaths.push_back(firstStop); stopIndexPaths.push_back(secondStop); mListView->setScrollStops(stopIndexPaths);
Here's how to set the same scroll stops in QML:
setScrollStops([[0, 2], [2, 2]]);
The list will not make any compensation when signal DataModel::itemsChanged is received. In this case the client itself needs to provide an updated list of index paths.
Parameters | |
---|---|
indexPaths |
The list of index paths specifying the items to use as scroll stop points. This list is a nested QVariantList, i.e. each element of the list is in itself a QVariantList representing the index paths. Passing an empty list will remove all stop points. See index paths for more information. |
BlackBerry 10.0.0
Q_SLOT void
Sets the snapMode to be used by the ListView.
Parameters | |
---|---|
mode |
The new snapMode to use. |
BlackBerry 10.0.0
Q_SLOT void
Sets the stickToEdgePolicy to be used by this ListView.
Parameters | |
---|---|
policy |
The new stickToEdgePolicy policy to use. |
BlackBerry 10.1.0
bb::cascades::SnapMode::Type
Gets the snapMode used by the ListView.
The snapMode currently used by the ListView.
BlackBerry 10.0.0
bb::cascades::ListViewStickToEdgePolicy::Type
Gets the stickToEdgePolicy used by this ListView.
The stickToEdgePolicy currently used by this ListView.
BlackBerry 10.1.0
Q_SLOT void
Toggles selection on an item.
If the item is selected, it becomes deselected. If the item is deselected, it becomes selected.
After the selection is toggled, the signal selectionChanged() is emitted.
Parameters | |
---|---|
indexPath |
Specifies an item in the DataModel connected to this ListView. See index paths for more information. |
BlackBerry 10.0.0
bb::cascades::AbstractA11yObject * 
Returns the accessibility object.
The accessibility object.
bb::cascades::A11yMode::Type 
Return the current value of the accessibilityMode property.
The A11yMode of the control.
BlackBerry 10.2.0
ActionSet * 
Returns an ActionSet at a specified index.
Ownership of the ActionSet object remains with the control.
Control::contextActions
Parameters | |
---|---|
index |
The index of the ActionSet. |
The requested ActionSet if the index was valid, 0 otherwise.
BlackBerry 10.0.0
int 
Returns the number of ActionSet objects.
Control::contextActions
The number of ActionSet objects.
BlackBerry 10.0.0
void 
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.
Control::contextActions
Parameters | |
---|---|
actionSet |
The ActionSet to add to the Control. |
BlackBerry 10.0.0
void 
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. |
removeAnimation(), removeAllAnimation(), animationCount(), animationAt()
BlackBerry 10.0.0
Q_INVOKABLE void 
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 effect was previously assigned to a different node, ownership is transferred to the new node. |
BlackBerry 10.3.1
void 
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. |
removeEventHandler(), removeAllEventHandlers(), bb::cascades::EventHandler
BlackBerry 10.3.0
void 
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. |
BlackBerry 10.0.0
Q_INVOKABLE void 
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. |
BlackBerry 10.1.0
Q_INVOKABLE void 
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. |
BlackBerry 10.1.0
void 
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. |
removeTochBehavior(), removeAllTouchBehaviors(), bb::cascades::TouchBehavior
BlackBerry 10.0.0
AbstractAnimation * 
Returns an animation added at a specified index.
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; |
The animation at the specified index; 0 if the index was out of range. The ownership is not changed by this call.
BlackBerry 10.0.0
int 
Returns the number of animations added to the visual node.
for (int i = 0; i < animationCount(); ++i) { AbstractAnimation* animation = animationAt(i); ... }
The number of animations added to the visual node.
BlackBerry 10.0.0
float 
Returns the bottomMargin for the control.
The bottom margin for the control.
BlackBerry 10.0.0
float 
Returns the bottom padding on the control.
The bottom padding.
BlackBerry 10.0.0
Q_INVOKABLE bool 
Returns an builtInShortcutsEnabled property value.
true if builtInShortcutsEnabled property is set to true and false otherwise
BlackBerry 10.2.0
Q_INVOKABLE void 
Disables all shortcuts attached to the Control.
Shortcuts that are attached afterward will use the default enabled state.
BlackBerry 10.1.0
Q_INVOKABLE void 
Enables all shortcuts attached to the Control.
BlackBerry 10.1.0
virtual bool 
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 | |
---|---|
event |
The received event. |
True if the received event was recognized and processed, false otherwise.
BlackBerry 10.0.0
bb::cascades::FocusAutoShow::Type 
Returns the focusAutoShow property of the control.
The focusAutoShow state of the control
BlackBerry 10.0.0
bb::cascades::FocusPolicy::Type 
Returns the focusPolicy property of the control.
The focusPolicy state of the control as a FocusPolicy
BlackBerry 10.0.0
bb::cascades::FocusRetentionPolicy::Types 
Gets the focus retention policy.
The policy describes under which condtions the control will lose focus
The focus retention policy for this control.
BlackBerry 10.0.0
bb::cascades::HorizontalAlignment::Type 
Returns the horizontal alignment for the control.
The horizontal alignment for the control.
BlackBerry 10.0.0
bool 
Return the current value of the implicitLayoutAnimationsEnabled property.
If true layout changes will implicitely trigger animations, if false the animations are disabled.
BlackBerry 10.0.0
bb::cascades::InputRouteProperties * 
Returns the input route properties object.
The input route properties object.
BlackBerry 10.1.0
bool 
Indicates whether the bottomMargin of the control is set.
true if the bottom margin is set, false otherwise.
BlackBerry 10.0.0
bool 
Returns the enabled state of the control.
true if the control is enabled, false otherwise.
BlackBerry 10.0.0
bool 
Returns the focused state of the control.
true if the control is focused, false otherwise.
BlackBerry 10.0.0
bool 
Indicates whether the leftMargin of the control is set.
true if the left margin is set, false otherwise.
BlackBerry 10.0.0
bool 
Returns the locallyFocused state of the control.
true if the controls locallyFocused property is set, false otherwise.
BlackBerry 10.3.1
bool 
Indicates whether the preferredHeight of the control is set.
true if the preferred height is set, false otherwise.
BlackBerry 10.0.0
bool 
Indicates whether the preferredWidth of the control is set.
true if the preferred width is set, false otherwise.
BlackBerry 10.0.0
bool 
Indicates whether the rightMargin of the control is set.
true if the right margin is set, false otherwise.
BlackBerry 10.0.0
bool 
Indicates whether the topMargin of the control is set.
true if the top margin is set, false otherwise.
BlackBerry 10.0.0
bool 
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.
BlackBerry 10.0.0
true if the visual node is visible, false otherwise.
BlackBerry 10.0.0
Q_INVOKABLE bb::cascades::KeyListener * 
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. |
The requested key listener if the index was valid, 0 otherwise.
BlackBerry 10.1.0
Q_INVOKABLE int 
Returns the number of key listeners.
The number of key listeners.
BlackBerry 10.1.0
bb::cascades::LayoutProperties * 
Returns the LayoutProperties object for the control.
Ownership of the LayoutProperties object remains unchanged.
The layout properties for the control.
BlackBerry 10.0.0
float 
Returns the leftMargin for the control.
The left margin for the control.
BlackBerry 10.0.0
float 
Returns the left padding on the control.
The left padding.
BlackBerry 10.0.0
Q_SLOT void 
Called when the control should lose its focus.
If succeeded, the focusedChanged() signal is emitted with false as its parameter.
BlackBerry 10.0.0
bb::cascades::Spacings * 
Returns the margin group property for the control.
The margin property for the control.
BlackBerry 10.3.0
float 
Returns the maxHeight of the control.
The maximum height of the control.
BlackBerry 10.0.0
float 
Returns the maxWidth of the control.
The maximum width of the control.
BlackBerry 10.0.0
float 
Returns the minHeight of the control.
The minimum height of the control.
BlackBerry 10.0.0
float 
Returns the minWidth of the control.
The minimum width of the control.
BlackBerry 10.0.0
float 
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).
BlackBerry 10.0.0
A value between between 0.0 (transparent) and 1.0 (opaque).
BlackBerry 10.0.0
bb::cascades::OverlapTouchPolicy::Type 
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.
The policy has no effect if propagation mode is TouchPropagationMode::None for the same visual node.
BlackBerry 10.0.0
The overlap touch policy for the visual node.
BlackBerry 10.0.0
float 
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.
BlackBerry 10.0.0
The position of pivot point along the x-axis, relative to the center of the visual node.
BlackBerry 10.0.0
float 
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.
BlackBerry 10.0.0
The position of pivot point along the y-axis, relative to the center of the visual node.
BlackBerry 10.0.0
float 
Returns the preferredHeight of the control.
To check whether the preferred height is set for a control, call isPreferredHeightSet().
The preferred height of a control as a positive number, or 0 if the preferred width is not set.
BlackBerry 10.0.0
float 
Returns the preferredWidth of the control.
To check whether the preferred width is set for the control, call isPreferredWidthSet().
The preferred width of a control as a positive number, or 0 if the preferred width is not set.
BlackBerry 10.0.0
bool 
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.
Control::contextActions
Parameters | |
---|---|
actionSet |
The actionSet to remove. |
true if the ActionSet was owned by the Control, false otherwise.
BlackBerry 10.0.0
void 
Removes all ActionSet objects from the control and deletes them.
Once completed, the actionSetRemoved() signal is emitted with 0 as its parameter.
Control::contextActions
BlackBerry 10.0.0
void 
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.
removeAnimation(), animationCount(), animationAt(), addAnimation()
BlackBerry 10.0.0
void 
Removes and deletes all event handlers currently added to this visual node.
BlackBerry 10.3.0
void 
Removes and deletes all gesture handlers currently added to this visual node.
BlackBerry 10.0.0
Q_INVOKABLE void 
Removes all of a Control's key listeners and frees up their memory.
BlackBerry 10.1.0
Q_INVOKABLE void 
Removes all of a control's shortcuts and frees up their memory.
BlackBerry 10.1.0
void 
Removes and deletes all touch behaviors currently added to this visual node.
BlackBerry 10.0.0
bool 
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).
for (int i = 0; i < animationCount(); ++i) { AbstractAnimation* animation = animationAt(i); removeAnimation(animation); delete animation; }
removeAllAnimation(), animationCount(), animationAt(), addAnimation()
Parameters | |
---|---|
animation |
The animation to remove. |
Returns False of the animation to remove wasn't added to the visual node or if the animation was 0, true otherwise.
BlackBerry 10.0.0
Q_INVOKABLE void 
Removes an effect from the visual node.
Parameters | |
---|---|
effect |
The effect to remove. The ownership of the effect will remain with the node until the effect is either deleted or set as an effect on another node. |
BlackBerry 10.3.1
bool 
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. |
false if the event handler to remove wasn't removed from the visual node or if the event handler was 0, true otherwise.
BlackBerry 10.3.0
bool 
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. |
false if the gesture handler to remove wasn't removed from the visual node or if the gesture handler was 0, true otherwise.
BlackBerry 10.0.0
Q_INVOKABLE bool 
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. |
true if the key listener was owned by the Control, false otherwise.
BlackBerry 10.1.0
Q_INVOKABLE bool 
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. |
true if the shortcut was owned by the Control, false otherwise.
BlackBerry 10.1.0
bool 
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. |
Returns False if the touch behavior to remove wasn't removed from the visual node or if the touch behavior was 0, true otherwise.
BlackBerry 10.0.0
Q_SLOT void 
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.
BlackBerry 10.0.0
Q_SLOT void 
Resets the accessibilityMode property to its default value of Default.
BlackBerry 10.2.0
Q_SLOT void 
Resets the bottom padding to its default.
The default bottom padding is 0.
After the padding is reset, the bottomPaddingChanged() signal is emitted.
BlackBerry 10.0.0
Q_INVOKABLE void 
Resets an builtInShortcutsEnabled property to default value.
Default value is true.
BlackBerry 10.2.0
Q_SLOT void 
Resets the focusPolicy to its default value of FOCUSPOLICY_NONE.
BlackBerry 10.0.0
Q_SLOT void 
Reset the focus retention policy to default value.
BlackBerry 10.0.0
Q_SLOT void 
Resets the horizontal alignment to its default.
The default alignment is HorizontalAlignment::Left.
After the horizontal alignment is reset, the horizontalAlignmentChanged() signal is emitted.
BlackBerry 10.0.0
Q_SLOT void 
Resets the implicitLayoutAnimationsEnabled property to its default value.
BlackBerry 10.0.0
Q_SLOT void 
Resets the layoutProperties for the control to 0 (automatic selection of LayoutProperties).
BlackBerry 10.0.0
Q_SLOT void 
Resets the left padding to its default.
The default left padding is 0.
After the padding is reset, the leftPaddingChanged() signal is emitted.
BlackBerry 10.0.0
Q_SLOT void 
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).
BlackBerry 10.0.0
BlackBerry 10.0.0
Q_SLOT void 
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.
The policy has no effect if propagation mode is TouchPropagationMode::None for the same visual node.
BlackBerry 10.0.0
BlackBerry 10.0.0
Q_SLOT void 
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.
BlackBerry 10.0.0
BlackBerry 10.0.0
Q_SLOT void 
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.
BlackBerry 10.0.0
BlackBerry 10.0.0
Q_SLOT void 
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.
BlackBerry 10.0.0
BlackBerry 10.0.0
Q_SLOT void 
Resets the preferredHeight to its default value of 0.
BlackBerry 10.0.0
Q_SLOT void 
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().
BlackBerry 10.0.0
Q_SLOT void 
Resets the right padding to its default.
The default right padding is 0.
After the padding is reset, the rightPaddingChanged() signal is emitted.
BlackBerry 10.0.0
Q_SLOT void 
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.
BlackBerry 10.0.0
resetRotation()
BlackBerry 10.0.0
Q_SLOT void 
Resets the scale factor for all axis to 1.0 (no scaling).
BlackBerry 10.0.0
Q_SLOT void 
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).
BlackBerry 10.0.0
BlackBerry 10.0.0
Q_SLOT void 
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).
BlackBerry 10.0.0
BlackBerry 10.0.0
Q_SLOT void 
Resets the top padding to its default.
The default top padding is 0.
After the padding is reset, the topPaddingChanged() signal is emitted.
BlackBerry 10.0.0
Q_SLOT void 
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::Full means that touch events will be fully propagated to the visual node and it's subtree.
TouchPropagationMode::None means no touch events will be propagated to the visual node or its subtree. The subtree is practically invisible to the touch system.
TouchPropagationMode::PassThrough means touch events will not be handled by the visual node itself, but its subtree will get touch events as usual.
The default propagation mode is TouchPropagationMode::Full.
BlackBerry 10.0.0
BlackBerry 10.0.0
Q_SLOT void 
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.
Layout for more details.
BlackBerry 10.0.0
BlackBerry 10.0.0
Q_SLOT void 
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.
Layout for more details.
BlackBerry 10.0.0
BlackBerry 10.0.0
Q_SLOT void 
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.
Layout for more details.
BlackBerry 10.0.0
BlackBerry 10.0.0
Q_SLOT void 
Resets the vertical alignment to its default.
The default alignment is VerticalAlignment::Top.
After the vertical alignment is reset, the verticalAlignmentChanged() signal is emitted.
BlackBerry 10.0.0
Q_SLOT void 
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.
BlackBerry 10.0.0
BlackBerry 10.0.0
float 
Returns the rightMargin for the control.
The right margin for the control.
BlackBerry 10.0.0
float 
Returns the right padding on the control.
The right padding.
BlackBerry 10.0.0
float 
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.
BlackBerry 10.0.0
The rotation around the z-axis in degrees.
BlackBerry 10.0.0
float 
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).
BlackBerry 10.0.0
The scale factor along the x-axis.
BlackBerry 10.0.0
float 
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).
BlackBerry 10.0.0
The scale factor along the y-axis.
BlackBerry 10.0.0
Q_SLOT void 
Controls how the control is exposed to assistive technologies.
Parameters | |
---|---|
accessibilityMode |
The A11yMode to set on the control |
BlackBerry 10.2.0
Q_SLOT void 
Sets the bottomMargin for the control.
Parameters | |
---|---|
bottomMargin |
The bottom margin for control; must be greater than or equal to 0.0. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the bottom padding for the control.
After the padding is set, the bottomPaddingChanged() signal is emitted.
Parameters | |
---|---|
bottomPadding |
The new left padding. |
BlackBerry 10.0.0
Q_INVOKABLE void 
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.
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. |
BlackBerry 10.2.0
Q_SLOT void 
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. |
BlackBerry 10.2.0
Q_SLOT void 
Sets the enabled state of the control.
Parameters | |
---|---|
enabled |
If true the control is enabled and if false the control is disabled. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the focusAutoShow of the control.
Parameters | |
---|---|
focusAutoShow |
The focusAutoShow state of the Control. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the focusPolicy of the control.
Parameters | |
---|---|
focusPolicy |
The focusPolicy state of the Control as a FocusPolicy. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the focus retention policy.
The policy describes under which condtions the control will lose focus.
Parameters | |
---|---|
policy |
The new policy. |
BlackBerry 10.0.0
Q_SLOT void 
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. |
BlackBerry 10.0.0
Q_SLOT void 
Controls whether layout changes trigger automatic animations or not.
Parameters | |
---|---|
enable |
If true trigger animations, if false do not |
BlackBerry 10.0.0
Q_SLOT void 
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. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the leftMargin for the control.
Parameters | |
---|---|
leftMargin |
The left margin for control; must be greater than or equal to 0.0. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the left padding for the control.
After the padding is set, the leftPaddingChanged() signal is emitted.
Parameters | |
---|---|
leftPadding |
The new left padding. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the locallyFocused of the control.
Parameters | |
---|---|
locallyFocused |
The locallyFocused state of the Control. |
BlackBerry 10.3.1
Q_SLOT void 
Sets the maxHeight of the control.
Parameters | |
---|---|
maxHeight |
The new maximum height of the control; must be greater than or equal to 0.0. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the maxWidth of the control.
Parameters | |
---|---|
maxWidth |
The new maximum width of the control; must be greater than or equal to 0.0. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the minHeight of the control.
Parameters | |
---|---|
minHeight |
The new minimum height of the control; must be greater than or equal to 0.0. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the minWidth of the control.
Parameters | |
---|---|
minWidth |
The new minimum width of the control; must be greater than or equal to 0.0. |
BlackBerry 10.0.0
void 
Sets the objectName property.
Parameters | |
---|---|
name |
The new name for the object. |
BlackBerry 10.0.0
Q_SLOT void 
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).
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]. |
BlackBerry 10.0.0
Q_SLOT void 
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.
The policy has no effect if propagation mode is TouchPropagationMode::None for the same visual node.
BlackBerry 10.0.0
Parameters | |
---|---|
policy |
The new overlap touch policy for the visual node. |
BlackBerry 10.0.0
Q_SLOT void 
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.
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. |
BlackBerry 10.0.0
Q_SLOT void 
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.
BlackBerry 10.0.0
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. |
BlackBerry 10.0.0
Q_SLOT void 
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.
BlackBerry 10.0.0
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. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the preferredHeight of the control.
Parameters | |
---|---|
preferredHeight |
The preferred height of the control as a positive, non-zero number. |
BlackBerry 10.0.0
Q_SLOT void 
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. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the preferredWidth of the control.
Parameters | |
---|---|
preferredWidth |
The preferred width of the control as a positive, non-zero number. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the rightMargin for the control.
Parameters | |
---|---|
rightMargin |
The right margin for control; must be greater than or equal to 0.0. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the right padding for the control.
After the padding is set, the rightPaddingChanged() signal is emitted.
Parameters | |
---|---|
rightPadding |
The new left padding. |
BlackBerry 10.0.0
Q_SLOT void 
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.
BlackBerry 10.0.0
Parameters | |
---|---|
rotationZ |
The rotation around the z-axis in degrees, anchored at (pivotX and pivotY). |
BlackBerry 10.0.0
Q_SLOT void 
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. |
BlackBerry 10.0.0
Q_SLOT void 
Convenience function for setting the same scale factor for all axes.
Parameters | |
---|---|
scaleXY |
The scale factor to set for all axes. |
BlackBerry 10.0.0
Q_SLOT void 
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).
BlackBerry 10.0.0
Parameters | |
---|---|
scaleX |
The scale factor along the x-axis, anchored at pivotX. |
BlackBerry 10.0.0
Q_SLOT void 
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).
BlackBerry 10.0.0
Parameters | |
---|---|
scaleY |
The scale factor along the y-axis, anchored at pivotY. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the topMargin for the control.
Parameters | |
---|---|
topMargin |
The top margin for control; must be greater than or equal to 0.0. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the top padding for the control.
After the padding is set, the topPaddingChanged() signal is emitted.
Parameters | |
---|---|
topPadding |
The new left padding. |
BlackBerry 10.0.0
Q_SLOT void 
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::Full means that touch events will be fully propagated to the visual node and it's subtree.
TouchPropagationMode::None means no touch events will be propagated to the visual node or its subtree. The subtree is practically invisible to the touch system.
TouchPropagationMode::PassThrough means touch events will not be handled by the visual node itself, but its subtree will get touch events as usual.
The default propagation mode is TouchPropagationMode::Full.
BlackBerry 10.0.0
Parameters | |
---|---|
mode |
The new touch propagation mode for the visual node. |
BlackBerry 10.0.0
Q_SLOT void 
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.
Layout for more details.
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). |
BlackBerry 10.0.0
Q_SLOT void 
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.
Layout for more details.
BlackBerry 10.0.0
setTranslation(float, float), setTranslation(float, float, float)
Parameters | |
---|---|
translationX |
The translation along the the x-axis (pointing towards right). |
BlackBerry 10.0.0
Q_SLOT void 
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.
Layout for more details.
BlackBerry 10.0.0
setTranslation(float, float), setTranslation(float, float, float)
Parameters | |
---|---|
translationY |
The translation along the the y-axis (pointing downwards). |
BlackBerry 10.0.0
Q_SLOT void 
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. |
BlackBerry 10.0.0
Q_SLOT void 
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.
BlackBerry 10.0.0
Parameters | |
---|---|
visible |
True to make the visual node visible, false otherwise. |
BlackBerry 10.0.0
Q_INVOKABLE bb::cascades::AbstractShortcut * 
Returns a shortcut at the specified index.
Ownership of the shortcut remains with the Control.
Parameters | |
---|---|
index |
The index of the shortcut. |
The requested shortcut if the index was valid, 0 otherwise.
BlackBerry 10.1.0
Q_INVOKABLE int 
Returns the number of shortcuts.
The number of shortcuts.
BlackBerry 10.1.0
virtual Q_INVOKABLE QString 
Returns a debug string representing this object.
A debug string for the object.
BlackBerry 10.0.0
float 
Returns the topMargin for the control.
The top margin for the control.
BlackBerry 10.0.0
float 
Returns the top padding on the control.
The top padding.
BlackBerry 10.0.0
TouchPropagationMode::Type 
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::Full means that touch events will be fully propagated to the visual node and it's subtree.
TouchPropagationMode::None means no touch events will be propagated to the visual node or its subtree. The subtree is practically invisible to the touch system.
TouchPropagationMode::PassThrough means touch events will not be handled by the visual node itself, but its subtree will get touch events as usual.
The default propagation mode is TouchPropagationMode::Full.
BlackBerry 10.0.0
The touch propagation mode for the visual node.
BlackBerry 10.0.0
float 
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.
Layout for more details.
BlackBerry 10.0.0
The translation along the the x-axis (pointing towards right).
BlackBerry 10.0.0
float 
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.
Layout for more details.
BlackBerry 10.0.0
The translation along the the y-axis (pointing downwards).
BlackBerry 10.0.0
Q_INVOKABLE bb::cascades::UIConfig * 
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.
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));
The UIConfig for this ui object.
BlackBerry 10.3.0
bb::cascades::VerticalAlignment::Type 
Returns the vertical alignment for the control.
The vertical alignment for the control.
BlackBerry 10.0.0
Static Public Functions
Builder
Creates and returns a builder for constructing a ListView.
This creator takes no ListLayout parameter. This is the equivalent to using the ListView constructor, which takes a ListLayout parameter and passes a StackListLayout with LayoutOrientation::TopToBottom.
A builder for constructing a ListView.
BlackBerry 10.0.0
Protected Functions
(Only has inherited protected functions)
Constructs an instance of BaseObject's subclass.
Parameters | |
---|---|
parent |
An optional parent, defaults to 0. |
BlackBerry 10.0.0
virtual void 
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. |
BlackBerry 10.0.0
virtual void 
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. |
BlackBerry 10.0.0
Signals
void
Emitted when the activation state has changed for a list item.
A list item is typically active while the user is pressing the item. Once released, the item is no longer active.
If the item implements the ListItemListener interface, ListView also calls ListItemListener::active() whenever the active state of the item is changed.
Parameters | |
---|---|
indexPath |
The index path to the item. See index paths for more information. |
active |
true if the new state is active, false otherwise. |
BlackBerry 10.0.0
void
Emitted when the bufferedScrollingEnabled property has changed.
Parameters | |
---|---|
bEnabled |
The new buffered scrolling value. |
BlackBerry 10.0.0
void
Emitted when ListView::dataModel has changed.
Parameters | |
---|---|
dataModel |
The new DataModel. |
BlackBerry 10.0.0
void
Emitted when ListView::flickMode has changed.
Due to a work around for a Qt Core issue with accessing enums from QML, the argument of this signal doesn't follow the usual naming convention for signals. Typically, signal arguments are named to match the associated property's name. In this case, you must use the object's property to access the current property value instead of the signal argument to avoid runtime errors (use flickMode instead of newFlickMode).
Parameters | |
---|---|
newFlickMode |
The new flick mode. |
BlackBerry 10.0.0
void
Emitted when a new layout is set on the ListView.
Parameters | |
---|---|
layout |
The new layout. |
BlackBerry 10.0.0
void
Emitted when the leadingVisual for the ListView has changed.
Parameters | |
---|---|
pLeadingVisual |
The new leadingVisual. |
BlackBerry 10.0.0
void
Emitted when the leadingVisualSnapThreshold has changed.
Parameters | |
---|---|
leadingVisualSnapThreshold |
The new leadingVisualSnapThreshold. |
BlackBerry 10.0.0
void
Emitted when ListView::listItemProvider has changed.
Parameters | |
---|---|
listItemProvider |
The new ListItemProvider. |
BlackBerry 10.0.0
void
Emitted when multiSelectAction has changed.
Parameters | |
---|---|
multiSelectAction |
The new multiSelectAction or 0 if it is not set. |
BlackBerry 10.0.0
void
Emitted when ListView::rootIndexPath has changed.
Parameters | |
---|---|
rootIndexPath |
The new rootIndexPath. See index paths for more information. |
BlackBerry 10.0.0
void
Emitted when ListView::scrollIndicatorMode has changed.
Due to a work around for a Qt Core issue with accessing enums from QML, the argument of this signal doesn't follow the usual naming convention for signals. Typically, signal arguments are named to match the associated property's name. In this case, you must use the object's property to access the current property value instead of the signal argument to avoid runtime errors (use scrollIndicatorMode instead of newScrollIndicatorMode).
Parameters | |
---|---|
newScrollIndicatorMode |
The new value of the scrollIndicatorMode property. |
BlackBerry 10.0.0
void
Emitted when ListView::scrollRole has changed.
Parameters | |
---|---|
newScrollRole |
new scrollRole value. |
BlackBerry 10.1.0
void
Emitted when the selection state has changed for a list item.
An item which opens the context menu is for example selected. The context menu is opened by long pressing the item. Multiple items can be selected when the multiSelectHandler is active. It is also possible to select and deselect items programmatically using, for example, select(), toggleSelection(), selectAll() and clearSelection().
If the item implements the ListItemListener interface, ListView also calls ListItemListener::select() whenever the selection state of the item is changed.
Signal triggered() if you want to be notified when the user taps on a list item with the intention to trigger an action.
,selectionChangeStarted() and selectionChangeEnded(), useful for getting notifications before and after selection is changed.
Parameters | |
---|---|
indexPath |
The index path to the item. See index paths for more information. |
selected |
true if the new state is selected, false otherwise. |
BlackBerry 10.0.0
void
Emitted after one or more items have been selected.
This signal always follows when one or more items have been selected. Typically, any generic processing tasks that apply to a selection change as a whole, can be carried out when receiving this signal in order to maintain performance. For instance, extracting the list of selected items by calling selectionList(), is recommended to be carried out when this signal is received rather than every time the selectionChanged() signal is received.
BlackBerry 10.3.1
void
Emitted before one or more items are about to be selected.
This signal is emitted right before any item selection(s) take place. It is followed by one or more selectionChanged() signals and then a finishing selectionChangeEnded().
BlackBerry 10.3.1
void
Emitted when ListView::snapMode has changed.
Due to a work around for a Qt Core issue with accessing enums from QML, the argument of this signal doesn't follow the usual naming convention for signals. Typically, signal arguments are named to match the associated property's name. In this case, you must use the object's property to access the current property value instead of the signal argument to avoid runtime errors (use snapMode instead of newSnapMode).
Parameters | |
---|---|
newSnapMode |
The new snap mode. |
BlackBerry 10.0.0
void
Emitted when ListView::stickToEdgePolicy has changed.
Due to a work around for a Qt Core issue with accessing enums from QML, the argument of this signal doesn't follow the usual naming convention for signals. Typically, signal arguments are named to match the associated property's name. In this case, you must use the object's property to access the current property value instead of the signal argument to avoid runtime errors (use stickToEdgePolicy instead of newStickToEdgePolicy).
Parameters | |
---|---|
newStickToEdgePolicy |
The new stick to edge policy. |
BlackBerry 10.1.0
void
Emitted when a list item is triggered by the user.
Typically, this signal is emitted when an item is tapped by the user with the intention to execute some action associated with it. This signal is, for example, not emitted when items are tapped during multiple selection, where the intention is to select the tapped item and not trigger an action associated with it.
Parameters | |
---|---|
indexPath |
The index path to the triggered item. See index paths for more information. |
BlackBerry 10.0.0
void 
Emitted when the accessibilityMode property on the control changes.
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. |
BlackBerry 10.2.0
void 
Parameters | |
---|---|
actionSet |
The ActionSet that has been added. |
BlackBerry 10.0.0
void 
Emitted when an ActionSet has been removed from the control.
Parameters | |
---|---|
actionSet |
The ActionSet that has been removed. 0 if emitted by removeAllActionSets(). |
BlackBerry 10.0.0
void 
Emitted when the bottomMargin of the control changes.
Parameters | |
---|---|
bottomMargin |
The new bottom margin for the control. |
BlackBerry 10.0.0
void 
Emitted when the bottomMarginSet of the control changes.
Parameters | |
---|---|
isSet |
information whether the preferred Width is now set. |
BlackBerry 10.0.0
void 
Emitted when the bottomPadding property changes.
Parameters | |
---|---|
bottomPadding |
The new bottom padding. |
BlackBerry 10.0.0
void 
Emitted when the builtInShortcutsEnabled property changes.
Parameters | |
---|---|
builtInShortcutsEnabled |
The new value. |
BlackBerry 10.2.0
void 
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.
BlackBerry 10.0.0
void 
Emitted when the enabled property on the control changes.
Parameters | |
---|---|
enabled |
If true the control is enabled, if false the control is disabled. |
BlackBerry 10.0.0
void 
Emitted when the focusAutoShow of the control changes.
Parameters | |
---|---|
newFocusAutoShow |
The new focusAutoShow state of the control. |
BlackBerry 10.0.0
void 
Emitted when the focused property on the control changes.
Parameters | |
---|---|
focused |
If true the control is focused, if false the control is not focused. |
BlackBerry 10.0.0
void 
Emitted when the focusPolicy of the control changes.
Parameters | |
---|---|
newFocusPolicy |
The new focusPolicy state of the control. |
BlackBerry 10.0.0
void 
Emitted when the focusRetentionPolicyFlags property on the control changes.
Parameters | |
---|---|
policy |
The new focusRetentionPolicy. |
BlackBerry 10.0.0
void 
Emitted when the horizontalAlignment property changes.
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. |
BlackBerry 10.0.0
void 
Emitted when the implicitLayoutAnimationsEnabled property on the control changes.
Parameters | |
---|---|
implicitLayoutAnimationsEnabled |
The new value. |
BlackBerry 10.0.0
void 
Emitted when the layoutProperties of the control changes.
Parameters | |
---|---|
layoutProperties |
The new layout properties for the control. |
BlackBerry 10.0.0
void 
Emitted when the leftMargin of the control changes.
Parameters | |
---|---|
leftMargin |
The new left margin for the control. |
BlackBerry 10.0.0
void 
Emitted when the leftMarginSet of the control changes.
Parameters | |
---|---|
isSet |
information whether the preferred Width is now set. |
BlackBerry 10.0.0
void 
Emitted when the leftPadding property changes.
Parameters | |
---|---|
leftPadding |
The new left padding. |
BlackBerry 10.0.0
void 
Emitted when the locallyFocused of the control changes.
Parameters | |
---|---|
newLocallyFocused |
The new locallyFocused state of the control. |
BlackBerry 10.3.1
void 
Emitted when the maxHeight of the control changes.
Parameters | |
---|---|
maxHeight |
The new maximum height for the control. |
BlackBerry 10.0.0
void 
Emitted when the maxWidth of the control changes.
Parameters | |
---|---|
maxWidth |
The new maximum width for the control. |
BlackBerry 10.0.0
void 
Emitted when the minHeight of the control changes.
Parameters | |
---|---|
minHeight |
The new minimum height for the control. |
BlackBerry 10.0.0
void 
Emitted when the minWidth of the control changes.
Parameters | |
---|---|
minWidth |
The new minimum width for the control. |
BlackBerry 10.0.0
void 
This signal is emitted when the objectName property is changed.
BlackBerry 10.0.0
void 
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).
BlackBerry 10.0.0
Parameters | |
---|---|
opacity |
The new opacity set on the visual node. |
BlackBerry 10.0.0
void 
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).
BlackBerry 10.0.0
Parameters | |
---|---|
opacity |
The new opacity set on the visual node. |
BlackBerry 10.0.0
void 
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.
The policy has no effect if propagation mode is TouchPropagationMode::None for the same visual node.
BlackBerry 10.0.0
Parameters | |
---|---|
newOverlapTouchPolicy |
The new overlap touch policy. |
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).
BlackBerry 10.0.0
void 
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.
BlackBerry 10.0.0
Parameters | |
---|---|
pivotX |
The new position of pivot point along the x-axis, relative to the center of the visual node. |
BlackBerry 10.0.0
void 
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.
BlackBerry 10.0.0
Parameters | |
---|---|
pivotY |
The new position of pivot point along the y-axis, relative to the center of the visual node. |
BlackBerry 10.0.0
void 
Emitted when the preferredHeight of the control changes.
Parameters | |
---|---|
preferredHeight |
The new preferred height; will always be positive. |
BlackBerry 10.0.0
void 
Emitted when the preferredHeightSet of the control changes.
Parameters | |
---|---|
isSet |
information whether the preferred height is now set. |
BlackBerry 10.0.0
void 
Emitted when the preferredWidth of the control changes.
Parameters | |
---|---|
preferredWidth |
The new preferred width; will always be positive. |
BlackBerry 10.0.0
void 
Emitted when the preferredWidthSet of the control changes.
Parameters | |
---|---|
isSet |
information whether the preferred width is now set. |
BlackBerry 10.0.0
void 
Emitted when the rightMargin of the control changes.
Parameters | |
---|---|
rightMargin |
The new right margin for the control. |
BlackBerry 10.0.0
void 
Emitted when the rightMarginSet of the control changes.
Parameters | |
---|---|
isSet |
information whether the preferred Width is now set. |
BlackBerry 10.0.0
void 
Emitted when the rightPadding property changes.
Parameters | |
---|---|
rightPadding |
The new right padding. |
BlackBerry 10.0.0
void 
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.
BlackBerry 10.0.0
Parameters | |
---|---|
rotationZ |
The new rotation around the z-axis in degrees. |
BlackBerry 10.0.0
void 
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.
BlackBerry 10.0.0
Parameters | |
---|---|
rotationZ |
The new rotation around the z-axis in degrees. |
BlackBerry 10.0.0
void 
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).
BlackBerry 10.0.0
Parameters | |
---|---|
scaleX |
The new scale factor along the x-axis. |
BlackBerry 10.0.0
void 
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).
BlackBerry 10.0.0
Parameters | |
---|---|
scaleX |
The new scale factor along the x-axis. |
BlackBerry 10.0.0
void 
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).
BlackBerry 10.0.0
Parameters | |
---|---|
scaleY |
The new scale factor along the y-axis. |
BlackBerry 10.0.0
void 
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).
BlackBerry 10.0.0
Parameters | |
---|---|
scaleY |
The new scale factor along the y-axis. |
BlackBerry 10.0.0
void 
Emitted when the topMargin of the control changes.
Parameters | |
---|---|
topMargin |
The new top margin for the control. |
BlackBerry 10.0.0
void 
Emitted when the topMarginSet of the control changes.
Parameters | |
---|---|
isSet |
information whether the preferred Width is now set. |
BlackBerry 10.0.0
void 
Emitted when the topPadding property changes.
Parameters | |
---|---|
topPadding |
The new top padding. |
BlackBerry 10.0.0
void 
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. |
BlackBerry 10.0.0
void 
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. |
BlackBerry 10.0.0
void 
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
-
the node where the listener is connected,
-
its subtree and
-
overlapping nodes that are not part of the subtree
-
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.

void 
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.
void 
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::Full means that touch events will be fully propagated to the visual node and it's subtree.
TouchPropagationMode::None means no touch events will be propagated to the visual node or its subtree. The subtree is practically invisible to the touch system.
TouchPropagationMode::PassThrough means touch events will not be handled by the visual node itself, but its subtree will get touch events as usual.
The default propagation mode is TouchPropagationMode::Full.
BlackBerry 10.0.0
Parameters | |
---|---|
newTouchPropagationMode |
The new touch propagation mode for the visual node. |
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).
BlackBerry 10.0.0
void 
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.
Layout for more details.
BlackBerry 10.0.0
Parameters | |
---|---|
translationX |
The translation along the the x-axis (pointing towards right) |
BlackBerry 10.0.0
void 
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.
Layout for more details.
BlackBerry 10.0.0
Parameters | |
---|---|
translationX |
The new translation along the the x-axis (pointing towards right) |
BlackBerry 10.0.0
void 
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.
Layout for more details.
BlackBerry 10.0.0
Parameters | |
---|---|
translationY |
The new translation along the the y-axis (pointing downwards). |
BlackBerry 10.0.0
void 
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.
Layout for more details.
BlackBerry 10.0.0
Parameters | |
---|---|
translationY |
The new translation along the the y-axis (pointing downwards). |
BlackBerry 10.0.0
void 
Emitted when the verticalAlignment property changes.
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. |
BlackBerry 10.0.0
void 
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.
BlackBerry 10.0.0
Parameters | |
---|---|
visible |
The new visible property set on the visual node. |
BlackBerry 10.0.0