From 3160ad6cc48b06a5f3a2e866caf13982d15b9091 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 2 Dec 2024 19:30:47 +0100 Subject: [PATCH] Make cardModel clickable --- CardModel.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CardModel.qml b/CardModel.qml index 942133c..3159815 100644 --- a/CardModel.qml +++ b/CardModel.qml @@ -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() + } } }