Init sync and listmodel function.
This commit is contained in:
17
qml/Home.qml
17
qml/Home.qml
@@ -1,17 +0,0 @@
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
import "qrc:/qml/form"
|
||||
|
||||
Page {
|
||||
RoomListForm {
|
||||
id: roomListForm
|
||||
height: parent.height
|
||||
width: 320
|
||||
}
|
||||
|
||||
RoomForm {
|
||||
id: roomForm
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: roomListForm.width
|
||||
}
|
||||
}
|
||||
@@ -6,14 +6,15 @@ Page {
|
||||
property var roomListModel
|
||||
|
||||
RoomListForm {
|
||||
id: contactListForm
|
||||
id: roomListForm
|
||||
height: parent.height
|
||||
width: 320
|
||||
listModel: roomListModel
|
||||
}
|
||||
|
||||
ContactDetailForm {
|
||||
id: contactDetailForm
|
||||
RoomForm {
|
||||
id: roomForm
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: contactListForm.width
|
||||
anchors.leftMargin: roomListForm.width
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import "qrc:/qml/component"
|
||||
Item {
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
|
||||
Pane {
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -8,6 +8,7 @@ import "qrc:/qml/component"
|
||||
Item {
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
|
||||
Pane {
|
||||
z: 10
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
36
qml/main.qml
36
qml/main.qml
@@ -70,22 +70,22 @@ ApplicationWindow {
|
||||
}
|
||||
}
|
||||
|
||||
// ButtonDelegate {
|
||||
// index: 2
|
||||
|
||||
// contentItem: Text {
|
||||
// text: "\ue5d2"
|
||||
// font.pointSize: 16
|
||||
// font.family: materialFont.name
|
||||
// color: "white"
|
||||
// horizontalAlignment: Text.AlignHCenter
|
||||
// verticalAlignment: Text.AlignVCenter
|
||||
// }
|
||||
// }
|
||||
|
||||
ButtonDelegate {
|
||||
index: 2
|
||||
|
||||
contentItem: Text {
|
||||
text: "\ue5d2"
|
||||
font.pointSize: 16
|
||||
font.family: materialFont.name
|
||||
color: "white"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
|
||||
ButtonDelegate {
|
||||
index: 3
|
||||
|
||||
contentItem: Text {
|
||||
text: "\ue8b8"
|
||||
font.pointSize: 16
|
||||
@@ -97,7 +97,7 @@ ApplicationWindow {
|
||||
}
|
||||
|
||||
ButtonDelegate {
|
||||
index: 4
|
||||
index: 3
|
||||
|
||||
contentItem: Text {
|
||||
text: "\ue879"
|
||||
@@ -120,8 +120,8 @@ ApplicationWindow {
|
||||
interactive: false
|
||||
orientation: Qt.Vertical
|
||||
|
||||
Home {
|
||||
|
||||
Room {
|
||||
roomListModel: controller.roomListModel
|
||||
}
|
||||
|
||||
Login {
|
||||
@@ -130,10 +130,6 @@ ApplicationWindow {
|
||||
controller: controller
|
||||
}
|
||||
|
||||
Room {
|
||||
roomListModel: controller.roomListModel
|
||||
}
|
||||
|
||||
Setting {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user