ActionData QML Type

Declarative representation for a named action within the application with user-configurable shortcuts. More...

Import Statement: import org.kde.kirigami.actioncollection

Properties

Detailed Description

This element needs to always be declared as a child of ActionCollection

 import org.kde.kirigami.actioncollection as AC
 ...
 AC.ActionCollection {
     name: "EditActions"
     AC.ActionData {
        name: "exampleAction"
        icon.name: "edit-copy"
        text: "Copy"
     }
     ...
 }
 ...
 Kirigami.Action {
   id: copyAction
   AC.ActionCollection.collection: "EditActions"
   AC.ActionCollection.action: "exampleAction"
   onTriggered: {
       ...
   }
 }

Property Documentation

action : QtQuick.Controls::Action

This property holds the QML Action this ActionData is associated to, if any. Since ActionData is just a description of an action, in order to be an active working action it has to be associated with a QML Action instance, preferable a kirigami.Action specialization.

It can be associated either here by binding this property to the id of an Action instance or from the Action instance using the ActionGroup attached property.

Direct example:

 ...
 ActionCollection {
     ...
     ActionData {
        name: "exampleAction"
        icon.name: "edit-copy"
        text: "Copy"
        action: copyAction
     }
     ...
 }
 ...
 Kirigami.Action {
   id: copyAction
   onTriggered: {
       ...
   }
 }

Attached property example:

 ...
 ActionCollection {
     name: "EditActions"
     ActionData {
        name: "exampleAction"
        icon.name: "edit-copy"
        text: "Copy"
     }
     ...
 }
 ...
 Kirigami.Action {
   id: copyAction
   ActionCollection.collection: "EditActions"
   ActionCollection.action: "exampleAction"
   onTriggered: {
       ...
   }
 }

actionGroup : ActionDataGroup

data : variant

Any extra data payload that can be put on the action

defaultAlternateShortcut : keysequence

This property holds the action's default alternate secondary shortcut. The key sequence can be set to one of the standard keyboard shortcuts, or it can be described with a string containing a sequence of up to four key presses that are needed to trigger the shortcut. This will be the shortcut of the action in the app, unless the user explicitly configured to use another one.

 ActionData {
     defaultAlternateShortcut: "Ctrl+E,Ctrl+W"
 }

defaultShortcut : keysequence

This property holds the action's default shortcut. The key sequence can be set to one of the standard keyboard shortcuts, or it can be described with a string containing a sequence of up to four key presses that are needed to trigger the shortcut. This will be the shortcut of the action in the app, unless the user explicitly confugured to use another one.

 ActionData {
     defaultShortcut: "Ctrl+E,Ctrl+W"
 }

icon group

icon.cache : bool

icon.color : color

icon.height : real

icon.name : string

icon.source : string

icon.width : real

Description for the icon to use, which can be specified by name or path

NameDescription
nameThis property holds icon name.

The icon will be loaded from the platform theme. If the icon is found in the theme, it will always be used; even if icon.source is also set. If the icon is not found, icon.source will be used instead.

sourceThis property holds the icon source.

The icon will be loaded as a regular image.

widthThis property holds the width of the icon.
heightThis property holds the height of the icon.
colorThis property holds the icon tint color.

The icon is tinted with the specified color, unless the color is set to "transparent".

name : string

The unique name of the action within its collection. It is required and should be set only once FIXME: this should be REQUIRED but not in StandardActionData