Warning, /system/mycroft-gui/documentation/skill-example/ui/listViewExample.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.4
0002 import QtQuick.Controls 2.2
0003 import QtQuick.Layouts 1.4
0004 import org.kde.kirigami 2.4 as Kirigami
0005 import Mycroft 1.0 as Mycroft
0006 
0007 Mycroft.ScrollableDelegate{
0008     id: root
0009     skillBackgroundSource: sessionData.background
0010     property var sampleModel: sessionData.sampleBlob
0011 
0012     Kirigami.CardsListView {
0013         id: exampleListView
0014         Layout.fillWidth: true
0015         Layout.fillHeight: true
0016         model: sampleModel.lorem
0017         delegate: Kirigami.AbstractCard {
0018             id: rootCard
0019             implicitHeight: delegateItem.implicitHeight + Kirigami.Units.largeSpacing
0020             contentItem: Item {
0021                 implicitWidth: parent.implicitWidth
0022                 implicitHeight: parent.implicitHeight
0023                 ColumnLayout {
0024                     id: delegateItem
0025                     anchors.left: parent.left
0026                     anchors.right: parent.right
0027                     anchors.top: parent.top
0028                     spacing: Kirigami.Units.largeSpacing
0029                     Kirigami.Heading {
0030                         id: restaurantNameLabel
0031                         Layout.fillWidth: true
0032                         text: modelData.text
0033                         level: 2
0034                         wrapMode: Text.WordWrap
0035                     }
0036                     Kirigami.Separator {
0037                         Layout.fillWidth: true
0038                     }
0039                     Image {
0040                         id: placeImage
0041                         source: modelData.image
0042                         Layout.fillWidth: true
0043                         Layout.preferredHeight: Kirigami.Units.gridUnit * 3
0044                         fillMode: Image.PreserveAspectCrop
0045                     }
0046                     Item {
0047                         Layout.fillWidth: true
0048                         Layout.preferredHeight: Kirigami.Units.gridUnit * 1
0049                     }
0050                 }
0051             }
0052         }
0053     }
0054 }