How to call a function in onClick.
-
How i implement my "MouseArea" so when i click on it that the big Image changes. I tried to use Functions or new qml types but i dont get it. i tried it with loader but it still doesnt work
i have tried it with source like this but still dont know how to change the big image when i have 3 MouseArea and i click on one it should change to that image i want how do i do that?
-
Please, paste code not picture of the code. Now, to help you, I need to manually re-type all of it :-(
Here are the changes you need:
Image { id: mainImage x: 100 source: "Qt logo" } // ... MouseArea { onClicked: mainImage.source = "Pictures/Qt/Festung.png" }
-
Please, paste code not picture of the code. Now, to help you, I need to manually re-type all of it :-(
Here are the changes you need:
Image { id: mainImage x: 100 source: "Qt logo" } // ... MouseArea { onClicked: mainImage.source = "Pictures/Qt/Festung.png" }
@sierdzio said in How to call a function in onClick.:
onClicked: mainImage.source = "Pictures/Qt/Festung.png"
Wow thank you it worked, and sorry its my first question and i am new here. Please forgive me for my newbie experience and thank you so much it was so easy and i spend over a day for it...
-
No problem, happy coding.
The good news about QML is that once you get over the initial confusion it becomes really convenient and easy to learn.