-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSelectAnswersFile.qml
219 lines (199 loc) · 6.41 KB
/
SelectAnswersFile.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QtQuick.Dialogs 1.1
ApplicationWindow {
id: mainWindow
width: 640
height: 500
visible: true
title: "Выбор файла с ответами"
signal mouseClicked()
property int number: 0
property int currentIndexClicked: -1
function setPatternRecognitionArray(patternRecognitionMas) {
console.log(patternRecognitionMas)
patternRecognitionArrayViewModel.append({patternRecognitionText: "test2 answers"})
for(var i = 0; i < patternRecognitionMas.length; i++)
patternRecognitionArrayViewModel.append({patternRecognitionText: patternRecognitionMas[i]})
}
RowLayout {
id: col
width: 320
height: 410
ColumnLayout {
width: 320
height: 410
Rectangle {
id: textPatternReviewId
width: parent.width
height: 23
Text {
id: textPatternReviewIdtext
text: qsTr("Очередь файлов ответов")
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}
Rectangle {
width: 320
height: 2
color: "black"
}
Rectangle {
id: prostRect
width: parent.width
height: parent.height
ListView {
id: patternRecognitionArray
anchors.fill: parent
spacing: 15
clip: true
anchors.top: parent.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
delegate: Item {
anchors.left: parent.left
anchors.right: parent.right
height: 35
Text {
text: patternRecognitionText
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 16
}
MouseArea {
anchors.fill: parent
onClicked: {
currentIndexClicked = index
patternRecognitionArray.currentIndex = index
}
}
Rectangle {
width: 300
height: 40
color: "transparent"
border{
color: {
var colorM = "#ffbd00"
if(patternRecognitionArray.currentIndex == index)
colorM = "#157efb"
return colorM
}
width: 2
}
}
}
ScrollBar.vertical: ScrollBar { visible: true }
model: ListModel {
id: patternRecognitionArrayViewModel
}
onCurrentItemChanged: {
currentIndexClicked = patternRecognitionArray.currentIndex
}
}
}
}
}
Rectangle {
id: borderId
anchors.left: col.right
height: 460
width: 2
color: "black"
}
Column {
width: 318
height: 410
anchors.left: borderId.right
//anchors.leftMargin: 10
Rectangle {
id: properiesId
width: parent.width
height: 30
Text {
id: properiesIdText
text: qsTr("Свойства")
anchors.horizontalCenter: parent.horizontalCenter
}
}
Rectangle {
width: 320
height: 2
color: "black"
}
Rectangle {
height: 10
width: 320
}
Column {
spacing: 15
Row {
Label {
anchors.leftMargin: 10
text: qsTr(" Количество вопросов = ")
}
Label {
text: {
if(currentIndexClicked >= 0)
return "40"
else
return "62"
}
}
}
Row {
Label {
anchors.leftMargin: 10
text: qsTr(" Количество ответов = ")
}
Label {
text: {
if(currentIndexClicked >= 0)
return numbersOfReplies
else
return "1"
}
}
}
// Row {
// Label {
// anchors.leftMargin: 10
// text: qsTr(" Количество = ")
// }
// Label {
// text: {
// if(currentIndexClicked >= 0)
// return numberOfRecognitionArea
// else
// return "NULL"
// }
// }
// }
}
}
Button {
anchors.topMargin: 50
width: mainWindow.width
height: 25
text: qsTr("Выбрать")
anchors.top: col.bottom
color: "#c2cbc3"
onClicked: {
msgDialog.open()
}
}
MessageDialog {
id: msgDialog
title: "Выбор"
icon: StandardIcon.Question
text: "Вы уверены?"
standardButtons: StandardButton.Yes | StandardButton.No
onYes: procClick()
}
function procClick() {
mainWindow.mouseClicked()
mainWindow.close()
}
}