diff --git a/native/LoginScreen.qml b/native/LoginScreen.qml index e573736..2bb5e59 100644 --- a/native/LoginScreen.qml +++ b/native/LoginScreen.qml @@ -99,4 +99,18 @@ Rectangle { }); xhr.send(data); } + Button { + id: loginScreenB + anchors { + bottom: parent.bottom + left: parent.left + } + + text: qsTr("Test") + onClicked: { + var component = Qt.createComponent("Test.qml") + var window = component.createObject(root) + window.show() + } + } } diff --git a/native/MainPage.qml b/native/MainPage.qml index 797ce35..ac1e8a5 100644 --- a/native/MainPage.qml +++ b/native/MainPage.qml @@ -60,7 +60,6 @@ Rectangle { right: parent.right bottom: parent.bottom } - radius: 0 color: getColors().window TableView { @@ -95,18 +94,4 @@ Rectangle { } } } - - Button { - id: loginScreenB - anchors { - bottom: parent.bottom - left: parent.left - - - } - text: qsTr("Login Screen") - onClicked: { - logout(); - } - } } diff --git a/native/Test.qml b/native/Test.qml index 6d3c162..ef35281 100644 --- a/native/Test.qml +++ b/native/Test.qml @@ -1,18 +1,63 @@ import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick.Window 2.12 +import Qt.labs.qmlmodels 1.0 -ApplicationWindow { +Window { + width: 400 + height: 400 visible: true - Universal.theme: Universal.Dark - Universal.accent: Universal.Violet + TableView { + anchors.fill: parent + columnSpacing: 0 + rowSpacing: 1 + boundsBehavior: Flickable.StopAtBounds - Column { - anchors.centerIn: parent + model: TableModel { + TableModelColumn { display: "checked" } + TableModelColumn { display: "amount" } + TableModelColumn { display: "fruitType" } + TableModelColumn { display: "fruitName" } + TableModelColumn { display: "fruitPrice" } - RadioButton { text: qsTr("Small") } - RadioButton { text: qsTr("Medium"); checked: true } - RadioButton { text: qsTr("Large") } + // Each row is one type of fruit that can be ordered + rows: [ + { + // Each property is one cell/column. + checked: false, + amount: 1, + fruitType: "Apple", + fruitName: "Granny Smith", + fruitPrice: 1.50 + }, + { + checked: true, + amount: 4, + fruitType: "Orange", + fruitName: "Navel", + fruitPrice: 2.50 + }, + { + checked: false, + amount: 1, + fruitType: "Banana", + fruitName: "Cavendish", + fruitPrice: 3.50 + } + ] + } + delegate: TextInput { + text: model.display + padding: 12 + selectByMouse: true + + onAccepted: model.display = text + + Rectangle { + anchors.fill: parent + color: "#efefef" + z: -1 + } + } } }