While creating my Qt mobile开发者_StackOverflow社区 application, i would need the user to touch a particular image and then (the application would) act accordingly.
I was using QLabel until now, but now it turns out it does not have ANY user interaction.
So I need suggestions on how to display images, preferably in a way that allows me to make use of Qt touch events too.
Thanks.
Displaying images and reacting to touch events is very easy to do in QML:
import QtQuick 1.0
Image {
source: "image.png"
MouseArea {
anchors.fill: parent
onClicked: {
// React to image clicks here
}
}
}
精彩评论