-
Notifications
You must be signed in to change notification settings - Fork 0
/
bttab.qml
101 lines (74 loc) · 2 KB
/
bttab.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
96
97
98
99
100
101
import QtQuick 2.4
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.3
import QtQuick.Dialogs 1.2
import QtQuick.Controls.Styles 1.3
Rectangle {
width: parent.width
height: parent.height
ListView {
id: listview
width: parent.width
height: parent.height
model: ListModel {
id: model_name_url
}
header: headview
delegate: delegate_name_url
}
Component {
id: headview
Item {
width: parent.width
height: 30
RowLayout {
spacing: parent.width/4
Label {
width: 30
text: "name"
}
Label {
text: "url"
}
}
}
}
Component{
id: delegate_name_url
RowLayout {
width: parent.width
TextField {
text: name
style: TextFieldStyle{
textColor: "black"
background: Rectangle {
radius: 2
border.color: "#333"
border.width: 1
}
}
}
TextField {
text: url
style: TextFieldStyle{
textColor: "black"
background: Rectangle {
radius: 2
border.color: "#333"
border.width: 1
}
}
Layout.fillWidth :true
}
}
}
function add_items(content){
model_name_url.append(content)
}
function clear_items(){
model_name_url.clear()
}
function get_num(){
return model_name_url.count
}
}