-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPlayerBar.qml
More file actions
38 lines (31 loc) · 912 Bytes
/
PlayerBar.qml
File metadata and controls
38 lines (31 loc) · 912 Bytes
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
import QtQuick 2.13
import QtQuick.Layouts 1.11
import com.queopardy 1.0
import "Colors.js" as C
Flow {
id: players;
spacing: 10;
property alias model: playerRepeater.model;
Repeater {
id: playerRepeater;
// model: [];
delegate: Rectangle {
property int playerIndex: model.index;
property Player player: players.model.get(playerIndex)
Layout.preferredWidth: childrenRect.width;
height: childrenRect.height;
width: childrenRect.width;
color: player.color;
Text {
text: player.name + ": " + player.score;
color: {
return C.textColorFor(player.color);
}
font.pointSize: 20;
padding: 5;
leftPadding: 10;
rightPadding: 10;
}
}
}
}