KK.
KK.

Reputation: 783

Qt Mobile image display and user interaction

While creating my Qt mobile 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.

Upvotes: 0

Views: 183

Answers (1)

fejd
fejd

Reputation: 2565

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

Upvotes: 1

Related Questions