itat_challenge/res/gui/EventInfoPage.qml

61 lines
1.3 KiB
QML
Raw Permalink Normal View History

import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
Page {
id: root
required property string eventName
required property list<QtObject> competitors
header: ToolBar {
ToolButton {
text: qsTr("Back")
anchors.left: parent.left
anchors.leftMargin: 10
anchors.verticalCenter: parent.verticalCenter
onClicked: root.StackView.view.pop()
}
Label {
id: pageTitle
font.pixelSize: 20
anchors.centerIn: parent
text: eventName
}
}
ListView {
id: listView
anchors.fill: parent
topMargin: 48
leftMargin: 48
bottomMargin: 48
rightMargin: 48
spacing: 20
model: competitors
delegate: ItemDelegate {
required property string name
required property string noc
required property string mark
required property string statistic
required property string gold
required property string silver
required property string bronze
width: listView.width - listView.leftMargin - listView.rightMargin
height: 32
Text {
anchors.left: parent.left
text: name + " (" + noc + ")"
}
Text {
anchors.right: parent.right
horizontalAlignment: Text.AlignRight
text: mark + " " + statistic + " | " + gold + "🥇 " + silver + "🥈 " + bronze + "🥉"
}
}
}
}