I have a ListModel which stores a string "cityName" and a real value "TimeZoneOffset". As the name suggests, cityName holds the name of the city and TimeZoneOffset holds the time offset (from UTC) in minutes.
ListModel {
id: worldCity
ListElement {
cityName: "London"
TimeZoneOffset: 0
}
ListElement {
cityName: "Amsterdam"
TimeZoneOffset: 120
}
}
This model is then used in a ListView. The ListView has a structure as shown in the code sample below.
ListView {
model: worldCity
currentIndex: -1
delegate: ListItem.Standard {
text: cityName
Label {
text: timeOffSet + currentSystemTime
}
}
}
As you can see, my ListView is showing a modified output instead of directly outputting the listModel element. I need to update the ListView elements every minute to show the current time at a city. I plan on using a Timer to update it every minute.
How do I update every listView element?