TitleSubtitleWithActions QML Type

A simple title delegate that has trailing actions. More...

Import Statement: import org.kde.kirigami.delegates
Since: 6.22
Inherits:

Item

Properties

Detailed Description

This is meant to be used in lists for items that have actions but don't need an icon. If you need an icon, use IconTitleSubtitleWithActions instead.

Example usage as contentItem of an ItemDelegate:

ItemDelegate {
    id: itemDelegate

    text: i18nc("@title:row", "Banana")
    readonly property string subtitle: i18nc("@label", "Known for deliciousness")
    Accessible.description: subtitle

    Kirigami.Theme.useAlternateBackgroundColor: true

    onClicked: [...]

    contentItem: Kirigami.TitleSubtitleWithActions {
        title: itemDelegate.title
        subtitle: itemDelegate.subtitle

        elide: Text.ElideRight
        selected: itemDelegate.pressed || itemDelegate.highlighted

        actions: [
            Kirigami.Action {
                icon.name: "face-smile"
                text: i18nc("@action:button", "Eat Banana…")

                onTriggered: [...]
            },
            Kirigami.Action {
                icon.name: "edit-delete-remove-symbolic"
                text: i18nc("@action:button", "Remove Banana…")
                tooltip: text

                displayHint: Kirigami.DisplayHint.IconOnly

                onTriggered: [...]
            }
        ]
    }
}

See also IconTitleSubtitle, TitleSubtitle, and ActionToolBar.

Property Documentation

actions : list<Action>

This property holds a list of visible actions.

These actions will be given to ActionToolBar. To make an action be icons-only, set displayHint: Kirigami.DisplayHint.IconOnly on it.

Empty by default, so no actions will be present.

See also ActionToolBar.

displayHint : enumeration

This property determines how the icon and text are displayed within the button.

Permitted values are:

  • Button.IconOnly
  • Button.TextOnly
  • Button.TextBesideIcon
  • Button.TextUnderIcon

default: Button.TextBesideIcon

See also ActionToolBar and AbstractButton.

elide : enumeration

The text elision mode used for both the title and subtitle.

default: Text.ElideRight

selected : bool

Should this item be displayed in a selected style?

default: false

subtitle : string

The subtitle to display.

default: Empty string, so no subtitle is shown

textFormat : enumeration [since 6.31]

The way the text property for the title and subtitle should be displayed.

This property was introduced in 6.31.

title : string [required]

The title to display.