TabbedPane

Since: BlackBerry 10.0.0

#include <bb/cascades/TabbedPane>

A navigation control that allows the user to switch between tabs.

A TabbedPane with three tabs

The tabs can be used to either completely replace displayed content by setting new panes or to filter existing content in a single pane based on which tab is currently selected.

The Tab objects in the TabbedPane are added to the Action bar, which is a horizontal bar displayed at the bottom of the screen. The tabs on the Action bar can be pressed to switch to display their content. The Tab objects take an AbstractPane as their content. If the content is not 0, it will be displayed in the TabbedPane when the corresponding tab is selected.

If the TabbedPane has only one Tab and the content of that Tab has no actions, the Action bar is not displayed since there aren't any additional tabs or actions to be displayed.

The first added Tab becomes the active one.

If the content of the Tab that is being displayed has any ActionItem objects associated with it, these actions take priority and are placed on the Action bar, while the other tabs are pushed to the side bar. This behavior can be changed by setting the showTabsOnActionBar property to true. If showTabsOnActionBar is true, tabs will be placed on the Action bar and actions will be placed in the Action menu.

A TabbedPane with three tabs and an action

The user can access tabs or actions that are not present on the Action bar by pressing the overflow tab, which is automatically added to the Action bar when it is needed.

If a tab is selected that is not currently present on the Action bar, the side bar will then change to the active-tab state and show the title and image of that tab along with an overflow symbol.

It is possible for the application to programmatically change the appearance of the sidebar by setting the property sidebarState.

A tab can display a visual notification image if there is new content available. If any tab that is only shown in the side bar contains such a visual notification, the overflow tab will also display such a visual notification. This visual notification will remain on the overflow tab until the corresponding tab(s) have been displayed (e.g. by opening the side bar) or the visual notification is removed from all tabs that are only visible in the side bar and that had new content.

Here's an example of a TabbedPane with three tabs, each with its own page and set of actions. The tabs are set to show on the Action bar so that the actions get pushed to the Action menu.

No caption available

QML implementation:

 TabbedPane {
     showTabsOnActionBar: true
     Tab {
         title: "Home"
         Page {
             id: page1
             actions: [
                 ActionItem {
                     title: "New"
                 },
                 ActionItem {
                     title: "Delete"
                 }
             ]
         }
     }
     Tab {
         title: "Options"
         Page {
             id: page2
             actions: [
                 ActionItem {
                     title: "Edit"
                 },
                 ActionItem {
                     title: "Save"
                 }
             ]
         }
     }
     Tab {
         title: "Help"
         Page {
             id: page3
             actions: [
                 ActionItem {
                     title: "Search"
                 },
                 ActionItem {
                     title: "Browse"
                 }
             ]
         }
     }
 }

C++ implementation:

 TabbedPane* tabbedPane = TabbedPane::create()
     .showTabsOnActionBar(true)
     .add(Tab::create()
         .title("Home")
         .content(Page::create()
             .addAction(ActionItem::create().title("New"))
             .addAction(ActionItem::create().title("Delete"))))
     .add(Tab::create()
         .title("Options")
         .content(Page::create()
             .addAction(ActionItem::create().title("Edit"))
             .addAction(ActionItem::create().title("Save"))))
     .add(Tab::create()
         .title("Help")
         .content(Page::create()
             .addAction(ActionItem::create().title("Search"))
             .addAction(ActionItem::create().title("Browse"))));

To get the actions displayed on the Action bar and the tabs in the Tab menu, the showTabsOnActionBar property must be set to false and the ActionBar.placement property for each action must be set to ActionBarPlacement.OnBar. Here's how a TabbedPane looks with the actions on the Action bar and the tabs in the Tab menu:

No caption available

In addition to switching between pages, tabs can also be used for filtering content that appears on the screen. Here's an example that shows how to change the text for a label by using tabs.

 TabbedPane {
     showTabsOnActionBar: true
     activePane:
         Page {
             Label {
                 id: label
                 text: "What do you like more, kittens or puppies?"
             }
         }
 
     Tab { 
         title: "Puppies"
         onTriggered: label.text = "I love puppies!"
     }
 
     Tab {
         title: "Kittens"
         onTriggered: label.text = "I love kittens!"
     }
 }
See also:

Tab, Page, NavigationPane


Overview

QML properties

activePane: bb::cascades::AbstractPane
activeTab: bb::cascades::Tab
tabs: QDeclarativeListProperty [read-only]
peekEnabled: bool
showTabsOnActionBar: bool
sidebarState: bb::cascades::SidebarState::Type
sidebarVisualState: bb::cascades::SidebarVisualState::Type [read-only]
accessibility: bb::cascades::AbstractA11yObject [read-only]Inherited
attachedObjects: QDeclarativeListProperty< QObject > [read-only]Inherited
builtInShortcutsEnabled: boolInherited
objectName: QStringInherited
paneProperties: bb::cascades::PanePropertiesInherited
parent: QObject [read-only]Inherited
peekedAt: bool [read-only]Inherited
ui: bb::cascades::UIConfig [read-only]Inherited

Public Functions Index

TabbedPane (QObject *parent=0)
virtual ~TabbedPane ()
bb::cascades::AbstractPane *activePane () const
bb::cascades::Tab *activeTab () const
Q_INVOKABLE voidadd (bb::cascades::Tab *tab)
Q_INVOKABLE bb::cascades::Tab *at (int index) const
Q_INVOKABLE intcount () const
Q_INVOKABLE intindexOf (bb::cascades::Tab *tab) const
Q_INVOKABLE voidinsert (int index, bb::cascades::Tab *tab)
boolisPeekEnabled () const
Q_INVOKABLE boolremove (bb::cascades::Tab *tab)
Q_INVOKABLE voidremoveAll ()
Q_SLOT voidresetPeekEnabled ()
Q_SLOT voidresetShowTabsOnActionBar ()
Q_SLOT voidresetSidebarState ()
voidsetActivePane (bb::cascades::AbstractPane *activePane)
voidsetActiveTab (bb::cascades::Tab *activeTab)
Q_SLOT voidsetPeekEnabled (bool enabled)
Q_SLOT voidsetShowTabsOnActionBar (bool showTabsOnActionBar)
voidsetSidebarState (bb::cascades::SidebarState::Type sidebarState)
boolshowTabsOnActionBar () const
bb::cascades::SidebarState::TypesidebarState () const
bb::cascades::SidebarVisualState::TypesidebarVisualState () const
bb::cascades::AbstractA11yObject *accessibility () const Inherited
Q_INVOKABLE voidaddKeyListener (bb::cascades::KeyListener *keyListener)Inherited
Q_INVOKABLE voidaddShortcut (bb::cascades::AbstractShortcut *shortcut)Inherited
Q_INVOKABLE boolbuiltInShortcutsEnabled () const Inherited
Q_INVOKABLE voiddisableAllShortcuts ()Inherited
Q_INVOKABLE voidenableAllShortcuts ()Inherited
virtual boolevent (QEvent *event)Inherited
boolisPeekedAt () const Inherited
Q_INVOKABLE bb::cascades::KeyListener *keyListenerAt (int index) const Inherited
Q_INVOKABLE intkeyListenerCount () const Inherited
bb::cascades::PaneProperties *paneProperties () const Inherited
Q_INVOKABLE voidremoveAllKeyListeners ()Inherited
Q_INVOKABLE voidremoveAllShortcuts ()Inherited
Q_INVOKABLE boolremoveKeyListener (bb::cascades::KeyListener *keyListener)Inherited
Q_INVOKABLE boolremoveShortcut (bb::cascades::AbstractShortcut *shortcut)Inherited
Q_SLOT voidresetBuiltInShortcutsEnabled ()Inherited
Q_SLOT voidresetPaneProperties ()Inherited
Q_INVOKABLE voidsetBuiltInShortcutEnabled (bb::cascades::SystemShortcuts::Type type, bool enabled)Inherited
Q_SLOT voidsetBuiltInShortcutsEnabled (bool enabled)Inherited
voidsetObjectName (const QString &name)Inherited
Q_SLOT voidsetPaneProperties (bb::cascades::PaneProperties *paneProperties)Inherited
Q_INVOKABLE bb::cascades::AbstractShortcut *shortcutAt (int index) const Inherited
Q_INVOKABLE intshortcutCount () const Inherited
virtual Q_INVOKABLE QStringtoDebugString () const Inherited
Q_INVOKABLE bb::cascades::UIConfig *ui () const Inherited

Static Public Functions Index

Buildercreate ()

Protected Functions Index

Only has inherited protected functions

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

Signals Index

voidactivePaneChanged (bb::cascades::AbstractPane *activePane)
voidactivePaneTransitionEnded (bb::cascades::AbstractPane *activePane)
voidactiveTabChanged (bb::cascades::Tab *activeTab)
voidpeekEnabledChanged (bool enabled)
voidshowTabsOnActionBarChanged (bool showTabsOnActionBar)
voidsidebarStateChanged (bb::cascades::SidebarState::Type newSidebarState)
voidsidebarVisualStateChanged (bb::cascades::SidebarVisualState::Type newSidebarVisualState)
voidtabAdded (bb::cascades::Tab *tab)
voidtabRemoved (bb::cascades::Tab *tab)
voidbuiltInShortcutsEnabledChanged (bool builtInShortcutsEnabled)Inherited
voidcreationCompleted ()Inherited
voidobjectNameChanged (const QString &objectName)Inherited
voidpanePropertiesChanged (bb::cascades::PaneProperties *paneProperties)Inherited
voidpeekedAtChanged (bool peekedAt)Inherited
voidpeekEnded ()Inherited
voidpeekStarted ()Inherited

Properties

bb::cascades::AbstractPane activePane

The AbstractPane which is currently being shown by the TabbedPane.

Since:

BlackBerry 10.0.0

bb::cascades::Tab activeTab

The Tab that is currently active in the TabbedPane.

The active tab is 0 if the TabbedPane doesn't have any children.

The activeTabChanged() signal is emitted when this property changes.

Since:

BlackBerry 10.0.0

QDeclarativeListProperty tabs[read-only]

A set of Tab objects added to the TabbedPane.

For each Tab in the TabbedPane, a tab is added to the Action bar, which can be pressed to switch to its corresponding content. If the active Tab has actions added to it, they will be displayed in the Action bar.

See also:

Tab, Page, NavigationPane

Since:

BlackBerry 10.0.0

bool peekEnabled

Indicates whether peeking from within the current Page should be enabled.

When enabled, dragging or swiping to the right inside the content of the Page will reveal the Tab menu.

This property only controls whether or not peeking is enabled within the content area of the Page. Peeking is always enabled on the Action bar, even if this property is disabled.

The default value is true (enabled).

Since:

BlackBerry 10.0.0

bool showTabsOnActionBar

Specifies whether tabs should take priority in the Action bar instead of action items.

If the content of the Tab that is being displayed has any ActionItem objects associated with it, these actions take priority and are placed on the Action bar, while the other tabs are pushed to the side bar. This behavior can be changed by setting the showTabsOnActionBar property to true. If showTabsOnActionBar is true, tabs for will be placed on the Action bar and actions will be placed in the side bar.

The default value is false.

Since:

BlackBerry 10.0.0

bb::cascades::SidebarState::Type sidebarState

The current visibility state of the sidebar.

The default state is Hidden. The other available visibility states are VisibleCompact, and VisibleFull.

Since:

BlackBerry 10.0.0

bb::cascades::SidebarVisualState::Type sidebarVisualState[read-only]

The current visual state of the sidebar.

Since:

BlackBerry 10.0.0

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

Defines this pane's accessibility object.

Since:

BlackBerry 10.2.0

QDeclarativeListProperty< QObject > attachedObjectsInherited[read-only]

A hierarchical list of the UIObject's attached objects.

Since:

BlackBerry 10.0.0

bool builtInShortcutsEnabledInherited

Enables or disables all AbstractPane's core shortcuts.

This property is used when all AbstractPane's core shortcuts should be enabled or disabled.

Since:

BlackBerry 10.2.0

QString objectNameInherited

This property is overridden from QObject.

See also:

QObject::objectName().

Since:

BlackBerry 10.0.0

bb::cascades::PaneProperties panePropertiesInherited

The pane properties for this AbstractPane.

The paneProperties property specifies data that the parent AbstractPane may use. The type of pane properties of the child must match up with parent. For example, if you add a Page to a NavigationPane, you must use NavigationPaneProperties.

By default, the paneProperties of an AbstractPane is 0.

Since:

BlackBerry 10.0.0

QObject parentInherited[read-only]

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

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

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

The default value of this property is 0.

Since:

BlackBerry 10.0.0

bool peekedAtInherited[read-only]

Indicates whether this AbstractPane is being "peeked" at.

If true, the pane is currently being revealed by peeking from a Sheet or a Page within a NavigationPane. By default, the value is false, indicating that the pane is not currently being peeked at.

If a NavigationPane is being peeked at, both the NavigationPane and its currently visible page will return true for the peekedAt property.

As a convenience, there are two signals available called peekStarted and peekEnded, which are emitted when a peek on the AbstractPane starts or ends.

The peekedAtChanged() signal is emitted when peekedAt changes.

Since:

BlackBerry 10.0.0

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

An object that gives access to unit conversion routines.

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

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

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

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

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

Blackberry 10.3.0

Public Functions

TabbedPane (

Constructs the TabbedPane.

Since:

BlackBerry 10.0.0

virtual~TabbedPane ()

Destructor.

Since:

BlackBerry 10.0.0

bb::cascades::AbstractPane * activePane ()

Returns the currently active AbstractPane.

Return:

The active AbstractPane or 0 if one isn't currently being displayed.

Since:

BlackBerry 10.0.0

bb::cascades::Tab * activeTab ()

Returns the currently active Tab.

Return:

The active Tab or 0 if the TabbedPane doesn't have any children.

Since:

BlackBerry 10.0.0

Q_INVOKABLE void add (

Adds a Tab to the TabbedPane.

If this is the first Tab added to this pane it will become the active tab.

New tabs are added as the last child in the TabbedPane. The Tab that is passed must not be 0 or it will be ignored. If the Tab is already a child of the TabbedPane that it is being added to, the operation fails. If the Tab is currently a child of another TabbedPane, it is removed as a child from that TabbedPane, and ownership is transferred to the new TabbedPane.

Parameters
tab

The Tab to be added; must not be 0 or it will be ignored.

Since:

BlackBerry 10.0.0

Q_INVOKABLE bb::cascades::Tab * at (
  • intindex)

Returns a Tab at the specified index.

Once completed, ownership of the Tab remains with the TabbedPane.

Parameters
index

The index of the Tab.

Return:

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

Since:

BlackBerry 10.0.0

Q_INVOKABLE int count ()

Returns the number of Tabs in the tabs list property.

Return:

The number of Tabs in the tabs list property.

Since:

BlackBerry 10.0.0

Q_INVOKABLE int indexOf (

Returns the index of a Tab.

If the Tab isn't a child of the TabbedPane or if the Tab is 0, -1 is returned.

Parameters
tab

The Tab to get the index from.

Return:

The index of the specified Tab if the Tab is valid, -1 otherwise.

Since:

BlackBerry 10.0.0

Q_INVOKABLE void insert (

Inserts a Tab at a specified index in the TabbedPane.

If this is the first Tab added to this pane it will become the active tab.

The Tab that is passed must not be 0 or it will be ignored. If the Tab is already a child of the TabbedPane that it is being added to, the operation fails. If the Tab is currently a child of another TabbedPane, it is removed as a child from that TabbedPane, and ownership is transferred to the new TabbedPane.

Parameters
index

The index where the Tab will be placed. If the index < 0 the the Tab is inserted as the first child. If the index > the number of children in the TabbedPane, it is added as the last child.

tab

The Tab to be inserted; must not be 0 or it will be ignored..

Since:

BlackBerry 10.0.0

bool isPeekEnabled ()

Indicates whether peeking from within the content area of the current Page is enabled.

However, peeking is always enabled on the Action bar, even if this property is disabled.

Return:

true if peeking is enabled, false otherwise.

Since:

BlackBerry 10.0.0

Q_INVOKABLE bool remove (

Removes a Tab from the TabbedPane.

If the removed tab was the active tab, the activeTab property will be set to 0. If the content of the removed tab was the active pane, the activePane property will be set to 0.

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

Parameters
tab

The Tab to be removed; must not be 0.

Return:

true if the Tab was a child of the TabbedPane, false otherwise.

Since:

BlackBerry 10.0.0

Q_INVOKABLE void removeAll ()

Removes all the tabs from the TabbedPane and deletes them.

Both activeTab and activePane properties will become 0 when this call is completed.

The tabRemoved() signal is emitted with 0 as its parameter.

Since:

BlackBerry 10.0.0

Q_SLOT void resetPeekEnabled ()

Resets the peeking behavior of the TabbedPane to its default state, which is disabled.

Setting this property only controls whether or not peeking is enabled within the content area of the Page. Peeking is always enabled on the Action bar, even if this property is disabled.

Since:

BlackBerry 10.0.0

Q_SLOT void resetShowTabsOnActionBar ()

Resets the showTabsOnActionBar property to its default value, which is 'false'.

The showTabsOnActionBarChanged() signal will be emitted if the property changed.

Since:

BlackBerry 10.0.0

Q_SLOT void resetSidebarState ()

Resets the sidebarState property to its default value, which is 'Hidden'.

The sidebarStateChanged() signal will be emitted if property changed.

Since:

BlackBerry 10.0.0

void setActivePane (

Sets the active AbstractPane.

This method sets the pane to be displayed by this TabbedPane.

If the passed AbstractPane was already active or if it had a parent but did not belong to either this TabbedPane or one of its Tabs it is ignored. If 0 is passed no pane will be displayed.

The replaced pane (if one was set) will not change ownership and will continue to be owned by its parent.

The TabbedPane will only assume ownership of the passed pane if it doesn't already have a parent (which can only be either one of this TabbedPane's tabs or the TabbedPane itself).

The activePaneChanged() signal will be emitted if setting the new pane was successful.

Parameters
activePane

A pane to be set as the active pane or 0

Since:

BlackBerry 10.0.0

void setActiveTab (

Sets the active Tab.

The activeTabChanged() signal will be emitted if the operation was successful. It will not be emitted if the Tab was already active.

Parameters
activeTab

The new active Tab. If tab is 0, if it doesn't belong to the TabbedPane, or if it already was active, nothing will happen.

Since:

BlackBerry 10.0.0

Q_SLOT void setPeekEnabled (
  • boolenabled)

Sets whether peeking from within the current Page should be enabled.

Setting this property only controls whether or not peeking is enabled within the content area of the Page. Peeking is always enabled on the Action bar, even if this property is disabled.

Parameters
enabled

If true peeking be enabled, if false peeking is disabled.

Since:

BlackBerry 10.0.0

Q_SLOT void setShowTabsOnActionBar (
  • boolshowTabsOnActionBar)

Sets the showTabsOnActionBar state, which specifies whether tabs take priority over actions on the Action bar.

The showTabsOnActionBarChanged() signal will be emitted if the property changed.

Parameters
showTabsOnActionBar

true if tabs should take priority over actions on the Action bar, otherwise false.

Since:

BlackBerry 10.0.0

void setSidebarState (

Specifies the current value of the sidebarState property.

The sidebarStateChanged() signal will be emitted if the value of the sidebarState property changed.

Parameters
sidebarState

The new SidebarState.

Since:

BlackBerry 10.0.0

bool showTabsOnActionBar ()

Returns the showTabsOnActionBar state, which specifies whether tabs take priority over actions on the Action bar.

Return:

true if tabs should take priority over actions on the Action bar, otherwise false.

Since:

BlackBerry 10.0.0

bb::cascades::SidebarState::Type sidebarState ()

Returns the current value of the sidebarState property.

Return:

The current state of the sidebar.

Since:

BlackBerry 10.0.0

bb::cascades::SidebarVisualState::Type sidebarVisualState ()

Returns the current visual state of the sidebar.

Return:

The current visual state of the sidebar.

Since:

BlackBerry 10.0.0

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

Returns the accessibility object.

Return:

The accessibility object.

Since:

BlackBerry 10.2.0

Q_INVOKABLE void addKeyListener (Inherited

Adds a key listener to the AbstractPane.

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

Parameters
keyListener

The KeyListener to add to the AbstractPane.

Since:

BlackBerry 10.1.0

Q_INVOKABLE void addShortcut (Inherited

Adds a shortcut to the AbstractPane.

AbstractPane will always take ownership as shortcuts should never be shared. If the shortcut already belongs to the AbstractPane 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 AbstractPane.

Since:

BlackBerry 10.1.0

Q_INVOKABLE bool builtInShortcutsEnabled ()Inherited

Returns a builtInShortcutsEnabled property value.

Return:

true if builtInShortcutsEnabled property is set to true and false otherwise

Since:

BlackBerry 10.2.0

Q_INVOKABLE void disableAllShortcuts ()Inherited

Disables all shortcuts attached to the AbstractPane.

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

Since:

BlackBerry 10.1.0

Q_INVOKABLE void enableAllShortcuts ()Inherited

Enables all shortcuts attached to the AbstractPane.

Since:

BlackBerry 10.1.0

virtual bool event (Inherited

Overloaded to implement the event mechanism in Cascades.

Warning!

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

Parameters
event

The received event.

Return:

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

Since:

BlackBerry 10.0.0

bool isPeekedAt ()Inherited

Indicates if this AbstractPane is being peeked at.

Return:

true if being peeked at, false otherwise.

Since:

BlackBerry 10.0.0

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

Returns a key listener at the specified index.

Ownership of the key listener remains with the AbstractPane.

Parameters
index

The index of the key listener.

Return:

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

Since:

BlackBerry 10.1.0

Q_INVOKABLE int keyListenerCount ()Inherited

Returns the number of key listeners.

Return:

The number of key listeners.

Since:

BlackBerry 10.1.0

bb::cascades::PaneProperties * paneProperties ()Inherited

Returns the PaneProperties object for the pane.

Ownership of the PaneProperties object remains unchanged.

Return:

The PaneProperties for the pane.

Since:

BlackBerry 10.0.0

Q_INVOKABLE void removeAllKeyListeners ()Inherited

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

Since:

BlackBerry 10.1.0

Q_INVOKABLE void removeAllShortcuts ()Inherited

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

Since:

BlackBerry 10.1.0

Q_INVOKABLE bool removeKeyListener (Inherited

Removes a key listener from the AbstractPane.

Once the key listener is removed, the AbstractPane no longer references it, but it is still owned by the AbstractPane. 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 AbstractPane (in which case it will be deleted with the AbstractPane).

Parameters
keyListener

The KeyListener to remove.

Return:

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

Since:

BlackBerry 10.1.0

Q_INVOKABLE bool removeShortcut (Inherited

Removes a shortcut from the AbstractPane.

Once the shortcut is removed, the AbstractPane no longer references it, but it is still owned by the AbstractPane. 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 AbstractPane (in which case it will be deleted with the AbstractPane).

Parameters
shortcut

The AbstractShortcut to remove.

Return:

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

Since:

BlackBerry 10.1.0

Q_SLOT void resetBuiltInShortcutsEnabled ()Inherited

Resets a builtInShortcutsEnabled property to default value.

Default value is true.

Since:

BlackBerry 10.2.0

Q_SLOT void resetPaneProperties ()Inherited

Resets the paneProperties property for the pane to 0.

Since:

BlackBerry 10.0.0

Q_INVOKABLE void setBuiltInShortcutEnabled (Inherited

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

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

Note:

Selected Built-in shortcut can be enabled or disbaled only if AbstractPane::builtInShortcutsEnabled property is set to true.

Parameters
type

The system shortcut type

enabled

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

Since:

BlackBerry 10.2.0

Q_SLOT void setBuiltInShortcutsEnabled (
  • boolenabled)
Inherited

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

Parameters
enabled

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

Since:

BlackBerry 10.2.0

void setObjectName (Inherited

Sets the objectName property.

Parameters
name

The new name for the object.

Since:

BlackBerry 10.0.0

Q_SLOT void setPaneProperties (Inherited

Sets the paneProperties property for the pane.

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

Parameters
paneProperties

The new PaneProperties for the pane.

Since:

BlackBerry 10.0.0

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

Returns a shortcut at the specified index.

Ownership of the shortcut remains with the AbstractPane.

Parameters
index

The index of the shortcut.

Return:

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

Since:

BlackBerry 10.1.0

Q_INVOKABLE int shortcutCount ()Inherited

Returns the number of shortcuts.

Return:

The number of shortcuts.

Since:

BlackBerry 10.1.0

virtual Q_INVOKABLE QString toDebugString ()Inherited

Returns a debug string representing this object.

Return:

A debug string for the object.

Since:

BlackBerry 10.0.0

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

Returns the UIConfig for this ui object.

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

Ownership remains with Cascades.

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

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

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

The UIConfig for this ui object.

Since:

BlackBerry 10.3.0

Static Public Functions

Builder create ()

Creates and returns a Builder for constructing a TabbedPane.

Using the builder model to create a TabbedPane with a page:

 TabbedPane* tabbedPane = TabbedPane::create()
     .showTabsOnActionBar(true);
     .add(Tab::create()
         .title("My tab")
         .content(Page::create())
      )
Return:

A builder for constructing a TabbedPane.

Since:

BlackBerry 10.0.0

Protected Functions

(Only has inherited protected functions)

BaseObject (Inherited

Constructs an instance of BaseObject's subclass.

Parameters
parent

An optional parent, defaults to 0.

Since:

BlackBerry 10.0.0

virtual void connectNotify (
  • const char *signal)
Inherited

Overloaded to implement the event mechanism in Cascades.

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

Parameters
signal

The connected signal.

Since:

BlackBerry 10.0.0

virtual void disconnectNotify (
  • const char *signal)
Inherited

Overloaded to implement the event mechanism in Cascades.

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

Parameters
signal

The disconnected signal.

Since:

BlackBerry 10.0.0

Signals

void activePaneChanged (

Emitted when the activePane property has changed.

Parameters
activePane

The new active AbstractPane.

Since:

BlackBerry 10.0.0

void activePaneTransitionEnded (

Emitted when the transition to a new active pane has finished.

Always sent when navigating from the Sidebar or clicking on tabs on the Action bar.
Parameters
activePane

The new active AbstractPane.

Since:

BlackBerry 10.0.0

void activeTabChanged (

Emitted when the activeTab property has changed.

Parameters
activeTab

The new active Tab.

Since:

BlackBerry 10.0.0

void peekEnabledChanged (
  • boolenabled)

Emitted when peeking on the TabbedPane is enabled or disabled.

Parameters
enabled

If true peeking is enabled, if false peeking is disabled.

Since:

BlackBerry 10.0.0

void showTabsOnActionBarChanged (
  • boolshowTabsOnActionBar)

Emitted when the showTabsOnActionBar property has changed.

Parameters
showTabsOnActionBar

The new value of the showTabsOnActionBar property.

Since:

BlackBerry 10.0.0

void sidebarStateChanged (

Emitted when sidebarState property changed.

Note:

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

Parameters
newSidebarState

The new value of the sidebarState property.

Since:

BlackBerry 10.0.0

void sidebarVisualStateChanged (

Emitted when sidebarVisualState property changed.

Note:

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

Parameters
newSidebarVisualState

The new value of the sidebarVisualState property.

Since:

BlackBerry 10.0.0

void tabAdded (

Emitted when a Tab has been added to the TabbedPane.

Parameters
tab

The Tab that has been added.

Since:

BlackBerry 10.0.0

void tabRemoved (

Emitted when a Tab has been removed from the TabbedPane.

Parameters
tab

The Tab that has been removed. 0 if emitted by removeAll().

Since:

BlackBerry 10.0.0

void builtInShortcutsEnabledChanged (
  • boolbuiltInShortcutsEnabled)
Inherited

Emitted when the builtInShortcutsEnabled property changes.

Parameters
builtInShortcutsEnabled

The new value.

Since:

BlackBerry 10.2.0

void creationCompleted ()Inherited

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

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

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

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

See also:

QmlDocument

Since:

BlackBerry 10.0.0

void objectNameChanged (Inherited

This signal is emitted when the objectName property is changed.

Since:

BlackBerry 10.0.0

void panePropertiesChanged (Inherited

Emitted when the paneProperties of the pane changes.

Parameters
paneProperties

The new PaneProperties for the AbstractPane.

Since:

BlackBerry 10.0.0

void peekedAtChanged (
  • boolpeekedAt)
Inherited

Emitted when the peekedAt property of this AbstractPane changes.

Parameters
peekedAt

If true the AbstractPane is being peeked at, otherwise false.

Since:

BlackBerry 10.0.0

void peekEnded ()Inherited

Emitted when a peek on this AbstractPane ends.

Since:

BlackBerry 10.0.0

void peekStarted ()Inherited

Emitted when a peek on this AbstractPane starts.

Since:

BlackBerry 10.0.0

Last modified: 2014-09-30



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

comments powered by Disqus