Search for usage in LXR

org::kde::kirigami::CheckableListItem Class Reference
Inheritance diagram for org::kde::kirigami::CheckableListItem:

Additional Inherited Members

- Properties inherited from org::kde::kirigami::BasicListItem
alias _basicDefault
bool bold
bool fadeContent
var icon
alias iconColor
alias iconSelected
alias iconSize
alias label
alias labelItem
Item leading
bool leadingFillVertically
real leadingPadding
alias reserveSpaceForIcon
alias reserveSpaceForLabel
bool reserveSpaceForSubtitle
alias subtitle
alias subtitleItem
alias textSpacing
bool toolTipVisible
Item trailing
bool trailingFillVertically
real trailingPadding
- Properties inherited from org::kde::kirigami::templates::AbstractListItem
alias _default
QQC2 Action
color activeBackgroundColor
color activeTextColor
color alternateBackgroundColor
bool alternatingBackground
color backgroundColor
alias containsMouse
bool sectionDelegate
bool separatorVisible
bool supportsMouseEvents
color textColor

Detailed Description

A simple subclass of BasicListItem that adds a checkbox on the left side of the layout.

The list item's own checked property controls the check state of the checkbox.

When the list item or its checkbox is clicked, the QtQuick.Controls.Action specified in the list item's actions: property will be triggered.

Due to the way BasicListItem works, the QtQuick.Controls.Action MUST contain the line "checked = !checked" as the first line within its QtQuick.Controls.Action.onTriggered handler.

Example usage:

import org.kde.kirigami 2.14 as Kirigami
ListView {
id: listView
model: [...]
delegate: Kirigami.CheckableListItem {
label: model.display
checked: model.checked
action: Action {
onTriggered: {
checked = !checked
[ do something amazing ]
See also
KDE Human Interface Guidelines on List Views and List Items
KDE Human Interface Guidelines on Checkboxes
org.kde.kirigami 2.14

Definition at line 48 of file CheckableListItem.qml.

The documentation for this class was generated from the following file:
alias label
This property holds the text of this list item's label.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Dec 5 2023 04:08:21 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.