Qt Components Hildon  0.20
QML components for Maemo5 with Hildon styling.
 All Classes Functions Properties Groups Pages
Public Slots | Signals | Properties | List of all members
Action Class Reference

Defines a common action that can be shared amongst interactive items. More...

Public Slots

void toggle ()
 Toggle the checked property, if the action is checkable.
void trigger ()
 Triggers the action.

Signals

void triggered ()
 Emitted when the trigger() slot is called.

Properties

bool autoRepeat
 Whether the keyboard shortcut accepts auto-repeated events.
bool checkable
 Whether the menu item is checkable.
bool checked
 Whether the menu item is checked.
bool enabled
 Whether the action is enabled.
ExclusiveGroup exclusiveGroup
 The ExclusiveGroup to which the action belongs.
string iconName
 The name of the icon to be used.
string iconSource
 The source of the icon to be used.
variant shortcut
 The keyboard shorcut used to trigger the action.
string text
 The text to be displayed.
bool visible
 Whether the items using the action should be visible.

Detailed Description

Defines a common action that can be shared amongst interactive items.

import QtQuick 1.0
import org.hildon.components 1.0
Window {
id: window
title: qsTr("Actions Example")
visible: true
menuBar: MenuBar {
action: action1
}
action: action2
}
}
id: group
}
id: action1
autoRepeat: false
checkable: true
shortcut: Qt.Key_A
text: qsTr("Action One")
onTriggered: console.log(qsTr("Action One triggered"))
}
id: action2
autoRepeat: false
checkable: true
shortcut: Qt.Key_B
text: qsTr("Action Two")
onTriggered: console.log(qsTr("Action Two triggered"))
}
MouseArea {
anchors.fill: parent
onClicked: menu.popup()
}
Column {
anchors.centerIn: parent
action: action1
}
action: action2
}
}
Menu {
id: menu
action: action1
}
action: action2
}
}
}
See Also
AbstractButton, MenuItem
Examples:
actions.qml.

Member Function Documentation

void Action::toggle ( )
slot

Toggle the checked property, if the action is checkable.

See Also
checkable, checked
void Action::trigger ( )
slot

Triggers the action.

See Also
triggered()
void Action::triggered ( )
signal

Emitted when the trigger() slot is called.

See Also
trigger()

Property Documentation

bool Action::autoRepeat
readwrite

Whether the keyboard shortcut accepts auto-repeated events.

The default value is true.

bool Action::checkable
readwrite

Whether the menu item is checkable.

The default value is false.

bool Action::checked
readwrite

Whether the menu item is checked.

The default value is false.

bool Action::enabled
readwrite

Whether the action is enabled.

The default value is true.

ExclusiveGroup * Action::exclusiveGroup
readwrite

The ExclusiveGroup to which the action belongs.

The default value is null.

See Also
ExclusiveGroup
string Action::iconName
readwrite

The name of the icon to be used.

See Also
iconSource
string Action::iconSource
readwrite

The source of the icon to be used.

See Also
iconName
bool Action::visible
readwrite

Whether the items using the action should be visible.

The default value is true.