SwipeListItem QML Type

Import Statement: import org.kde.kirigami
Inherits:

SwipeDelegate

Properties

Detailed Description

An item delegate intended to support extra actions obtainable by uncovering them by dragging away the item with the handle.

This acts as a container for normal list items.

Example usage:

ListView {
    model: myModel
    delegate: SwipeListItem {
        QQC2.Label {
            text: model.text
        }
        actions: [
             Action {
                 icon.name: "document-decrypt"
                 onTriggered: print("Action 1 clicked")
             },
             Action {
                 icon.name: model.action2Icon
                 onTriggered: //do something
             }
        ]
    }

}

Property Documentation

actions : list<T.Action>

This property holds actions of the list item.

At most 4 actions can be revealed when sliding away the list item; others will be shown in the overflow menu.


actionsVisible : bool [read-only]

This property tells whether actions are visible and interactive.

True if it's possible to see and interact with the item's actions.

Actions become hidden while editing of an item, for example.


activeBackgroundColor : color [default: Kirigami.Theme.highlightColor]

This property holds the color of the background when the item is pressed or selected.

It is advised to use the default value.


activeTextColor : color

This property holds the color of the text when the item is pressed or selected.

It is advised to use the default value. default: Kirigami.Theme.highlightedTextColor

If custom text elements are inserted in a SwipeListItem, their color property will have to be manually bound with this property


alternateBackgroundColor : color [default: : Kirigami.Theme.alternateBackgroundColor]

This property holds the background color to be used when background alternating is enabled.

It is advised to use the default value.


alternatingBackground : bool [default: false]

This property sets whether instances of this list item will alternate between two colors, helping readability.

It is suggested to use this only when implementing a view with multiple columns.


alwaysVisibleActions : bool

This property sets whether actions behind this SwipeListItem will always be visible.

default: true in desktop and tablet mode


backgroundColor : color [default: Kirigami.Theme.backgroundColor]

This property holds the background color of the list item.

It is advised to use the default value.


overlayWidth : real [read-only]

This property holds the width of the overlay.

The value can represent the width of the handle component or the action layout.


sectionDelegate : bool [default: false]

This property sets whether this item is a section delegate.

Setting this to true will make the list item look like a "title" for items under it.

See also ListSectionHeader.


separatorVisible : bool [default: false]

This property sets whether the separator is visible.

The separator is a line between this and the item under it.


textColor : color [default: Theme.textColor]

This property holds the color of the text in the item.

It is advised to use the default value.

If custom text elements are inserted in a SwipeListItem, their color will have to be manually set with this property.