plasma-framework/tests/components/combobox3.qml

34 lines
960 B
QML
Raw Normal View History

2020-08-20 00:14:19 +02:00
/*
* SPDX-FileCopyrightText: 2019 David Edmundson <kde@davidedmundson.co.uk>
* SPDX-FileCopyrightText: 2020 Noah Davis <noahadvs@gmail.com>
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
2019-12-12 16:29:33 +01:00
import QtQuick 2.0
import QtQuick.Layouts 1.12
import org.kde.plasma.core 2.0 as PlasmaCore
2019-12-12 16:29:33 +01:00
import org.kde.plasma.components 3.0
ComponentBase {
id: root
title: "Plasma Components 3 ComboBox"
contentItem: ColumnLayout {
spacing: PlasmaCore.Units.largeSpacing
2019-12-12 16:29:33 +01:00
ListModel {
id: demoModel
ListElement { text: "Banana"; color: "Yellow" }
ListElement { text: "Apple"; color: "Green" }
ListElement { text: "Coconut"; color: "Brown" }
}
ComboBox {
model:demoModel
textRole: "text"
}
ComboBox {
editable: true
model: demoModel
textRole: "text"
}
}
}