SystemDialog
#include <bb/system/SystemDialog>
To link against this class, add the following line to your .pro file: LIBS += -lbbsystem
A dialog box that presents the user with text and buttons in its content area.
The dialog box displayed will be an application-modal window, though it is possible to use a system-modal window by setting the SystemDialog::modality property.
In addition, the buttonAreaLimit property controls the number of buttons that will be contained in the button area of the window. By default, the button area will be large enough to contain confirmButton, customButton, and cancelButton, if they are valid. The buttons will be considered invalid if they do not have a label set.
Presentation properties are marked as such, and affect future requests. Any pending requests will use the values of the presentation properties at the time of the request.
BlackBerry 10.0.0
Properties Index
Public Functions Index
| SystemDialog (QObject *parent=0) | |
| SystemDialog (const QString &confirmLabel, QObject *parent=0) | |
| SystemDialog (const QString &confirmLabel, const QString &cancelLabel, QObject *parent=0) | |
| SystemDialog (const QString &confirmLabel, const QString &customLabel, const QString &cancelLabel, QObject *parent=0) | |
| virtual | ~SystemDialog () |
| QString | title () const |
| QString | body () const |
| bool | emoticonsEnabled () const |
| bool | includeRememberMe () const |
| bool | rememberMeChecked () const |
| QString | rememberMeText () const |
| SystemUiButton * | confirmButton () |
| SystemUiButton * | customButton () |
| SystemUiButton * | cancelButton () |
| SystemUiButton * | defaultButton () |
| bool | dismissAutomatically () const |
| bb::system::SystemUiReturnKeyAction::Type | returnKeyAction () const |
| bb::system::SystemUiModality::Type | modality () const |
| int | buttonAreaLimit () const |
| void | setTitle (const QString &title) |
| void | setBody (const QString &body) |
| void | setEmoticonsEnabled (bool newEmoticonsEnabled) |
| void | setIncludeRememberMe (bool value) |
| void | setRememberMeChecked (bool newRememberMeSelected) |
| void | setRememberMeText (const QString &newRememberMeText) |
| void | setDefaultButton (bb::system::SystemUiButton *newDefaultButton) |
| void | setDismissAutomatically (bool automaticDismissal) |
| void | setReturnKeyAction (bb::system::SystemUiReturnKeyAction::Type newReturnKeyAction) |
| void | setModality (bb::system::SystemUiModality::Type newModality) |
| void | setButtonAreaLimit (int newButtonAreaLimit) |
| Q_INVOKABLE void | resetTitle () |
| Q_INVOKABLE void | resetBody () |
| Q_INVOKABLE void | resetEmoticonsEnabled () |
| Q_INVOKABLE void | resetIncludeRememberMe () |
| Q_INVOKABLE void | resetRememberMeChecked () |
| Q_INVOKABLE void | resetRememberMeText () |
| Q_INVOKABLE void | resetConfirmButton () |
| Q_INVOKABLE void | resetCustomButton () |
| Q_INVOKABLE void | resetCancelButton () |
| Q_INVOKABLE void | resetDefaultButton () |
| Q_INVOKABLE void | resetDismissAutomatically () |
| Q_INVOKABLE void | resetReturnKeyAction () |
| Q_INVOKABLE void | resetModality () |
| Q_INVOKABLE void | resetButtonAreaLimit () |
| void | appendButton (SystemUiButton *button) |
| Q_INVOKABLE int | buttonCount () const |
| SystemUiButton * | buttonAt (int index) const |
| Q_INVOKABLE void | clearButtons () |
| bb::system::SystemUiResult::Type | result () const |
| bb::system::SystemUiError::Type | error () const |
| Q_INVOKABLE bb::system::SystemUiButton * | buttonSelection () const |
| Q_INVOKABLE bool | rememberMeSelection () const |
Public Slots Index
| void | show () |
| bb::system::SystemUiResult::Type | exec () |
| void | cancel () |
Signals Index
| void | finished (bb::system::SystemUiResult::Type value) |
| void | titleChanged (const QString &value) |
| void | bodyChanged (const QString &value) |
| void | emoticonsEnabledChanged (bool newEmoticonsEnabled) |
| void | includeRememberMeChanged (bool value) |
| void | rememberMeCheckedChanged (bool newRememberMeSelected) |
| void | rememberMeTextChanged (const QString &newRememberMeText) |
| void | defaultButtonChanged (bb::system::SystemUiButton *newDefaultButton) |
| void | dismissAutomaticallyChanged (bool automaticDismissal) |
| void | returnKeyActionChanged (bb::system::SystemUiReturnKeyAction::Type newReturnKeyAction) |
| void | modalityChanged (bb::system::SystemUiModality::Type newModality) |
| void | buttonAreaLimitChanged (int newButtonAreaLimit) |
Properties
QString
title represents the title of the window.
This is a presentation property whose default value is a default-constructed QString.
BlackBerry 10.0.0
QString
body represents the main text of the window.
This is a presentation property whose default value is a default-constructed QString.
BlackBerry 10.0.0
bool
Retrieves whether the text can be displayed with emoticons.
This is a presentation property whose default value is false.
BlackBerry 10.0.0
bool
includeRememberMe indicates whether a toggle switch for remembering user selection should be included in the dialog box.
If a toggle switch is requested, then the user will have the ability to enable and disable it. The user selection will be available using rememberMeSelection() when the request is finished. To customize how the toggle switch is presented, use rememberMeChecked and rememberMeText.
This is a presentation property whose default value is false.
BlackBerry 10.0.0
bool
Represents the checked state of the toggle switch for remembering user selection.
The state is only applied if includeRememberMe is true. To obtain the user selection for this property once the request is finished, use rememberMeSelection().
This is a presentation property whose default value is true.
BlackBerry 10.0.0
QString
Represents the text to associate with the toggle switch associated with rememberMeChecked.
This property is only applied if includeRememberMe is true.
This is a presentation property whose default value is "Remember Me".
BlackBerry 10.0.0
int
The maximum number of buttons that can be shown without causing an overflow.
When overflow occurs all buttons will be stacked vertically.
-1 implies that default system behavior will be applied. The supported range is 1-3, with any values outside the range resetting the property to its default value.
BlackBerry 10.0.0
bool
Indicates whether to dismiss the dialog box when a button is selected.
If false, the dialog box must be dismissed using cancel(). Otherwise, the dialog box is dismissed with a button selection.
This is a presentation property whose default value is true.
BlackBerry 10.0.0
bb::system::SystemUiReturnKeyAction::Type
Represents the action associated with the return key for this dialog box.
bb::system::SystemUiReturnKeyAction for the list of possible values.
BlackBerry 10.0.0
bb::system::SystemUiModality::Type
Represents the modality of the dialog box.
bb::system::SystemUiModality for the list of valid values.
BlackBerry 10.0.0
bb::system::SystemUiButton
Represents the button associated with the default confirming action of the window.
This is a presentation property whose default bb::system::SystemUiButton::label property is "OK".
This button is omitted if its bb::system::SystemUiButton::label property is a default-constructed QString.
BlackBerry 10.0.0
bb::system::SystemUiButton
Represents the button associated with the tertiary action of the window.
This is a presentation property whose default bb::system::SystemUiButton::label property is a default-constructed QString.
This button is omitted if its bb::system::SystemUiButton::label property is a default-constructed QString.
BlackBerry 10.0.0
bb::system::SystemUiButton
Represents the button associated with the default cancellation action of the window.
This is a presentation property whose default bb::system::SystemUiButton::label property is "Cancel".
This button is omitted if its bb::system::SystemUiButton::label property is a default-constructed QString.
BlackBerry 10.0.0
bb::system::SystemUiButton
Represents the button associated with the return key action of the window.
When the user triggers the return key action, this button will be automatically selected. If the defaultButton is NULL, then triggering the return key action will not select any button.
If defaultButton is set to a button that this instance does not manage, then this property is undefined.
confirmButton
cancelButton
customButton
last element of buttons
BlackBerry 10.0.0
QDeclarativeListProperty< bb::system::SystemUiButton >
Represents any additional buttons to include in the window.
This is a presentation property which is initialized as an empty list.
BlackBerry 10.0.0
bb::system::SystemUiResult::Type
Represents the result of the last completed request.
result() - the result of the request
error() - the error that occurred during the request (if applicable)
buttonSelection() - the button selected (if applicable)
rememberMeSelection() - the user preference as to whether the result should be remembered (if applicable)
bb::system::SystemUiResult for the list of possible results.
BlackBerry 10.0.0
bb::system::SystemUiError::Type
Represents the last error encountered.
bb::system::SystemUiError for the list of possible errors.
BlackBerry 10.0.0
Public Functions
The default property is buttons.
Constructs a new instance of a dialog box with default confirmation and cancellation buttons.
| Parameters | |
|---|---|
| parent |
If not 0, the supplied parent will be responsible for deleting this instance. |
BlackBerry 10.0.0
Constructs a new instance of a dialog box with only a confirmation button.
| Parameters | |
|---|---|
| confirmLabel |
The label to use for the confirmation button. |
| parent |
If not 0, the supplied parent will be responsible for deleting this instance. |
BlackBerry 10.0.0
Constructs a new instance of a dialog box with defined confirmation and cancellation buttons.
| Parameters | |
|---|---|
| confirmLabel |
The label to use for the confirmation button. |
| cancelLabel |
The label to use for the cancellation button. |
| parent |
If not 0, the supplied parent will be responsible for deleting this instance. |
BlackBerry 10.0.0
Constructs a new instance of a dialog box with defined confirmation, custom and cancellation buttons.
| Parameters | |
|---|---|
| confirmLabel |
The label to use for the confirmation button. |
| customLabel |
The label to use for the custom button. |
| cancelLabel |
The label to use for the cancellation button. |
| parent |
If not 0, the supplied parent will be responsible for deleting this instance. |
BlackBerry 10.0.0
virtual
Destructor.
BlackBerry 10.0.0
QString
Retrieves the title for the dialog box.
The title of the dialog box.
BlackBerry 10.0.0
QString
Retrieves the main text of the dialog box.
The text of the dialog box.
BlackBerry 10.0.0
bool
Retrieves whether the text can be displayed as emoticons.
Whether the dialog box supports emoticons.
BlackBerry 10.0.0
bool
Retrieves the flag indicating if a toggle switch to remember user selection should be included in the dialog box.
true if a toggle for remembering the user selection should be included in the dialog box, false otherwise.
BlackBerry 10.0.0
bool
Retrieves whether the toggle switch for includeRememberMe will be selected by default.
true if the toggle should be selected by default, false otherwise.
BlackBerry 10.0.0
QString
Retrieves the text associated with the toggle switch for includeRememberMe.
The text for the toggle for includeRememberMe.
BlackBerry 10.0.0
SystemUiButton *
Retrieves the button attached to the dialog box's confirm button.
The dialog box's confirmation button.
BlackBerry 10.0.0
SystemUiButton *
Retrieves the dialog box's custom action button.
The dialog box's custom action button.
BlackBerry 10.0.0
SystemUiButton *
Retrieves the dialog box's cancellation button.
The dialog box's cancellation button.
BlackBerry 10.0.0
SystemUiButton *
Retrieves the dialog box's default button.
This instance retains ownership of the returned value.
The default button is automatically selected when the user triggers the return key action. If the default button is NULL, no button will be automatically selected.
The dialog box's default button.
BlackBerry 10.0.0
bool
Indicates if the dialog box is dismissed when a button is selected.
true if selecting a button dismisses the dialog box, false otherwise.
BlackBerry 10.0.0
bb::system::SystemUiReturnKeyAction::Type
Retrieves the dialog box's return key action.
The dialog box's return key action.
BlackBerry 10.0.0
bb::system::SystemUiModality::Type
Retrieves the dialog box's modality.
The dialog box's modality. See bb::system::SystemUiModality for the list of possible values.
BlackBerry 10.0.0
int
The maximum number of buttons that can be shown without causing an overflow.
The limit for the number of buttons that can be accommodated in the button area, or -1 if system defaults should be used.
BlackBerry 10.0.0
void
Sets the title for the dialog box.
| Parameters | |
|---|---|
| title |
The new title of the dialog box. |
BlackBerry 10.0.0
void
Sets the main text of the dialog box.
| Parameters | |
|---|---|
| body |
The new text of the dialog box. |
BlackBerry 10.0.0
void
Sets whether the text can be displayed as emoticons.
| Parameters | |
|---|---|
| newEmoticonsEnabled |
Whether the dialog box supports emoticons. |
BlackBerry 10.0.0
void
Sets the flag indicating if a toggle switch for remembering user selection should be included in the dialog box.
| Parameters | |
|---|---|
| value |
true if a toggle for remembering user selection should be included, false otherwise. |
BlackBerry 10.0.0
void
Sets whether the toggle switch for includeRememberMe will be selected by default.
| Parameters | |
|---|---|
| newRememberMeSelected |
true if the toggle should be selected by default, false otherwise. |
BlackBerry 10.0.0
void
Sets the text associated with the toggle switch for includeRememberMe.
| Parameters | |
|---|---|
| newRememberMeText |
The new text for the toggle for includeRememberMe. |
BlackBerry 10.0.0
void
Sets the dialog box's default button.
newDefaultButton must be one of the buttons managed by this instance, or NULL. If NULL is specified, then no button will be associated with the return key action.
| Parameters | |
|---|---|
| newDefaultButton |
The button to associate with the return key action. |
BlackBerry 10.0.0
void
Sets whether the dialog box is dismissed when a button is selected.
| Parameters | |
|---|---|
| automaticDismissal |
true if the dialog box should be automatically dismissed on a button press, false otherwise. |
BlackBerry 10.0.0
void
Sets the return key action for the dialog box.
| Parameters | |
|---|---|
| newReturnKeyAction |
The new return key action. |
BlackBerry 10.0.0
void
Sets the modality for the dialog box.
| Parameters | |
|---|---|
| newModality |
The new modality preference. See bb::system::SystemUiModality for the list of possible values. |
BlackBerry 10.0.0
void
Sets the maximum number of buttons to accommodate in the dialog box button area without overflow.
| Parameters | |
|---|---|
| newButtonAreaLimit |
The maximum number of buttons in the button area. |
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the title of the dialog box to QString::null.
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the main text of the dialog box to QString::null.
BlackBerry 10.0.0
Q_INVOKABLE void
Resets whether the text can display emoticons to false.
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the flag to show the toggle for remembering user selection to false.
To reset the selection state for the toggle, use resetRememberMeChecked().
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the selection state for the toggle switch for includeRememberMe to true.
To reset whether to include the toggle switch use resetIncludeRememberMe().
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the text for the toggle switch for includeRememberMe to "Remember Me".
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the confirmation button for this dialog box.
When the confirmation button is reset, its label will be set to the default value of "OK".
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the custom action button for this dialog box.
Q_INVOKABLE void
Resets the cancellation button for this dialog box.
When the cancellation button is reset, its label will be set to the default value of "Cancel".
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the default button for this dialog box based on the property's precedence rules.
BlackBerry 10.0.0
Q_INVOKABLE void
Resets whether the dialog box is dismissed when a button is selected to true.
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the return key action of the dialog box to bb::system::SystemUiReturnKeyAction::Default.
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the modality of the dialog box to bb::system::SystemUiModality::Application.
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the maximum number of buttons to accommodate in the dialog box button area without overflow to -1.
BlackBerry 10.0.0
void
Appends a button to the list of other buttons for this dialog box.
| Parameters | |
|---|---|
| button |
The button to add to this dialog box. |
BlackBerry 10.0.0
Q_INVOKABLE int
Retrieves the number of other buttons added to the dialog box.
The number of other buttons.
BlackBerry 10.0.0
SystemUiButton *
Retrieves the button at the supplied index.
| Parameters | |
|---|---|
| index |
An index into the list of buttons added using the appendButton() method. |
The button at the supplied index or 0 if an invalid index is provided.
BlackBerry 10.0.0
Q_INVOKABLE void
Clears the list of other buttons for this dialog box.
This only affects buttons added to the dialog box using the appendButton() method. This method does not affect the confirmation, custom, or cancellation buttons. The button instances will be deleted.
BlackBerry 10.0.0
bb::system::SystemUiResult::Type
Retrieves the result of the last completed request.
The result of the last completed request. See bb::system::SystemUiResult for the list of possible results.
BlackBerry 10.0.0
bb::system::SystemUiError::Type
Retrieves the error that occurred during the request.
The error that occurred. See bb::system::SystemUiError for the list of possible errors.
BlackBerry 10.0.0
Q_INVOKABLE bb::system::SystemUiButton *
Returns the button that was selected when a button selection is made.
If no button was selected, 0 will be returned.
This function will return the result of the button selection of show() and exec().
The return value will be reset when a new request is made.
The button selected by the user.
BlackBerry 10.0.0
Q_INVOKABLE bool
Returns the state of the toggle for remembering user selection when the user dismisses the dialog box.
true if the toggle for remembering the user selection was checked, false otherwise.
BlackBerry 10.0.0
Public Slots
void
Displays or updates the dialog box based on current property values.
The result of the request can be retrieved with the SystemDialog::result property, or using the finished() signal. The button selection can be retrieved with the SystemDialog::buttonSelection property.
Control is returned to the caller immediately. For a blocking request, use exec().
BlackBerry 10.0.0
bb::system::SystemUiResult::Type
Displays the dialog box based on current property values.
The result of the request can be retrieved with the SystemDialog::result property, or using the finished() signal. The button selection can be retrieved with the SystemDialog::buttonSelection property.
Unlike show(), this function will block until a button selection is made.
Any connections to this slot must use a Qt::QueuedConnection, or the slot must be triggered using QTimer::singleShot(), and
QObject::deleteLater() must be used in place of delete when deleting the dialog box object. If these conditions are not met, unexpected behavior may result.
The result of the request. See bb::system::SystemUiResult for the list of possible results.
BlackBerry 10.0.0
void
Cancels the dialog box if it is still displayed.
BlackBerry 10.0.0
Signals
void
Emitted when a request is completed.
| Parameters | |
|---|---|
| value |
The result of the request. See bb::system::SystemUiResult for the list of possible results. |
BlackBerry 10.0.0
void
Emitted when the title property is changed programmatically.
| Parameters | |
|---|---|
| value |
The new value of the title property. |
BlackBerry 10.0.0
void
Emitted when the body property is changed programmatically.
| Parameters | |
|---|---|
| value |
The new value of the body property. |
BlackBerry 10.0.0
void
Emitted when the emoticonsEnabled property is changed programmatically.
| Parameters | |
|---|---|
| newEmoticonsEnabled |
The new value of the emoticonsEnabled property. |
BlackBerry 10.0.0
void
Emitted when the includeRememberMe property is changed programmatically.
| Parameters | |
|---|---|
| value |
The new value of the includeRememberMe property. |
BlackBerry 10.0.0
void
Emitted when the rememberMeChecked property is changed programmatically.
| Parameters | |
|---|---|
| newRememberMeSelected |
The new value of the rememberMeChecked property. |
BlackBerry 10.0.0
void
Emitted when the rememberMeText property is changed programmatically.
| Parameters | |
|---|---|
| value |
The new value of the rememberMeText property. |
BlackBerry 10.0.0
void
Emitted when the defaultButton property is changed programmatically.
| Parameters | |
|---|---|
| newDefaultButton |
The new value of the defaultButton property, or NULL if none is set. |
BlackBerry 10.0.0
void
Emitted when the dismissAutomatically property is changed programmatically.
| Parameters | |
|---|---|
| automaticDismissal |
The new value of the dismissAutomatically property. |
BlackBerry 10.0.0
void
Emitted when the returnKeyAction property is changed programmatically.
| Parameters | |
|---|---|
| newReturnKeyAction |
The new value of the returnKeyAction property. |
BlackBerry 10.0.0
void
Emitted when the modality property is changed programmatically.
| Parameters | |
|---|---|
| newModality |
The new value of the modality property. |
BlackBerry 10.0.0
void
Emitted when the buttonAreaLimit property is changed programmatically.
| Parameters | |
|---|---|
| newButtonAreaLimit |
The new value of the buttonAreaLimit property. |
BlackBerry 10.0.0