Make cardModel clickable
This commit is contained in:
parent
2b58dc25fa
commit
3160ad6cc4
|
@ -9,6 +9,7 @@ Item {
|
|||
required property PlayingCard card;
|
||||
required property bool isFaceDown;
|
||||
property string backStyle: "red"
|
||||
signal clicked();
|
||||
|
||||
Image {
|
||||
id: cardImage
|
||||
|
@ -19,5 +20,10 @@ Item {
|
|||
? "qrc:/img/playing_cards/fronts/" + cardModel.card.suitString + "_" + cardModel.card.valueString + ".svg"
|
||||
: "qrc:/img/playing_cards/backs/blue.svg"
|
||||
fillMode: Image.PreserveAspectFit
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: cardModel.clicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue