-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
95 lines (77 loc) · 2.11 KB
/
main.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import QtQuick 2.4
import QtQuick.Controls 1.3
import "qrc:/components"
ApplicationWindow {
id:root
title: qsTr("Hello World")
width: 640
height: 480
visible: true
TopBar {
id:topBar
z:1
anchors {
fill: parent
bottomMargin: parent.height*(0.9)
}
mainRectColor: "#4CAF50"
textTopBar: "Tasks"
}
Flickable {
anchors.top: topBar.bottom
anchors.topMargin: parent.height*(0.05)
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.leftMargin: parent.width*(0.05)
anchors.right: parent.right
anchors.rightMargin: parent.width*(0.05)
contentHeight: taskIterator.count * (root.height*(0.2) + taskColumn.spacing)
Column {
id:taskColumn
spacing: 20
Repeater {
id:taskIterator
model: ListModel { id:cards }
delegate: Card{
cardTitle: title
cardDescription: description
width:root.width*(0.9)
height: root.height*(0.2)
mainRectColor: "white"
}
}
}
}
FloatActionButton {
raio:70
icon:"qrc:/assets/plus.png"
mainRectColor: "#536DFE"
anchors {
bottom: parent.bottom
right: parent.right
bottomMargin: parent.height*(0.05)
rightMargin: parent.width*(0.05)
}
}
Dialog {
id:createTaskDialog
}
Component.onCompleted: initialize();
//JS Functions
function initialize() {
cards.append({
title:"Study",
description:"Study QML!"
});
cards.append({
title:"Work",
description:"Focus on web development and c++"
});
}
function addCard(t, d) {
cards.append({
title:t,
description:d
});
}
}