diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index d6abc54..e53be37 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -17,6 +17,7 @@ qt_add_qml_module(alisa VERSION 1.0 QML_FILES Main.qml + Data.qml RESOURCES Assets/Icons/turbo.svg diff --git a/native/Data.qml b/native/Data.qml new file mode 100644 index 0000000..f98527d --- /dev/null +++ b/native/Data.qml @@ -0,0 +1,16 @@ +import QtQuick + +ListModel { + ListElement { + name: "Bill Smith" + number: "555 3264" + } + ListElement { + name: "John Brown" + number: "555 8426" + } + ListElement { + name: "Sam Wise" + number: "555 0473" + } +} diff --git a/native/Main.qml b/native/Main.qml index b4741a3..8d709b7 100644 --- a/native/Main.qml +++ b/native/Main.qml @@ -26,9 +26,28 @@ Window { left: parent.left right: parent.right } - height: 50 + height: 400 border.width: 5 border.color: getColors().accent color: getColors().midlight + + Component { + id: contactDelegate + Item { + width: 180; height: 40 + Column { + Text { text: 'Name: ' + name } + Text { text: 'Number: ' + number } + } + } + } + + ListView { + anchors.fill: parent + model: Data {} + delegate: contactDelegate + highlight: Rectangle { color: getColors().highlight; radius: 5 } + focus: true + } } }