Make cardModel clickable

This commit is contained in:
ItsDrike 2024-12-02 19:30:47 +01:00
parent 2b58dc25fa
commit 3160ad6cc4
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0

View file

@ -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()
}
}
}