-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBoardView.qml
68 lines (52 loc) · 1.56 KB
/
BoardView.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
import QtQuick 2.13
import QtQuick.Layouts 1.11
import com.queopardy 1.0
ColumnLayout {
id: board;
property Game game;
signal questionSelected(var question);
spacing: 2;
RowLayout {
Layout.fillWidth: true;
Layout.fillHeight: true;
spacing: 2;
Repeater {
id: categoryRepeater
model: game.board.categories;
delegate: ColumnLayout {
Layout.fillWidth: true;
spacing: 2;
property var category: model.modelData;
Rectangle { // Category header
height: txt.height;
Layout.fillWidth: true;
color: "darkgray"
Text {
id: txt;
anchors.centerIn: parent;
text: category.label;
font.pointSize: 20;
color: "white";
padding: 10;
}
}
Repeater {
model: category.questions;
delegate: Tile { // Question tile
id: tile;
question: model.modelData;
onSelected: {
board.questionSelected(question);
}
}
}
}
}
}
PlayerBar {
id: playerBar
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
model: game
}
}