DeleteActionItem
Since: BlackBerry 10.0.0
#include <bb/cascades/DeleteActionItem>
The DeleteActionItem is used to specify that an action is a "destructive" action.
Actions of this type will always be placed in the overflow menu in a fixed position. According to general guidelines all destructive action such as 'delete' should use this action type to ensure a consistent UI experience.
If an image isn't specified on the DeleteAction a default delete icon will be displayed. and if a title isn't specified, a default string "Delete" will be shown.
Overview
Inheritance
bb::cascades::BaseObject | ||||
bb::cascades::UIObject | ||||
bb::cascades::AbstractActionItem | ||||
bb::cascades::DeleteActionItem |
QML properties
Only has inherited QML properties
accessibility | : bb::cascades::AbstractA11yObject [read-only]![]() |
attachedObjects | : QDeclarativeListProperty< QObject > [read-only]![]() |
backgroundColor | : bb::cascades::Color | bb::cascades::ColorPaint![]() |
shortcuts | : QDeclarativeListProperty [read-only]![]() |
builtInShortcutsEnabled | : bool![]() |
defaultAction | : bool![]() |
enabled | : bool![]() |
image | : bb::cascades::Image![]() |
imageSource | : QUrl![]() |
objectName | : QString![]() |
parent | : QObject [read-only]![]() |
title | : QString![]() |
ui | : bb::cascades::UIConfig [read-only]![]() |
QML signals
Only has inherited QML signals
Properties Index
Only has inherited properties
bb::cascades::AbstractA11yObject | accessibility [read-only]![]() |
QDeclarativeListProperty< QObject > | attachedObjects [read-only]![]() |
QVariant | backgroundColor![]() |
QDeclarativeListProperty | shortcuts [read-only]![]() |
bool | builtInShortcutsEnabled![]() |
bool | defaultAction![]() |
bool | enabled![]() |
QVariant | image![]() |
QUrl | imageSource![]() |
QString | objectName![]() |
QObject | parent [read-only]![]() |
QString | title![]() |
bb::cascades::UIConfig | ui [read-only]![]() |
Public Functions Index
DeleteActionItem () | |
virtual | ~DeleteActionItem () |
bb::cascades::AbstractA11yObject * | accessibility () const ![]() |
Q_INVOKABLE void | addShortcut (bb::cascades::AbstractShortcut *shortcut)![]() |
QVariant | backgroundColor () const ![]() |
Q_INVOKABLE bool | builtInShortcutsEnabled () const ![]() |
Q_INVOKABLE void | disableAllShortcuts ()![]() |
Q_INVOKABLE void | enableAllShortcuts ()![]() |
virtual bool | event (QEvent *event)![]() |
bb::cascades::Image | image () const ![]() |
QUrl | imageSource () const ![]() |
bool | isDefaultAction () const ![]() |
bool | isEnabled () const ![]() |
Q_INVOKABLE void | removeAllShortcuts ()![]() |
Q_INVOKABLE bool | removeShortcut (bb::cascades::AbstractShortcut *shortcut)![]() |
Q_SLOT void | resetBackgroundColor ()![]() |
Q_INVOKABLE void | resetBuiltInShortcutsEnabled ()![]() |
Q_SLOT void | resetDefaultAction ()![]() |
Q_SLOT void | resetEnabled ()![]() |
Q_SLOT void | resetImage ()![]() |
Q_SLOT void | resetImageSource ()![]() |
Q_SLOT void | resetTitle ()![]() |
Q_SLOT void | setBackgroundColor (const ColorPaint &backgroundColor)![]() |
Q_INVOKABLE void | setBuiltInShortcutEnabled (bb::cascades::SystemShortcuts::Type type, bool enabled)![]() |
Q_SLOT void | setBuiltInShortcutsEnabled (bool enabled)![]() |
Q_SLOT void | setDefaultAction (bool defaultAction)![]() |
Q_SLOT void | setEnabled (bool enabled)![]() |
Q_SLOT void | setImage (const bb::cascades::Image &image)![]() |
Q_SLOT void | setImageSource (const QUrl &source)![]() |
void | setObjectName (const QString &name)![]() |
Q_SLOT void | setTitle (const QString &title)![]() |
Q_INVOKABLE bb::cascades::AbstractShortcut * | shortcutAt (int index) const ![]() |
Q_INVOKABLE int | shortcutCount () const ![]() |
const QString | title () const ![]() |
virtual Q_INVOKABLE QString | toDebugString () const ![]() |
Q_INVOKABLE bb::cascades::UIConfig * | ui () 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
Only has inherited signals
void | backgroundColorChanged (const ColorPaint &backgroundColor)![]() |
void | builtInShortcutsEnabledChanged (bool builtInShortcutsEnabled)![]() |
void | creationCompleted ()![]() |
void | defaultActionChanged (bool defaultAction)![]() |
void | enabledChanged (bool enabled)![]() |
void | imageChanged (const bb::cascades::Image &image)![]() |
void | imageSourceChanged (const QUrl &imageSource)![]() |
void | objectNameChanged (const QString &objectName)![]() |
void | titleChanged (const QString &title)![]() |
void | triggered ()![]() |
Properties
(Only has inherited properties)
bb::cascades::AbstractA11yObject
Defines this action's accessibility object.
BlackBerry 10.2.0
QDeclarativeListProperty< QObject >
A hierarchical list of the UIObject's attached objects.
BlackBerry 10.0.0
QVariant
A background color to display on an action item.
Right now it's only a signature action that utilizes it but may well be used by other action items.
The default value is the system primary color as a QVariant.
BlackBerry 10.3.0
QDeclarativeListProperty
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. Predefined shortcuts take precedence over shortcuts defined via QString in case of a collision.
BlackBerry 10.1.0
bool
Enables or disables all ActionItem's built-in shortcuts.
This property is used when all ActionItem's built-in shortcuts should be enabled or disabled. built-in shortcuts are ActionItem's built-in shortcuts like 'backspace' shortcut in DeleteActionItem
BlackBerry 10.2.0
bool
Specifies if this action item is the default action.
The default action will get focus when opening a menu where the action item is presented. Note that the action will not get focus if the menu is already open. Specifying signature action placement for an action will change this property to true. If there is more than one default action when opening a menu the menu will give one of these actions focus.
BlackBerry 10.3.1
bool
Indicates whether the action is enabled.
When an action is disabled, it will be dimmed and it will not be possible for the user to press on it and it will not emit the triggered signal.
BlackBerry 10.0.0
QVariant
The image set on the action.
The default value is an empty image, indicating no image is set.
BlackBerry 10.0.0
QUrl
The image set on the action.
If no image is set, an invalid QUrl will be returned. When changing the image source the imageSourceChanged() signal will be emitted.
BlackBerry 10.0.0
QString
This property is overridden from QObject.
QObject::objectName().
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
QString
A string that will be displayed with the action.
The default value is QString::Null, indicating that no text is set.
BlackBerry 10.0.0
bb::cascades::UIConfig
An object that gives access to unit conversion routines.
// Size using design units Container { preferredWidth: ui.du(12) preferredHeight: ui.du(5) } // Size using design units, snap to whole pixels Container { preferredWidth: ui.sdu(13.5) preferredHeight: ui.sdu(7.5) } // Size using absolute pixel values Container { preferredWidth: ui.px(150) preferredHeight: ui.px(50) }C++ use:
Container *container1 = Container::create().background(Color::Red); UIConfig *ui = container1->ui(); container1->setPreferredWidth(ui->du(12)); container1->setPreferredHeight(ui->du(5)); Container *container2 = Container::create().background(Color::Green); container2->setPreferredWidth(ui->sdu(13.5)); container2->setPreferredHeight(ui->sdu(7.5)); Container *container3 = Container::create().background(Color::Blue); container3->setPreferredWidth(ui->px(150)); container3->setPreferredHeight(ui->sdu(50));
Blackberry 10.3.0
Public Functions
virtual
Destructor.
BlackBerry 10.0.0
bb::cascades::AbstractA11yObject * 
Returns the accessibility object.
The accessibility object.
BlackBerry 10.2.0
Q_INVOKABLE void 
Adds a shortcut to the AbstractActionItem.
AbstractActionItem will always take ownership, as shortcuts should never be shared. If the shortcut already belongs to the AbstractActionItem 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 AbstractActionItem. |
BlackBerry 10.1.0
QVariant 
Returns the backgroundColor used on this action item.
The returned QVariant contain values of type Color or ColorPaint.
Use QVariant::canConvert<Type T>() to find the type, and then use QVariant::value<Type T>() to get the value.
The background Color or ColorPaint used on the action item.
BlackBerry 10.3.0
Q_INVOKABLE bool 
Returns a builtInShortcutsEnabled property value.
true if builtInShortcutsEnabled property is set to true and false otherwise.
BlackBerry 10.2.0
Q_INVOKABLE void 
Disables all shortcuts attached to the AbstractActionItem.
Shortcuts that are attached afterward will use the default enabled state.
BlackBerry 10.1.0
Q_INVOKABLE void 
Enables all shortcuts attached to the AbstractActionItem.
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::Image 
Returns the image to display on the action item.
The image for the item or an empty image.
BlackBerry 10.0.0
bool 
Returns true if the action item is the default action.
true if the action item is the default action, false otherwise.
BlackBerry 10.3.1
bool 
Returns the enabled state of the action.
true if the control is enabled, false otherwise.
BlackBerry 10.0.0
Q_INVOKABLE void 
Removes all of a AbstractActionItem's shortcuts and frees up their memory.
BlackBerry 10.1.0
Q_INVOKABLE bool 
Removes a shortcut from the AbstractActionItem.
Once the shortcut is removed, the AbstractActionItem no longer references it, but it is still owned by the AbstractActionItem. 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 AbstractActionItem (in which case it will be deleted with the AbstractActionItem).
Parameters | |
---|---|
shortcut |
The AbstractShortcut to remove. |
true if the shortcut was owned by the AbstractActionItem, false otherwise.
BlackBerry 10.1.0
Q_SLOT void 
Resets the background color for this action item to the system primary color.
BlackBerry 10.3.0
Q_INVOKABLE void 
Resets a builtInShortcutsEnabled property to default value.
Default value is true.
BlackBerry 10.2.0
Q_SLOT void 
Resets the action item to not being the default action.
BlackBerry 10.3.1
Q_SLOT void 
Resets the enabled state of the action to true.
After the operation is completed and the enabled state is changed, the enabledChanged() signal is emitted.
BlackBerry 10.0.0
Q_SLOT void 
Resets the image, meaning no image is set for the action.
After the operation is completed and the image is changed, the imageChanged() signal is emitted.
BlackBerry 10.0.0
Q_SLOT void 
Resets the Image on the action to its default, meaning that no image is set.
This function emits an imageSourceChanged() signal if the currently set image source changes.
BlackBerry 10.0.0
Q_SLOT void 
Resets the title on the action to QString::Null.
After the operation is completed, and the title is changed, the titleChanged() signal is emitted.
BlackBerry 10.0.0
Q_SLOT void 
Sets the background color used on this action item.
Parameters | |
---|---|
backgroundColor |
The background Color or ColorPaint used on the action item. |
BlackBerry 10.3.0
Q_INVOKABLE void 
Sets the enabled state of the built-in shortcut attached to the AbstractActionItem at a system level.
Built-in SystemShortcuts that are attached afterward will use the same enabled state.
Selected built-in shortcut can be enabled or disbaled only if AbstractActionItem::builtInShortcutsEnabled property is set to true.
Parameters | |
---|---|
type |
The system shortcut type |
enabled |
If true the shortcut is enabled, and if false the shortcut is disabled. |
BlackBerry 10.2.0
Q_SLOT void 
Sets the enabled state of all built-in shortcut attached to the AbstractActionItem at a system level.
Built-in shortcuts that are attached afterward will use the specified enabled state.
Parameters | |
---|---|
enabled |
If true all shortcuts are enabled, and if false all shortcut are disabled. |
BlackBerry 10.2.0
Q_SLOT void 
Specifies if this action item is the default action.
The default action will get focus when opening a menu where the action item is presented. Note that the action will not get focus if the menu is already open. Specifying signature action placement for an action will change this property to true. If there is more than one default action when opening a menu the menu will give one of these actions focus.
Parameters | |
---|---|
defaultAction |
If true the action item is the default action and if false the action item is not the default action. |
BlackBerry 10.3.1
Q_SLOT void 
Sets the enabled state of the action.
After the operation is completed and the enabled state is changed, the enabledChanged() signal is emitted.
Parameters | |
---|---|
enabled |
If true the action is enabled and if false the action is disabled. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the image to display on the action item.
After the operation is completed and the image is changed, the imageChanged() signal is emitted.
Parameters | |
---|---|
image |
The image to display. |
BlackBerry 10.0.0
Q_SLOT void 
Sets the Image for the action.
An invalid QUrl indicates no image. This function emits an imageSourceChanged() signal if the currently set image source changes.
Parameters | |
---|---|
source |
The image URL. |
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 title on the action.
After the operation is completed, and the title changed, the titleChanged() signal is emitted.
Parameters | |
---|---|
title |
The title of the action. |
BlackBerry 10.0.0
Q_INVOKABLE bb::cascades::AbstractShortcut * 
Returns a shortcut at the specified index.
Ownership of the shortcut remains with the AbstractActionItem.
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
const QString 
Gets the title of the action.
The title of the action.
BlackBerry 10.0.0
virtual Q_INVOKABLE QString 
Returns a debug string representing this object.
A debug string for the object.
BlackBerry 10.0.0
Q_INVOKABLE bb::cascades::UIConfig * 
Returns the UIConfig for this ui object.
The UIConfig can be used to perform unit conversions from design units (du) and snapped design units (sdu) to pixels.
Ownership remains with Cascades.
Container *container1 = Container::create().background(Color::Red); UIConfig *ui = container1->ui(); container1->setPreferredWidth(ui->du(12)); container1->setPreferredHeight(ui->du(5)); Container *container2 = Container::create().background(Color::Green); container2->setPreferredWidth(ui->sdu(13.5)); container2->setPreferredHeight(ui->sdu(7.5)); Container *container3 = Container::create().background(Color::Blue); container3->setPreferredWidth(ui->px(150)); container3->setPreferredHeight(ui->sdu(50));
The UIConfig for this ui object.
BlackBerry 10.3.0
Static Public Functions
Builder
Creates and returns a builder for constructing an DeleteActionItem.
DeleteActionItem* actionItem = DeleteActionItem::create();
A builder used for constructing a DeleteActionItem.
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
(Only has inherited signals)
void 
Emitted when the background color for this action changes.
Parameters | |
---|---|
backgroundColor |
The new background color for this action |
BlackBerry 10.3.0
void 
Emitted when the builtInShortcutsEnabled property changes.
Parameters | |
---|---|
builtInShortcutsEnabled |
The new value. |
BlackBerry 10.2.0
void 
Emitted when this object is instantiated as a result of loading a QML document and creating the root node (only after the root component that caused this instantiation has completed construction), or when the object is being constructed from its builder class.
This signal indicates that the construction and initialization of the object has been completed, the properties are initialized, and any QML binding values have been assigned to the object.
This signal is not emitted when the object is constructed from C++ using the constructor. If the object is constructed using its builder class, the signal is emitted when the the builder class returns the fully constructed object.
This signal can be used when there is an activity that needs to be performed, such as a property state integrity verification after the object is instantiated from a QML document or a builder, but before control is returned to the application.
BlackBerry 10.0.0
void 
Emitted when the defaultAction property on the action item changes.
Parameters | |
---|---|
defaultAction |
If true the action item is the default action, if false the action item is not the default action. |
BlackBerry 10.3.1
void 
Emitted when the enabled property on the action changes.
Parameters | |
---|---|
enabled |
If true the action is enabled, if false the action is disabled. |
BlackBerry 10.0.0
void 
Emitted when the image for the action changes.
Parameters | |
---|---|
image |
The new image or an empty image if changed to no image. |
BlackBerry 10.0.0
void 
Emitted when the image source changes.
Parameters | |
---|---|
imageSource |
The new image source or an invalid QUrl if no source is set. |
BlackBerry 10.0.0
void 
This signal is emitted when the objectName property is changed.
BlackBerry 10.0.0
void 
Emitted when the title has changed.
Parameters | |
---|---|
title |
The new title. |
BlackBerry 10.0.0