Init sync and listmodel function.

This commit is contained in:
Black Hat
2018-02-28 21:11:42 +08:00
parent a4b00f823e
commit c3367543bf
12 changed files with 143 additions and 124 deletions

View File

@@ -7,6 +7,7 @@ import "qrc:/qml/component"
Item {
ColumnLayout {
anchors.fill: parent
spacing: 0
Pane {
Layout.fillWidth: true

View File

@@ -8,6 +8,7 @@ import "qrc:/qml/component"
Item {
ColumnLayout {
anchors.fill: parent
spacing: 0
Pane {
z: 10

View File

@@ -6,6 +6,7 @@ import QtQuick.Controls.Material 2.3
import "qrc:/qml/component"
Item {
property var listModel
ColumnLayout {
anchors.fill: parent
spacing: 0
@@ -74,58 +75,6 @@ Item {
color: "#eaeaea"
}
ListModel {
id: listModel
ListElement {
name: "Bill Smith"
number: "555 3264"
}
ListElement {
name: "John Brown"
number: "555 8426"
}
ListElement {
name: "Sam Wise"
number: "555 0473"
}
ListElement {
name: "Bill Smith"
number: "555 3264"
}
ListElement {
name: "John Brown"
number: "555 8426"
}
ListElement {
name: "Sam Wise"
number: "555 0473"
}
ListElement {
name: "Bill Smith"
number: "555 3264"
}
ListElement {
name: "John Brown"
number: "555 8426"
}
ListElement {
name: "Sam Wise"
number: "555 0473"
}
ListElement {
name: "Bill Smith"
number: "555 3264"
}
ListElement {
name: "John Brown"
number: "555 8426"
}
ListElement {
name: "Sam Wise"
number: "555 0473"
}
}
ListView {
id: listView
width: parent.width
@@ -145,25 +94,29 @@ Item {
height: 80
onClicked: listView.currentIndex = index
contentItem: Item {
Row {
spacing: 16
contentItem: Row {
width: parent.width - 32
height: parent.height - 32
spacing: 16
ImageStatus {
width: parent.height
height: parent.height
source: "qrc:/asset/img/avatar.png"
ImageStatus {
width: parent.height
height: parent.height
source: "qrc:/asset/img/avatar.png"
}
Column {
width: parent.width
height: parent.height
Text {
width: parent.width
text: name
color: "#424242"
}
Column {
Text {
text: name
color: "#424242"
}
Text {
text: number
color: "#424242"
}
Text {
width: parent.width
text: value
color: "#424242"
}
}
}