开发者

Qt Mobile image display and user interaction

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
        }
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜