how to make a reservation seat in qml ?
Unsolved
QML and Qt Quick
-
Some simple code like this should work:
ColumnLayout { property real price: 0.0 // BTW. Using floating point for prices is a very bad idea! I use it here only as a simplification Label { text: qsTr("Price") } Label { text: price } GridView { model: 20 spacing: 10 delegate: Rectangle { property bool selected: true color: selected? "red" : "gray" MouseArea { anchors.fill: parent onClicked: { if (selected) { price += 15 } else { price -= 15 } selected = !selected } } } }
It would be better to use some real model here, like list of objects or QAbstractItemModel. I've used just integer to make things simpler.
... and don't worry about your English, it's pretty good :-)