Page

Since: BlackBerry 10.0.0

#include <bb/cascades/Page>

Defines an individual screen within an application.

On a Page it's possible to specify a root control and a set of actions. The actions are displayed on the Action bar placed at the bottom of the screen. If no actions are specified, the Action bar will not be displayed, and the screen content assumes the full height of the screen. As soon as one or more actions are added, the Action bar will appear. To specify that an action should appear on the Action bar, rather than in the Action menu, the attached property ActionBar.placement can be used. Please note that the actionbar placement property will only be considered at initialization ie. it can only be specified once.

No caption available

Here's an example of how to create a simple Page with an action placed on the Action bar.

 Page {
     actions: [
         ActionItem {
             title: "Refresh"
             onTriggered: app.initiateRequest()
             ActionBar.placement: ActionBarPlacement.OnBar
         }
     ]
     content: Container {
         layout: DockLayout {}
        
         ActivityIndicator {
             verticalAlignment: VerticalAlignment.Fill
             horizontalAlignment: HorizontalAlignment.Fill    
         }
     }
 }
See also:

ActionItem


Overview

QML properties

actionBarAutoHideBehavior: bb::cascades::ActionBarAutoHideBehavior::Type
actionBarFollowKeyboardPolicy: bb::cascades::ActionBarFollowKeyboardPolicy::Type
actionBarVisibility: bb::cascades::ChromeVisibility::Type
actionMenuVisualState: bb::cascades::ActionMenuVisualState::Type [read-only]
actions: QDeclarativeListProperty [read-only]
content: bb::cascades::Control
inputRoute: bb::cascades::InputRouteProperties [read-only]
keysIgnoreFocusInActionBar: bool
resizeBehavior: bb::cascades::PageResizeBehavior::Type
titleBar: bb::cascades::TitleBar
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

Page (QObject *parent=0)
virtual ~Page ()
Q_INVOKABLE bb::cascades::AbstractActionItem *actionAt (int index) const
bb::cascades::ActionBarAutoHideBehavior::TypeactionBarAutoHideBehavior () const
bb::cascades::ActionBarFollowKeyboardPolicy::TypeactionBarFollowKeyboardPolicy () const
bb::cascades::ChromeVisibility::TypeactionBarVisibility () const
Q_INVOKABLE intactionCount () const
bb::cascades::ActionMenuVisualState::TypeactionMenuVisualState () const
Q_INVOKABLE voidaddAction (bb::cascades::AbstractActionItem *actionItem, bb::cascades::ActionBarPlacement::Type placement=bb::cascades::ActionBarPlacement::Default)
bb::cascades::Control *content () const
bb::cascades::InputRouteProperties *inputRoute () const
boolkeysIgnoreFocusInActionBar () const
Q_SLOT voidopenActionMenu ()
Q_INVOKABLE boolremoveAction (bb::cascades::AbstractActionItem *actionItem)
Q_INVOKABLE voidremoveAllActions ()
Q_SLOT voidresetActionBarAutoHideBehavior ()
Q_SLOT voidresetActionBarFollowKeyboardPolicy ()
Q_SLOT voidresetActionBarVisibility ()
Q_SLOT voidresetKeysIgnoreFocusInActionBar ()
Q_SLOT voidresetResizeBehavior ()
Q_SLOT voidresetTitleBar ()
bb::cascades::PageResizeBehavior::TyperesizeBehavior () const
Q_SLOT voidsetActionBarAutoHideBehavior (bb::cascades::ActionBarAutoHideBehavior::Type actionBarAutoHideBehavior)
voidsetActionBarFollowKeyboardPolicy (const bb::cascades::ActionBarFollowKeyboardPolicy::Type followKeyboardPolicy)
voidsetActionBarVisibility (const bb::cascades::ChromeVisibility::Type visibility)
voidsetContent (bb::cascades::Control *content)
Q_SLOT voidsetKeysIgnoreFocusInActionBar (bool keysIgnoreFocusInActionBar)
Q_SLOT voidsetResizeBehavior (bb::cascades::PageResizeBehavior::Type resizeBehavior)
Q_SLOT voidsetTitleBar (bb::cascades::TitleBar *titleBar)
bb::cascades::TitleBar *titleBar () 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

voidactionAdded (bb::cascades::AbstractActionItem *action)
voidactionBarAutoHideBehaviorChanged (bb::cascades::ActionBarAutoHideBehavior::Type newActionBarAutoHideBehavior)
voidactionBarFollowKeyboardPolicyChanged (bb::cascades::ActionBarFollowKeyboardPolicy::Type newFollowKeyboardPolicy)
voidactionBarVisibilityChanged (bb::cascades::ChromeVisibility::Type newVisibility)
voidactionMenuVisualStateChanged (bb::cascades::ActionMenuVisualState::Type newActionMenuVisualState)
voidactionRemoved (bb::cascades::AbstractActionItem *action)
voidcontentChanged (bb::cascades::Control *content)
voidkeysIgnoreFocusInActionBarChanged (bool keysIgnoreFocusInActionBar)
voidresizeBehaviorChanged (bb::cascades::PageResizeBehavior::Type newResizeBehavior)
voidtitleBarChanged (bb::cascades::TitleBar *titleBar)
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::ActionBarAutoHideBehavior::Type actionBarAutoHideBehavior

Sets the auto-hide behavior of the Action Bar.

Note:

Automatically hidding the Action bar only works if Page::actionBarVisibility is also set to ChromeVisibility::Overlay.

Since:

BlackBerry 10.1.0

bb::cascades::ActionBarFollowKeyboardPolicy::Type actionBarFollowKeyboardPolicy

This property specifies the follow keyboard policy of the associated Action bar.

By default, the Action bar is not following the Virtual Keyboard when it is invoked. However, this property allows you to change this behavior and make the Action bar able to follow the Virtual Keyboard in the Portrait mode.

 Page {
     actionBarFollowKeyboardPolicy: ActionBarFollowKeyboardPolicy.Portrait
 }
Since:

BlackBerry 10.3.0

bb::cascades::ChromeVisibility::Type actionBarVisibility

Specifies the Action bar visibility.

This property specifies the visibility mode of the associated Action bar. By default, the Action bar is fully visible (if there are actions) and the Page content is compressed to show the Action bar at the bottom of the screen. Using this property, you can set the Action bar to be in a compact mode, overlaid (on top of the Page) or fully hidden.

 Page {
     actionBarVisibility: ChromeVisibility.Overlay
 }

In cases where the Action bar is overlaid on top of the page's content, you might want to pad the bottom part of the UI so that it's not obscured by the Action bar. Here's an example of how to use the PageLayoutUpdateHandler::bottomOverlayHeight to pad a ListView so that the last item isn't obscured by the action bar when the user has scrolled to the bottom:

Page {
    // A list view with some items.
    ListView {
        id: listView
        dataModel: XmlDataModel { source: "model.xml" }
    }

    // Set the action bar to be overlaid on top of the ListView.
    actionBarVisibility: ChromeVisibility.Overlay

    // Whenever the bottomOverlayHeight is updated we use it's value as
    // the bottom padding in the list view. This will ensure that that
    // last item is visible above the action bar when the user has scrolled
    // to the bottom.
    attachedObjects: [
        PageLayoutUpdateHandler {
            id: pageLayoutUpdateHandler
            onBottomOverlayHeightChanged: {
                listView.bottomPadding = bottomOverlayHeight
            }
        }
    ]
}
Since:

BlackBerry 10.0.0

bb::cascades::ActionMenuVisualState::Type actionMenuVisualState[read-only]

The current visual state of the action menu.

Since:

BlackBerry 10.0.0

QDeclarativeListProperty actions[read-only]

A list of actions that will be displayed on the Action bar or in the Action menu.

The order in which they are added will determine how they appear on the Action bar and in the Action menu.

Since this list consists of AbstractActionItem, you should cast the value to either an ActionItem or an InvokeActionItem before you use them.

Only one DeleteActionItem and MultiSelectActionItem can be displayed at one time. If more than one is added, only the first one is used and the rest are ignored. They are placed at a fixed position on the Action bar or in the Action menu along with the other actions. The MultiSelectActionItem is used to start a multiple selection session.

Since:

BlackBerry 10.0.0

bb::cascades::Control content

The root control for the Page (the contents of the screen).

This is the default property of the Page control, so it does not need to be explicitly declared in QML. A control added inside the Page will automatically be assigned to the content property.

 Page {
     Container {
         Button {}
         Button {}
     }
 }

The code snippet above is equal to the following code snippet:

 Page {
     content: Container {
         Button {}
         Button {}
     }
 }

Since:

BlackBerry 10.0.0

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

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

QML usage:
Page {
    inputRoute.primaryKeyTarget: true

    shortcuts: [
        Shortcut {
            key: "a"
            onTriggered: {
                myLabel.text = "Shortcut triggered!"
            }
        }
    ]

    content: Label {
        id: myLabel;
    }
}
C++ usage:
Page *pPage = new Page();
pPage->inputRoute()->setPrimaryKeyTarget(true);
C++ usage (with builder):
Page *pPage = Page::create()
    .primaryKeyTarget(true)
    .content(Label::create()
            .text("My Page is the primary key target!"));
Since:

BlackBerry 10.1.0

bool keysIgnoreFocusInActionBar

If the focus is on the action bar, deliver events as if nothing had focus.

Whenever something on the action bar is focused, key events will be delivered to that item and never to the primary key target or the fallback route. Sometimes it is desirable to prevent this behavior for items on the action bar.

Setting this property will make the event propagation treat anything focused on the action bar as if nothing had focus.

The default value for this property is false.

Since:

BlackBerry 10.3.1

bb::cascades::PageResizeBehavior::Type resizeBehavior

The different ways that a Page can be resized when the available screen space is affected by external components (for example, when the keyboard appears).

The default resize behavior is PageResizeBehavior::Resize, but PageResizeBehavior::None can also be used.

Since:

BlackBerry 10.0.0

bb::cascades::TitleBar titleBar

The title bar properties for this Page.

By default, the titleBar of a Page is 0.

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

Page (

Constructs a Page.

Since:

BlackBerry 10.0.0

virtual~Page ()

Destructor.

Since:

BlackBerry 10.0.0

Q_INVOKABLE bb::cascades::AbstractActionItem * actionAt (
  • intindex)

Returns an action at the specified index.

Ownership of the action remains with the Page.

Since this method returns an AbstractActionItem, you should cast the value to either an ActionItem or an InvokeActionItem before you use it. For example:

 AbstractActionItem *item = myPage->actionAt(0);
 ActionItem *castedItem = qobject_cast<ActionItem *>(item);
Parameters
index

The index of the action.

Return:

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

Since:

BlackBerry 10.0.0

bb::cascades::ActionBarAutoHideBehavior::Type actionBarAutoHideBehavior ()

Returns the actionBarAutoHideBehavior.

Return:

The current actionBarAutoHideBehavior.

Since:

BlackBerry 10.1.0

bb::cascades::ActionBarFollowKeyboardPolicy::Type actionBarFollowKeyboardPolicy ()

Gets the Action bar follow keyboard policy.

Return:

The Action bar follow keyboard policy.

Since:

BlackBerry 10.3.0

bb::cascades::ChromeVisibility::Type actionBarVisibility ()

Gets the Action bar visibility mode.

Return:

The Action bar visibility mode.

Since:

BlackBerry 10.0.0

Q_INVOKABLE int actionCount ()

Returns the number of actions.

Return:

The number of actions.

Since:

BlackBerry 10.0.0

bb::cascades::ActionMenuVisualState::Type actionMenuVisualState ()

Returns the current visual state of the action menu.

Return:

The current visual state of the action menu.

Since:

BlackBerry 10.0.0

Q_INVOKABLE void addAction (

Adds an action to the Page.

A Page will always take ownership of the action, as actions should typically not be shared. If the action already belongs to the Page or the actionItem is 0, nothing will happen. If the operation was successful, the actionAdded() signal will be emitted. The order in which actions are added will decide how they appear on the Action bar and in the Action menu.

Valid action items are ActionItem or InvokeActionItem, and all other items will be ignored.

Parameters
actionItem

The ActionItem or InvokeActionItem to add to the Page.

placement

Specifies where the action should be placed.

Since:

BlackBerry 10.0.0

bb::cascades::Control * content ()

Get the active content.

Ownership will not be transferred.

Return:

The content.

Since:

BlackBerry 10.0.0

bb::cascades::InputRouteProperties * inputRoute ()

Returns the input route properties object.

Return:

The input route properties object.

Since:

BlackBerry 10.1.0

bool keysIgnoreFocusInActionBar ()

Returns the keysIgnoreFocusInActionBar state of the action bar.

Return:

true if key events should ignore focus on the action bar, false otherwise.

Since:

BlackBerry 10.3.1

Q_SLOT void openActionMenu ()

Opens the Action Overflow Menu.

Opens the Action Overflow Menu if there is an ActionSet attached to the page.

Since:

BlackBerry 10.3.1

Q_INVOKABLE bool removeAction (

Removes an action from the Page.

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

If operation was successful, the actionRemoved() signal will be emitted.

Parameters
actionItem

The ActionItem or InvokeActionItem to remove.

Return:

true if the action was owned by the Page, false otherwise.

Since:

BlackBerry 10.0.0

Q_INVOKABLE void removeAllActions ()

Removes all actions on a Page and frees their memory.

The actionRemoved(bb::cascades::AbstractActionItem*) signal is emitted with 0 as its parameter.

Since:

BlackBerry 10.0.0

Q_SLOT void resetActionBarAutoHideBehavior ()

Resets actionBarAutoHideBehavior to its default value.

The default value is Default. The signal actionBarAutoHideBehaviorChanged() is emitted if the value is changed.

Since:

BlackBerry 10.1.0

Q_SLOT void resetActionBarFollowKeyboardPolicy ()

Resets the Action bar follow keyboard policy to its default value.

The default value is ActionBarFollowKeyboardPolicy::Default.

The signal actionBarFollowKeyboardChanged() is emitted if the Action bar follow keyboard is changed.

Since:

BlackBerry 10.3.0

Q_SLOT void resetActionBarVisibility ()

Resets the Action bar visibility mode to its default value.

The default value is ChromeVisibility::Default.

The signal actionBarVisibilityChanged() is emitted if the Action bar visibility mode is changed.

Since:

BlackBerry 10.0.0

Q_SLOT void resetKeysIgnoreFocusInActionBar ()

Resets the keysIgnoreFocusInActionBar state of the action bar to false.

Since:

BlackBerry 10.3.1

Q_SLOT void resetResizeBehavior ()

Resets the resize behavior for the Page to its default.

The default resize behavior is PageResizeBehavior::Resize.

After the resize behavior is set, the resizeBehaviorChanged() signal is emitted.

Since:

BlackBerry 10.0.0

Q_SLOT void resetTitleBar ()

Resets the titleBar property for the Page to 0.

Since:

BlackBerry 10.0.0

bb::cascades::PageResizeBehavior::Type resizeBehavior ()

Returns the resize behavior for the Page.

Return:

The resize behavior.

Since:

BlackBerry 10.0.0

Q_SLOT void setActionBarAutoHideBehavior (

Sets the actionBarAutoHideBehavior.

The signal actionBarAutoHideBehaviorChanged() is emitted if the value is changed.
Parameters
actionBarAutoHideBehavior

The new actionBarAutoHideBehavior.

Since:

BlackBerry 10.1.0

void setActionBarFollowKeyboardPolicy (

Sets the Action bar follow keyboard behavior.

The signal actionBarFollowKeyboardChanged() is emitted if the follow keyboard behavior is changed.

Parameters
followKeyboardPolicy

The Action bar follow keyboard policy.

Since:

BlackBerry 10.3.0

void setActionBarVisibility (

Sets the Action bar visibility mode.

This property specifies the visibility mode of the associated Action bar. By default, the Action bar is fully visible (if there are actions) and the content on the Page is compressed to display the Action bar at the bottom of the screen. Using this property, you can set the Action bar to either be overlaid (on top of the page) or fully hidden.

The signal actionBarVisibilityChanged() is emitted if the visibility mode is changed.

Parameters
visibility

The Action bar visibility mode.

Since:

BlackBerry 10.0.0

void setContent (

Set the content of the Page.

Ownership will always be transferred to the Page. If Page already has a content, the old content will still be owned by Page and destroyed when Page is destroyed. If operation was successful, the contentChanged() signal will be emitted.

Parameters
content

The content. Can be 0 to remove content (old content will still be owned by Page).

Since:

BlackBerry 10.0.0

Q_SLOT void setKeysIgnoreFocusInActionBar (
  • boolkeysIgnoreFocusInActionBar)

Sets the keysIgnoreFocusInActionBar state of the action bar.

Parameters
keysIgnoreFocusInActionBar

If true key events will ignore focus on the action bar and if false key events will go to the focused item on the action bar.

Since:

BlackBerry 10.3.1

Q_SLOT void setResizeBehavior (

Sets the resize behavior for the Page.

After the resize behavior is set, the resizeBehaviorChanged() signal is emitted.

Parameters
resizeBehavior

The new resize behavior.

Since:

BlackBerry 10.0.0

Q_SLOT void setTitleBar (

Sets the TitleBar property for the Page.

The Page takes ownership of the TitleBar object. If the TitleBar object is already set on another Page, it is removed from the original Page. Ownership of the TitleBar object stays with the original Page.

Parameters
titleBar

The new TitleBar for the page or 0 to remove title bar from the page.

Since:

BlackBerry 10.0.0

bb::cascades::TitleBar * titleBar ()

Returns the TitleBar object for the page.

Return:

The TitleBar for the page.

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 Page.

Using the builder to create a Page:
 Page* page = Page::create();
Return:

A builder used for constructing a Page.

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

Emitted when an action has been added to the Page.

Parameters
action

The action that has been added.

Since:

BlackBerry 10.0.0

void actionBarAutoHideBehaviorChanged (

Emitted when actionBarAutoHideBehavior changed.

Parameters
newActionBarAutoHideBehavior

The new value of actionBarAutoBehavior.

Since:

BlackBerry 10.1.0

void actionBarFollowKeyboardPolicyChanged (

Emitted when Action bar follow keyboard policy property changes.

Parameters
newFollowKeyboardPolicy

The new ActionBarFollowKeyboardPolicy value.

Since:

BlackBerry 10.3.0

void actionBarVisibilityChanged (

Emitted when Action bar visibility changes.

Parameters
newVisibility

The new visibility.

Since:

BlackBerry 10.0.0

void actionMenuVisualStateChanged (

Emitted when actionMenuVisualState 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 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 (i.e. use actionMenuVisualState instead of newActionMenuVisualState).

Parameters
newActionMenuVisualState

The new value of the actionMenuVisualState property.

Since:

BlackBerry 10.0.0

void actionRemoved (

Emitted when a action has been removed from the Page.

Parameters
action

The action that has been removed. 0 if emitted by removeAllActions().

Since:

BlackBerry 10.0.0

void contentChanged (

Emitted when the content has changed.

Parameters
content

The new content.

Since:

BlackBerry 10.0.0

void keysIgnoreFocusInActionBarChanged (
  • boolkeysIgnoreFocusInActionBar)

Emitted when the keysIgnoreFocusInActionBar property changes.

Parameters
keysIgnoreFocusInActionBar

The new value of keysIgnoreFocusInActionBar.

Since:

BlackBerry 10.3.1

void resizeBehaviorChanged (

Emitted when the resizeBehavior property changes.

Note:

Due to a work around for a Qt Core issue with accessing enums from QML, the argument of this signal doesn't follow 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 (i.e. use resizeBehavior instead of newResizeBehavior).

Parameters
newResizeBehavior

The new resize behavior.

Since:

BlackBerry 10.0.0

void titleBarChanged (

Emitted when the titleBar of the page changes.

Parameters
titleBar

The new TitleBar for the Page.

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