ForeignWindowControl
#include <bb/cascades/ForeignWindowControl>
Allows for embedding a foreign libscreen window into the Cascades scenegraph.

This is an advanced control requiring good understanding of the platform windowing system, in particular the libscreen API. Please consult libscreen reference before using this control.
UI controls placed on top of the foreign window control in the scene hierarchy will be rendered overlapping the contents of the foreign window thus allowing to display UI on top of a foreign window. An example is a camera viewfinder window can be embedded into the scene using ForeignWindowControl with buttons placed on top of it for taking snapshots. UI controls placed under the ForeignWindowControl in the hierarchy will be completely obscured by the contents of the foreign window.
Application can use preferred and minimum/maximum dimensions properties such as Control::preferredWidth, Control::preferredHeight and so on to set the dimensions of the foreign window control.
windowId : A screen window id property (matches SCREEN_PROPERTY_ID_STRING in libscreen API). If set, it specifies the id string of the window this control should be bound to. This is the main property to be used to identify a window this control should bind to. The binding happens when a window with this id attaches to the specified group.
windowGroup : A screen window group (matches SCREEN_PROPERTY_GROUP in libscreen API). If set, it specifies the group the application expects a foreign window to attach to. By default this is the main application window group. The binding happens when a window joins (or "attaches to") the group with specified name and windowId.
windowHandle : A screen window handle (matches SCREEN_PROPERTY_WINDOW in libscreen API). If set, it specifies the handle of the window this control should be bound to. The binding happens when a window with this handle attaches the specified window group (assuming it also matches the windowId if specified).
boundToWindow : A boolean read only property indicating whether the control is bound to a window.
updatedProperties : A flag property specifying which of the bound window's properties the ForeignWindowControl should automatically update whenever corresponding property of the control changes. Example of such properties are the size and position of the control.
keyInputForwardingEnabled : A boolean property specifying whether the ForeignWindowControl control should receive Cascades key events or whether the libscreen key input should be forwarded to the window the control is bound to. This property can be used when the window needs to process raw key input from the system (for example application wants to process raw key input using input method library).
The application must specify the windowId and the windowGroup (the latter in case it differs from the default which is the main window group) in order for control to bind to an attached foreign window.
When a window matching specified windowGroup and windowId or windowHandle is attached to the group the control will automatically bind to it. Its boundToWindow property will be set to true.
Once the control is bound to the window it will update the properties of the window as specified by the updateProperties property.
The application can connect a slot to controlFrameChanged() signal to respond to control position and size changes if window's content needs to be updated based on control's on position or size.
From the implementation point of view the control "punches a hole" in the cascades' main window allowing the foreign window to be seen. This means that the libscreen window should be placed below Cascades' main window in the Z-order by setting SCREEN_PROPERTY_ZORDER window attribute).
Cascades' main window has Z order of 0 so foreign window's Z order should be negative; it can be set to a positive number but in this case the foreign window will appear on top of the Cascades' main window and will intercept the input events for the covered area.
To unbind the ForeignWindowControl from the window it was bound to it is sufficient to either call unbindFromWindow(). The control will be unbound from the old window, its boundToWindow property will be set to false and windowHandle will be set to 0. If later another window matching the windowId and windowGroup is attached to the window group the control will be bound to that window.
It is also possible to call bindToWindow() method with the window handle if it is known to manually bind the control to a window represented by the handle. The window handle in this case must be one obtained from another ForeignWindowControl (meaning the handle must have been be associated with Cascades screen context and not created by the application).
This is particularly useful for applications which want to reuse a ForeignWindowControl instance with different windows during the lifespan of the control.
VisualNode::opacity attribute on this control or its parents has no effect on the control (however VisualNode::visible does work and can be used for hiding the foreign window)
while the control can be arbitrary transformed the bound window can only be positioned as an axis aligned rectangle. Applying transforms such as rotation or scaling may result in rendering artifacts.
class HelloCascadesApp: public QObject
{
Q_OBJECT
public slots:
void onWindowAttached(screen_window_t handle,
const QString &group,
const QString &id);
public:
HelloCascadesApp();
private:
void createForeignWindow(const QString &group,
const QString &id,
int width, int height);
};
void HelloCascadesApp::onWindowAttached(screen_window_t handle,
const QString &group,
const QString &id)
{
// This signal will only be emitted when window with
// specified handle is attached;
// application change attached window's properties;
// no need to call bindToWindow() because it will be done
// automatically in this case
}
void HelloCascadesApp::createForeignWindow(const QString &group,
const QString &id,
int width, int height)
{
QByteArray groupArr = group.toAscii();
QByteArray idArr = id.toAscii();
Q_ASSERT(width > 0 && height > 0);
screen_context_t screen_ctx;
screen_create_context(&screen_ctx, SCREEN_APPLICATION_CONTEXT);
screen_window_t screen_win;
screen_create_window_type(&screen_win, screen_ctx,
SCREEN_CHILD_WINDOW);
screen_join_window_group(screen_win, groupArr.constData());
screen_set_window_property_cv(screen_win,
SCREEN_PROPERTY_ID_STRING,
idArr.length(),
idArr.constData());
int vis = 1;
screen_set_window_property_iv(screen_win,
SCREEN_PROPERTY_VISIBLE, &vis);
int color = 0xff0000ff;
screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_COLOR,
&color);
int rect[4] = { 0, 0, 1, 1 };
screen_set_window_property_iv(screen_win,
SCREEN_PROPERTY_BUFFER_SIZE,
rect+2);
int dims[2] = { width, height };
screen_set_window_property_iv(screen_win,
SCREEN_PROPERTY_SOURCE_SIZE,
dims);
int z = -5; // use negative Z order so that the window
// appears under the main window
screen_set_window_property_iv(screen_win,
SCREEN_PROPERTY_ZORDER, &z);
int pos[2] = { -rect[2], -rect[3] };
screen_set_window_property_iv(screen_win,
SCREEN_PROPERTY_SOURCE_POSITION,
pos);
screen_buffer_t screen_buf;
screen_create_window_buffers(screen_win, 1);
screen_get_window_property_pv(screen_win,
SCREEN_PROPERTY_RENDER_BUFFERS,
(void **)&screen_buf);
screen_post_window(screen_win, screen_buf, 1, rect, 0);
// note: no resource cleanup or error handling in the
// sample code
}
HelloCascadesApp::HelloCascadesApp()
{
const int WIN_W = 300;
const int WIN_H = 300;
// this will be the window id we'll set to the
// libscreen window
QString windowId("HelloCascadesAppID");
// create foreign window control and specify the same windowId
// as the one that will be set on the created libscreen window;
// windowGroup is initialized to the main window group id so no need
// to specify it
ForeignWindowControl *pFW = ForeignWindowControl::create()
.windowId(windowId)
.preferredSize(WIN_W, WIN_H);
Container *pContainer = Container::create()
.background(Color::Red)
.layout(AbsoluteLayout::create())
.add(Button::create()
.text("Overlapped by ForeignWindowControl")
.preferredWidth(350))
.add(pFW)
.add(Button::create()
.text("Overlapping ForeignWindowControl")
.ty(250)
.preferredWidth(350));
QObject::connect(pFW,
SIGNAL(windowAttached(screen_window_t,QString,QString)),
this,
SLOT(onWindowAttached(screen_window_t,QString,QString)));
createForeignWindow(pFW->windowGroup(), pFW->windowId(), WIN_W, WIN_H);
Application::instance()->setScene(Page::create().content(pContainer));
}
Here's an example for how to create a libscreen foreign window control in QML. Suppose there's a service called ViewFinder which is exposed as a context property with a createWindow() method which creates and attaches a window with the passed window group and id.
import bb.cascades 1.0
Page {
Container {
Button {
text: "Create ViewFinder"
// gets disabled once ForeignWindowControl is bound to a window
enabled: !viewWindow.boundToWindow
onClicked: {
// create a foreign window with current the dimensions of
// the ForeignWindowControl
ViewFinder.createWindow(viewWindow.windowGroup,
viewWindow.windowId,
handler.layoutFrame.width,
handler.layoutFrame.height);
}
}
ForeignWindowControl {
id: viewWindow
windowId: "MyWindowId" // the window id to bind to
// override the default properties to update window's size and position only
updatedProperties: WindowProperty.Size | WindowProperty.Position
visible: boundToWindow // becomes visible once bound to a window
preferredWidth: 400
preferredHeight: 400
attachedObjects: [
// layout handler to track control dimensions
LayoutUpdateHandler {
id: handler
}
]
}
}
}
BlackBerry 10.0.0
Inheritance
| bb::cascades::BaseObject | |||||
| bb::cascades::UIObject | |||||
| bb::cascades::VisualNode | |||||
| bb::cascades::Control | |||||
| bb::cascades::ForeignWindowControl | |||||
QML properties
| windowHandle | : QVariant |
| windowGroup | : QString |
| windowId | : QString |
| boundToWindow | : bool [read-only] |
| updatedProperties | : bb::cascades::WindowProperty::Types |
| keyInputForwardingEnabled | : bool |
| animations | : QDeclarativeListProperty< bb::cascades::AbstractAnimation > [read-only] |
| attachedObjects | : QDeclarativeListProperty< QObject > [read-only] |
| bottomMargin | : float |
| bottomMarginSet | : bool [read-only] |
| bottomPadding | : float |
| contextActions | : QDeclarativeListProperty< bb::cascades::ActionSet > [read-only] |
| 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 |
| gestureHandlers | : QDeclarativeListProperty< bb::cascades::GestureHandler > [read-only] |
| horizontalAlignment | : bb::cascades::HorizontalAlignment::Type |
| implicitLayoutAnimationsEnabled | : bool |
| inputRoute | : bb::cascades::InputRouteProperties [read-only] |
| keyListeners | : QDeclarativeListProperty< bb::cascades::KeyListener > [read-only] |
| layoutProperties | : bb::cascades::LayoutProperties |
| leftMargin | : float |
| leftMarginSet | : bool [read-only] |
| leftPadding | : float |
| maxHeight | : float |
| maxWidth | : float |
| minHeight | : float |
| minWidth | : float |
| 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 |
| shortcuts | : QDeclarativeListProperty< bb::cascades::AbstractShortcut > [read-only] |
| topMargin | : float |
| topMarginSet | : bool [read-only] |
| topPadding | : float |
| touchBehaviors | : QDeclarativeListProperty< bb::cascades::TouchBehavior > [read-only] |
| touchPropagationMode | : bb::cascades::TouchPropagationMode::Type |
| translationX | : float |
| translationY | : float |
| verticalAlignment | : bb::cascades::VerticalAlignment::Type |
| visible | : bool |
QML signals
Properties Index
Public Functions Index
| ForeignWindowControl (Container *parent=0) | |
| virtual | ~ForeignWindowControl () |
| screen_window_t | windowHandle () const |
| QString | windowGroup () const |
| QString | windowId () const |
| bool | isBoundToWindow () const |
| bb::cascades::WindowProperty::Types | updatedProperties () const |
| bool | isKeyInputForwardingEnabled () const |
| void | setWindowGroup (const QString &windowGroup) |
| void | setWindowId (const QString &windowId) |
| void | setWindowHandle (screen_window_t handle) |
| void | setUpdatedProperties (bb::cascades::WindowProperty::Types updatedProperties) |
| void | setKeyInputForwardingEnabled (bool keyInputForwardingEnabled) |
| Q_SLOT void | resetUpdatedProperties () |
| Q_SLOT void | resetKeyInputForwardingEnabled () |
| void | bindToWindow (screen_window_t windowHandle, const QString &windowGroup, const QString &windowId) |
| Q_SLOT void | unbindFromWindow () |
| Q_SLOT void | showContextMenu () |
| ActionSet * | actionSetAt (int index) const |
| int | actionSetCount () const |
| void | addActionSet (bb::cascades::ActionSet *actionSet) |
| void | addAnimation (AbstractAnimation *animation) |
| 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 |
| 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 | 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 () |
| float | maxHeight () const |
| float | maxWidth () const |
| float | minHeight () const |
| float | minWidth () 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 | removeAllGestureHandlers () |
| Q_INVOKABLE void | removeAllKeyListeners () |
| Q_INVOKABLE void | removeAllShortcuts () |
| void | removeAllTouchBehaviors () |
| bool | removeAnimation (AbstractAnimation *animation) |
| 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 | resetBottomMargin () |
| Q_SLOT void | resetBottomPadding () |
| 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 | 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 | setBottomMargin (float bottomMargin) |
| Q_SLOT void | setBottomPadding (float bottomPadding) |
| 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 | 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 |
| 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 | windowAttached (screen_window_t windowHandle, const QString &windowGroup, const QString &windowId) |
| void | windowDetached () |
| void | windowHandleChanged (screen_window_t windowHandle) |
| void | windowGroupChanged (const QString &windowGroup) |
| void | windowIdChanged (const QString &windowId) |
| void | boundToWindowChanged (bool boundToWindow) |
| void | updatedPropertiesChanged (bb::cascades::WindowProperty::Types newUpdatedProperties) |
| void | keyInputForwardingEnabledChanged (bool keyInputForwardingEnabled) |
| void | controlFrameChanged (const QRectF &frame) |
| 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 | 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 | 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
QVariant
Property specifying the window handle this control is or will be bound to.
The value of this property can be safely converted to screen_window_t type.
If this property is specified the actual handle value must have come from another (or the same) ForeignWindowControl since has to bound to the cascades libscreen context and not the context created by the application.
Changing this property after the control was bound to an attached window will result in the control being unbound from the window (boundToWindow property will become false) and it will remain unbound until a window matching new parameters is attached or bindToWindow() is called to bind to a window manually.
A windowHandleChanged() signal is emitted when this property changes.
The default value of this property is 0.
BlackBerry 10.0.0
QString
Property specifying the window group a window must join in order to be bound to this control.
Only windows attached to a group with this name (which corresponds to SCREEN_PROPERTY_GROUP property of the window in libscreen API) and the window id specified by windowId property will result in windowAttached signal being emitted.
Specifying just this property without windowId is not sufficient for binding the control to an attached window. Both windowId and windowGroup properties must be specified for the control to bind to a window attached to the group.
A windowGroupChanged() signal is emitted when this property changes.
BlackBerry 10.0.0
QString
Property specifying the window id a window joining the group specified by windowGroup property must have in order to be gound to this control.
The application must specify this property in order for the control to be bound to a window attached to group specified by windowGroup property.
If this property is set only window with matching window id property (which corresponds to SCREEN_PROPERTY_ID_STRING property of the window in libscreen API) and the group specified by windowGroup will result in windowAttached() signal being emitted and control being bound to the window.
Specifying just this property without windowGroup is not sufficient for binding the control to an attached window. Both windowId and windowGroup properties must be specified for the control to bind to a window attached to the group.
A windowIdChanged() signal is emitted when this property changes.
The default value of this property is QString::null.
BlackBerry 10.0.0
bool
A read-only property which tells whether this control is currently bound to a window.
This property will be true after the control has been either explicitly (by calling bindToWindow()) or automatically (if a matching window was attached) bound to a window, false otherwise.
An boundToWindowChanged() signal is emitted when this property changes.
The default value of this property is false.
BlackBerry 10.0.0
bb::cascades::WindowProperty::Types
A property for specifying which associated window's properties (if any) the control should automatically update.
If this property is set to a value other than WindowProperty::None the control will automatically update specified properties of the window the control is bound as properties of the control change.
Here is the list of possible window properties and their effect in regards to this proprety:
WindowProperty::None : Value signifying that no property of the bound window should be updated (should be used exclusive to other values)
WindowProperty::Position : Specifies that SCREEN_PROPERTY_POSITION property of the window should be updated to match the position of the ForeignWindowControl .
WindowProperty::Size : Specifies that SCREEN_PROPERTY_SIZE property of the window should be updated to match the dimensions of the ForeignWindowControl .
WindowProperty::SourceSize : Specifies that SCREEN_PROPERTY_SOURCE_SIZE property of the window should be updated to the dimensions of the ForeignWindowControl (this effectively means that window's content will always be presented at 1:1 ratio)
- WindowProperty::Visible : Specifies that SCREEN_PROPERTY_VISIBLE property of the window should be updated to match the VisualNode::visible property of the ForeignWindowControl control.Note:Combinations of properties can be also used. For example if this property is set to a combination of flags (WindowProperty::Size | WindowProperty::Position) the control will update SCREEN_PROPERTY_SIZE and SCREEN_PROPERTY_POSITION properites of the window it is bound to whenever the size or position of the control changes.
that this does not mean that the control's inherited visibility is used to set the window's _VISIBLE property; only that the window's SCREEN_PROPERTY_VISIBLE is bound to the ForeignWindowControl control's visible property. So if for example any of control's parents become invisible (their visible property is set to false) this ForeignWindowControl visible property won't change and so won't its bound window's _VISIBLE property.
An updatedPropertiesChanged() signal is emitted when this property changes.
The default value of this property is a combination of WindowProperty flags: (Position | Size | SourceSize) which means that the control will update SCREEN_PROPERTY_SIZE, SCREEN_PROPERTY_SOURCE_SIZE and SCREEN_PROPERTY_POSITION properites of the window.
BlackBerry 10.0.0
bool
A property specifying whether the control should receive Cascades key events when it is in focus (Control::focused is true) or whether raw libscreen key input should be forwarded to the libscreen window bound to this control.
If the property is set to true then when this control is in focus the bound foreign window will receive key input focus (specifically, the foreign window will receive the keyboard focus in the Cascades' main window group, see SCREEN_PROPERTY_KEYBOARD_FOCUS in libscreen docs for more information) and get raw key input events. When the control loses focus the input focus will be transferred to Cascades main window or other ForeignWindowControl 's window if one is in focus and requested key input forwarding.
If this property is set to false the control will be receiving key input like any Cascades control does when it is in focus.
In order for the foreign window to be able to receive key input focus it must be attached to the Cascades' main window group.
The default value of this property is false.
BlackBerry 10.0.0
QDeclarativeListProperty< bb::cascades::AbstractAnimation >
List of the animations attached to the visual node.
This node will be used as the implicit target for the animations in this list.
BlackBerry 10.0.0
QDeclarativeListProperty< QObject >
A hierarchical list of the UIObject's attached objects.
This QDeclarativeListProperty can contain any QObject. When a QObject is added to property, the UIObject takes ownership of the attached object.
This feature is typically used from QML to specify business logic object or any other shared objects for the subnodes of this UIObject. In C++ the same functionality can be achived by setting a parent of a QObject to be attached to the QObject which is going to own it.
QML usage example (MyObject is a custom class registered for QML using the qmlRegisterType() function):
Container {
Label { text: "Title: " + myObject.title }
Label { text: "Subject: " + myObject.subject }
attachedObjects: [
MyObject { id: myObject
title: "Hello World"
subject: "Nice Day"
}
]
}
BlackBerry 10.0.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.
QDeclarativeListProperty< bb::cascades::ActionSet >
A list of ActionSet object that are displayed in the control's context menu.
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
QDeclarativeListProperty< bb::cascades::GestureHandler >
List of the gesture handlers added on the visual node.
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
QDeclarativeListProperty< bb::cascades::KeyListener >
A list of key listeners attached to this control.
The order in which key listeners are added does not change their behavior
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
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.
As the objectName property is overridden from the QObject class, this signal will not be emitted if setObjectName() function is called directly on QObject.
The default value of this property is QString::null.
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 isPreferredWidthSet().
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
QDeclarativeListProperty< bb::cascades::AbstractShortcut >
A list of shortcuts that can be triggered via user actions.
The order in which they are added will determine which shortcut will be triggered in case of an overlap. Note that predefined shortcuts have precedence over shortcuts defined via QString in case of a collision
BlackBerry 10.1.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.
QDeclarativeListProperty< bb::cascades::TouchBehavior >
List of the touch behaviors added on the visual node.
BlackBerry 10.0.0
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::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 Functions
Constructs a foreign window control and specifies the parent container.
The ownership of the control is transfered to the parent if a parent is specified.
| Parameters | |
|---|---|
| parent |
The parent container or 0. This parameter is optional. The default is 0 if you don't specify a parent. |
BlackBerry 10.0.0
virtual
Destructor.
Note that destroying a ForeignWindowControl has no effect on the window it is bound to.
BlackBerry 10.0.0
screen_window_t
Returns window handle this control is or will be bound to.
a window handle
BlackBerry 10.0.0
QString
Returns window group this control is or will be bound to.
a string representing window group
BlackBerry 10.0.0
QString
Returns window id this control is or will be bound to.
a string representing window id
BlackBerry 10.0.0
bool
Returns whether the control has been bound to an attached window.
true if the control has been bound to a window, false otherwise.
BlackBerry 10.0.0
bb::cascades::WindowProperty::Types
Returns the properties which whether the control will automatically update for the window it is bound to.
a set of flags representing the properties the control will update, or WindowProperty::None if no properties will be updated.
BlackBerry 10.0.0
bool
Returns whether window bound to the control will receive key input or the control will receive Cascades' key input.
true if the bound libscreen window will receive key input, false if the control will receive Cascades' key input
BlackBerry 10.0.0
void
Sets the window group this control is or will be bound to.
Changing this property while the control is bound to a window will cause it to unbind from the window it was bound to.
| Parameters | |
|---|---|
| windowGroup |
a string representing window group |
BlackBerry 10.0.0
void
Sets the window id this control is or will be bound to.
Changing this property while the control is bound to a window will cause it to unbind from the window it was bound to.
| Parameters | |
|---|---|
| windowId |
a string representing window group |
BlackBerry 10.0.0
void
Sets the window handle this control is or will be bound to.
Changing this property while the control is bound to a window will cause it to unbind from the window it was bound to.
| Parameters | |
|---|---|
| handle |
a window handle (screen_window_t type) |
BlackBerry 10.0.0
void
Sets the properties the control will update on the foreign window it is bound to.
pForeignWindow->setUpdatedProperties(WindowProperty::Size | WindowProperty::Position);
| Parameters | |
|---|---|
| updatedProperties |
the flags representing properties to be updated by the control on the window it is bound to, or WindowProperty::None if no properties are to be updated. |
BlackBerry 10.0.0
void
Sets whether the control should receive Cascades key events when in focus or if the OS input focus should be transferred to the control's bound window instead.
| Parameters | |
|---|---|
| keyInputForwardingEnabled |
if true the control will receive key events when in focus, if false OS input focus will be transferred to the foreign window and the control will not receive Cascades' key events. |
BlackBerry 10.0.0
Q_SLOT void
Sets the value of updatedProperties property to its default value which is a combination of WindowProperty flags: (Position | Size | SourceSize)
BlackBerry 10.0.0
Q_SLOT void
Sets the value keyInputForwardingEnabled property to its default value which is true.
BlackBerry 10.0.0
void
Binds this control with a window specified by the arguments.
After this call the control will start updating associated window's position and dimensions to match those of the control so that the window always matches control's position and dimensions.
The id, group and handle properties of the control will be updated to reflect the attached window's parameters.
This method should be called only after the window was attached to the group, which means either from a slot connected to windowAttached() signal or after the signal was emitted. Calling this method before window is attached may cause issues since the control will try to manipulate the window which hasn't been attached yet.
Calling this method after the control was already previously bound to an attached window (either explicitly with bindToWindow() during attachment phase or automatically if window id and/or handle were specified and a matching window was attached) will result in the control first being unbound from the window (boundToWindow property will become false) and then it will be associated with the new window (boundToWindow property will become true).
| Parameters | |
|---|---|
| windowHandle |
a window handle of the child window associated with Cacscades' screen context for the control to be bound to |
| windowGroup |
a string representing the window group |
| windowId |
a string representing the id of the window. |
BlackBerry 10.0.0
Q_SLOT void
Unbind this control from foreign window it is currently bound to.
If the control is bound to a window (boundToWindow property is true) unbinding will cause the control to stop updating the bound window's propertkes such as position and dimensions (it the control was configured to do that), stop forwarding key input to the window (it it was forwarding). The control will also not receive a windowDetached signal if the previously bound window detaches from the group.
The boundToWindow property of the control will be set to false and windowHandle property will be set to 0.
If later a window matching current windowGroup and windowId properties is attached the control will bind to that window.
If the control isn't bound to a window (boundToWindow property was false) calling this method has no effect.
BlackBerry 10.0.0
ActionSet * 
Returns an ActionSet at a specified index.
Ownership of the ActionSet object remains with the control.
| 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.
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.
| 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
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 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 
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
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.
| 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.
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.
BlackBerry 10.0.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
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.0
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.0
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.0
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 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_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 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 
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_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 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
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
Constructs a builder used to construct a foreign window control.
ForeignWindowControl *pForeignWindow = ForeignWindowControl::create()
.windowId("MyWindow")
.updatedProperties(WindowProperty::Size | WindowProperty::Position);
A builder used to construct a foreign window control.
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 a window matching this window's parameters (id and handle if specified) is attached to the specified group.
This signal is emitted only when a window matching specified by this control's windowId and windowGroup properties is attached to the group specified by windowGroup property. The control will be automatically bound to the attached window.
| Parameters | |
|---|---|
| windowHandle |
a window handle of the child window which was attached This handle is associated with the main window's context. |
| windowGroup |
a string representing the group which this window has joined (typically but not necessarily matches the main window group) |
| windowId |
a string representing the id of the window if the window had it set; QString::null otherwise |
BlackBerry 10.0.0
void
Emitted when a attached window closes down and it is removed from the group.
This signal is emitted when the attached window is closed.
The handle in windowHandle property is not valid when this signal is emitted since the window has already been destroyed.
After the control emits this signal the windowHandle property will be reset to the default value of 0 and the boundToWindow property will be set to false.
BlackBerry 10.0.0
void
Emitted when the window handle of this control is changed.
| Parameters | |
|---|---|
| windowHandle |
a new window handle |
BlackBerry 10.0.0
void
Emitted when the window group of this control is changed.
| Parameters | |
|---|---|
| windowGroup |
a string representing new window group |
BlackBerry 10.0.0
void
Emitted when the window id of this control is changed.
| Parameters | |
|---|---|
| windowId |
a string representing new window id |
BlackBerry 10.0.0
void
Emitted when control becomes bound to a window.
| Parameters | |
|---|---|
| boundToWindow |
indicates whether the window is bound or not, if true control was bound to a window; if false it was unbound. |
BlackBerry 10.0.0
void
Emitted when the updatedProperties 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 updatedProperties instead of newUpdatedProperties).
| Parameters | |
|---|---|
| newUpdatedProperties |
the flags representing the properties to be updated or WindowProperty::None if none should be updated |
BlackBerry 10.0.0
void
Emitted when the keyInputForwardingEnabled property changes.
| Parameters | |
|---|---|
| keyInputForwardingEnabled |
true if the key input is to be transferred to the bound libscreen window, false if the control should receive key input from Cascades. |
BlackBerry 10.0.0
void
Emitted when either position or dimensions of the control are changed.
This signal can be used for cases where the application needs to respond to layout and animation system changing the position and size of the ForeignWindowControl control. Application can use the frame to update the content displayed by the foreign window or for positioning and resizing the window to match ForeignWindowControl 's on the screen in case automatic update of the window properties is not desired.
The signal is be emitted irrespective of whether the control is bound to a libscreen window or not.
| Parameters | |
|---|---|
| frame |
a QRectF object representing the control frame in parent window's coordinate system. |
BlackBerry 10.0.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 
This signal is emitted only when this object is instantiated as a result of loading a QML document and creating the root node, or when an object is being constructed using its builder class.
This signal is emitted only 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 is emitted to indicate 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 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