Changeset View
Changeset View
Standalone View
Standalone View
src/controls/Action.qml
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Line(s) | 27 | QtObject { | |||
---|---|---|---|---|---|
111 | * } | 111 | * } | ||
112 | * @endcode | 112 | * @endcode | ||
113 | */ | 113 | */ | ||
114 | default property alias children: root.__children | 114 | default property alias children: root.__children | ||
115 | property list<QtObject> __children | 115 | property list<QtObject> __children | ||
116 | property Shortcut __shortcut: Shortcut { | 116 | property Shortcut __shortcut: Shortcut { | ||
117 | property bool checked: false | 117 | property bool checked: false | ||
118 | id: shortcutItem | 118 | id: shortcutItem | ||
119 | enabled: root.enabled | ||||
119 | onActivated: root.trigger(); | 120 | onActivated: root.trigger(); | ||
120 | } | 121 | } | ||
121 | function trigger(source) { | 122 | function trigger(source) { | ||
122 | if (!enabled) { | 123 | if (!enabled) { | ||
123 | return; | 124 | return; | ||
124 | } | 125 | } | ||
125 | root.triggered(source); | 126 | root.triggered(source); | ||
126 | if (root.checkable) { | 127 | if (root.checkable) { | ||
127 | root.checked = !root.checked; | 128 | root.checked = !root.checked; | ||
128 | root.toggled(root.checked); | 129 | root.toggled(root.checked); | ||
129 | } | 130 | } | ||
130 | } | 131 | } | ||
131 | 132 | | |||
132 | onCheckedChanged: root.toggled(root.checked); | 133 | onCheckedChanged: root.toggled(root.checked); | ||
133 | } | 134 | } |