IconTitleSubtitleWithActions QML Type

A delegate that can show an icon, title, subtitle, and trailing action buttons. More...

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

Item

Properties

Signals

Detailed Description

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

Example usage as contentItem of an ItemDelegate:

ItemDelegate {
    id: itemDelegate

    icon.name: "user"
    text: i18nc("@title:row", "Konqi")
    readonly property string subtitle: i18nc("@label", "The Konqueror")
    Accessible.description: subtitle

    Kirigami.Theme.useAlternateBackgroundColor: true

    onClicked: [...]

    contentItem: Kirigami.IconTitleSubtitleWithActions {
        icon.name: itemDelegate.icon
        title: itemDelegate.title
        subtitle: itemDelegate.subtitle

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

        actions: [
            Kirigami.Action {
                icon.name: "edit-entry-symbolic"
                text: i18nc("@action:button", "Modify user…")

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

                displayHint: Kirigami.DisplayHint.IconOnly

                onTriggered: [...]
            }
        ]
    }
}

See also TitleSubtitleWithActions, 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.

color : color

The color to use for the title.

By default this is `Kirigami.Theme.textColor` unless `selected` is true in which case this is `Kirigami.Theme.highlightedTextColor`.

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 : int

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

font : font

The font used to display the title.

icon group

icon.color : color

icon.fromControlsIcon : function

icon.height : real

icon.name : string

icon.source : var

icon.width : real

Grouped property for icon properties.

Note: By default, IconTitleSubtitle will reserve the space for the icon, even if it is not set. To remove that space, set `icon.width` to 0.

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".

fromControlsIconBind this icon to all matching properties of a Controls icon group.

This function automatically binds all properties to matching properties of a controls icon group, since we cannot just reuse the Controls icon group.

To use it, you can assign the result to an IconPropertiesGroup, like so:

icon: icon.fromControlsIcon(control.icon).

reserveSpaceForSubtitle : bool

Make the implicit height use the subtitle's height even if no subtitle is set.

selected : bool

Should this item be displayed in a selected style?

subtitle : string

The subtitle to display.

subtitleColor : color

The color to use for the subtitle.

By default this is color mixed with the background color.

subtitleFont : font

The font used to display the subtitle.

textFormat : alias

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

title : string [required]

The title to display.

truncated : bool

Is the title or subtitle truncated?

wrapMode : int

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

Signal Documentation

linkActivated(string link)

Emitted when the user clicks on a link embedded in the text of the title or subtitle.

Note: The corresponding handler is onLinkActivated.

linkHovered(string link)

Emitted when the user hovers on a link embedded in the text of the title or subtitle.

Note: The corresponding handler is onLinkHovered.