-
-
Save CODeRUS/a7f83da1622c62a432ff7017ec132a0e to your computer and use it in GitHub Desktop.
multi selection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
import Sailfish.Silica 1.0 | |
Dialog { | |
id: dialog | |
property var itemsModel | |
property bool multiple | |
SilicaListView { | |
id: view | |
anchors.fill: parent | |
header: DialogHeader { | |
title: dialog.multiple ? qsTr("Select items") : qsTr("Select item") | |
acceptText: qsTr("Ok") | |
} | |
model: itemsModel | |
delegate: Component { | |
ValueButton { | |
value: text | |
highlighted: down || selected | |
onClicked: { | |
itemsModel.select(index) | |
if (!dialog.multiple) { | |
accept(index) | |
} | |
} | |
} | |
} | |
section.property: "group" | |
section.delegate: Component { | |
SectionHeader { | |
text: section | |
} | |
} | |
VerticalScrollDecorator {} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment