Warning, /plasma/libplasma/tests/extras/expandablelistitem.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick
0002 import QtQuick.Layouts
0003 
0004 import QtQml.Models
0005 import org.kde.plasma.extras as PlasmaExtras
0006 import org.kde.plasma.components as PlasmaComponents
0007 import org.kde.kirigami as Kirigami
0008 
0009 Rectangle {
0010     height: 800
0011     width: 500
0012     color: Kirigami.Theme.backgroundColor
0013     PlasmaComponents.ScrollView {
0014         anchors.fill: parent
0015         ListView {
0016             anchors.fill: parent
0017             focus: true
0018             currentIndex: -1
0019             clip: true
0020             model: myModel
0021             highlight: PlasmaExtras.Highlight {}
0022             highlightMoveDuration: Kirigami.Units.longDuration
0023             highlightResizeDuration: Kirigami.Units.longDuration
0024             delegate: PlasmaExtras.ExpandableListItem {
0025                 title: model.title
0026                 subtitle: model.subtitle
0027                 icon: model.icon
0028                 isBusy: model.busy
0029                 subtitleCanWrap: model.subtitleCanWrap || false
0030 
0031                 customExpandedViewContent: Component {
0032                     ColumnLayout {
0033                         PlasmaComponents.Label {
0034                             text: "I am some expanded text"
0035                         }
0036                         PlasmaComponents.Button {
0037                             text: "with an expanded button"
0038                         }
0039                     }
0040                 }
0041             }
0042         }
0043     }
0044 
0045     ListModel {
0046         id: myModel
0047         ListElement {
0048             title: "Item 1"
0049             subtitle: "Default with icon"
0050             icon: "system-file-manager"
0051             isDefault: true
0052         }
0053         ListElement {
0054             title: "Item 2"
0055             subtitle: "A really long subtitle that probably won't fit in this constrained example because of how long it is."
0056             isDefault: false
0057         }
0058         ListElement {
0059             title: "Item 4"
0060             subtitle: "Busy"
0061             isDefault: false
0062             busy: true
0063         }
0064 
0065     }
0066 }