2024-07-30 10:56:05 +02:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
|
|
|
Page {
|
|
|
|
id: root
|
|
|
|
header: ToolBar {
|
|
|
|
Label {
|
|
|
|
text: qsTr("Olympia 2024 Events")
|
|
|
|
font.pixelSize: 20
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-08-16 14:29:27 +02:00
|
|
|
Column {
|
2024-07-30 10:56:05 +02:00
|
|
|
anchors.fill: parent
|
2024-08-16 14:29:27 +02:00
|
|
|
anchors.topMargin: 24
|
|
|
|
anchors.leftMargin: 48
|
|
|
|
anchors.bottomMargin: 48
|
|
|
|
anchors.rightMargin: 48
|
|
|
|
spacing: 24
|
|
|
|
|
|
|
|
Row {
|
|
|
|
// width: parent.width
|
|
|
|
// height: 50
|
|
|
|
spacing: 20
|
|
|
|
|
|
|
|
|
|
|
|
ComboBox {
|
2024-08-16 18:03:26 +02:00
|
|
|
width: 300
|
2024-08-16 14:29:27 +02:00
|
|
|
height: 50
|
|
|
|
|
2024-08-16 18:03:26 +02:00
|
|
|
displayText: "Discipline: " + currentText
|
2024-08-16 14:29:27 +02:00
|
|
|
model: myListModel
|
2024-08-16 15:40:37 +02:00
|
|
|
textRole: "text"
|
2024-08-16 14:29:27 +02:00
|
|
|
|
|
|
|
ListModel {
|
|
|
|
id: myListModel
|
2024-08-16 15:40:37 +02:00
|
|
|
ListElement {
|
|
|
|
text: "AquaticsArtisticSwimming"
|
|
|
|
api: "SWA"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "AquaticsDiving"
|
|
|
|
api: "DIV"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "AquaticsMarathonSwimming"
|
|
|
|
api: "OWS"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "AquaticsSwimming"
|
|
|
|
api: "SWM"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "AquaticsWaterPolo"
|
|
|
|
api: "WPO"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Archery"
|
|
|
|
api: "ARC"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Athletics"
|
|
|
|
api: "ATH"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Badminton"
|
|
|
|
api: "BDM"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Basketball3v3"
|
|
|
|
api: "BK3"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Basketball"
|
|
|
|
api: "BKB"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Boxing"
|
|
|
|
api: "BOX"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Breaking"
|
|
|
|
api: "BKG"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "CanoeingSprint"
|
|
|
|
api: "CSP"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "CanoeingSlalom"
|
|
|
|
api: "CSL"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "CyclingBMXFreestyle"
|
|
|
|
api: "BMF"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "CyclingBMXRacing"
|
|
|
|
api: "BMX"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "CyclingMaountainBike"
|
|
|
|
api: "MTB"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "CyclingRoad"
|
|
|
|
api: "CRD"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "CyclingTrack"
|
|
|
|
api: "CTR"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "EquestrianDressage"
|
|
|
|
api: "EDR"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "EquestrianEventing"
|
|
|
|
api: "EVE"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "EquestrianJumping"
|
|
|
|
api: "EJP"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Fencing"
|
|
|
|
api: "FEN"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "FieldHockey"
|
|
|
|
api: "HOC"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Football"
|
|
|
|
api: "FBL"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Golf"
|
|
|
|
api: "GLF"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "GymnasticsArtistic"
|
|
|
|
api: "GAR"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "GymnasticsRhythmic"
|
|
|
|
api: "GRY"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "GymnasticsTrampoline"
|
|
|
|
api: "GTR"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "HandballIndoor"
|
|
|
|
api: "HBL"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Judo"
|
|
|
|
api: "JUD"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "ModernPentathlon"
|
|
|
|
api: "MPN"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Rowing"
|
|
|
|
api: "ROW"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Rugby7"
|
|
|
|
api: "RU7"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Sailing"
|
|
|
|
api: "SAL"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Shooting"
|
|
|
|
api: "SHO"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Skateboarding"
|
|
|
|
api: "SKB"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "SportClimbing"
|
|
|
|
api: "CLB"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Surfing"
|
|
|
|
api: "SRF"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "TableTennis"
|
|
|
|
api: "TTE"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Taekwondo"
|
|
|
|
api: "TKW"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Tennis"
|
|
|
|
api: "TEN"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Triathlon"
|
|
|
|
api: "TRI"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "VolleyballBeach"
|
|
|
|
api: "VBV"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "VolleyballIndoor"
|
|
|
|
api: "VVO"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "Weightlifting"
|
|
|
|
api: "WLF"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "WrestlingFreestyle"
|
|
|
|
api: "WRE"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
text: "WrestlingGrecoRoman"
|
|
|
|
api: "WRG"
|
|
|
|
}
|
|
|
|
}
|
2024-08-16 18:13:50 +02:00
|
|
|
Component.onCompleted: currentIndex = 5;
|
2024-08-16 15:40:37 +02:00
|
|
|
onActivated: {
|
|
|
|
if (currentIndex >= 0) {
|
|
|
|
console.log(currentValue.api);
|
|
|
|
sports.request(currentValue.api)
|
|
|
|
}
|
2024-08-16 14:29:27 +02:00
|
|
|
}
|
|
|
|
}
|
2024-08-16 18:03:26 +02:00
|
|
|
TextField {
|
2024-08-16 14:29:27 +02:00
|
|
|
height: 50
|
|
|
|
width: 200
|
2024-08-16 18:03:26 +02:00
|
|
|
placeholderText: "Search"
|
|
|
|
onTextChanged: filter.setFilterFixedString(text)
|
2024-08-16 14:29:27 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: listView
|
|
|
|
// anchors.fill: parent
|
|
|
|
// topMargin: 48
|
|
|
|
height: parent.height
|
|
|
|
width: parent.width
|
|
|
|
spacing: 20
|
2024-08-16 18:03:26 +02:00
|
|
|
model: filter
|
2024-08-16 14:29:27 +02:00
|
|
|
delegate: ItemDelegate {
|
|
|
|
required property string eventName
|
2024-08-16 22:19:42 +02:00
|
|
|
property list<QtObject> competitors
|
2024-08-16 14:29:27 +02:00
|
|
|
text: eventName
|
|
|
|
width: listView.width - listView.leftMargin - listView.rightMargin
|
|
|
|
height: avatar.height
|
|
|
|
leftPadding: avatar.width + 16
|
|
|
|
onClicked: root.StackView.view.push("EventInfoPage.qml", { eventName, competitors })
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: avatar
|
|
|
|
height: 32
|
|
|
|
width: 32
|
2024-08-16 15:40:37 +02:00
|
|
|
source: "qrc:/qt/qml/itat/res/pictograms/" + sports.discipline + "_small.svg"
|
2024-08-16 14:29:27 +02:00
|
|
|
}
|
2024-07-30 10:56:05 +02:00
|
|
|
}
|
|
|
|
}
|
2024-08-16 14:29:27 +02:00
|
|
|
|
2024-07-30 10:56:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|