add simple layout demo

This commit is contained in:
王劲鹏
2021-03-01 18:59:09 +08:00
committed by osborn
parent 257f3f0dab
commit e35f0a79c4
6 changed files with 71 additions and 36 deletions

View File

@@ -12,19 +12,28 @@ ApplicationWindow {
ListView {
width: parent.width
model: 1
model: 2
delegate: Rectangle {
Column {
anchors.centerIn: parent
Text {
text: {return "Snake.js"}
text: {
switch (index) {
case 0:
return "SimpleDemo.es5.js"
case 1:
return "Snake.es5.js"
}
}
}
}
width: parent.width
height: 60
MouseArea {
anchors.fill: parent
onClicked: {demoBridge.navigate(index)}
onClicked: {
demoBridge.navigate(index)
}
}
}
}

View File

@@ -3,9 +3,5 @@ import QtQuick.Controls 2.5
Flex {
flexDirection: "column"
alignItems: "center"
alignSelf: "center"
justifyContent: "spaceAround"
alignContent: "stretch"
}