imagemousearea.h 723 Bytes
Newer Older
1
2
3
4
5
#ifndef IMAGEMOUSEAREA_H
#define IMAGEMOUSEAREA_H

#include <QQuickItem>

6
class ImageMouseArea : public QQuickItem {
7
    Q_OBJECT
8
    Q_PROPERTY(QString imageName READ imageName WRITE setImageName)
9
10
11
12

public:
    explicit ImageMouseArea(QQuickItem *parent = 0);

13
    QString imageName() const {
14
15
16
17
18
19
20
21
22
23
24
        return m_imageName;
    }

signals:
    void clicked();
    void imageNameChanged();

private:
    QString m_imageName;

public slots:
25
    void setImageName(QString arg) {
26
27
28
29
30
31
32
33
34
35
36
37
38
        m_imageName = arg;
    }

    // QQuickItem interface
public:
    virtual bool contains(const QPointF &point) const;

    // QQuickItem interface
protected:
    virtual void mousePressEvent(QMouseEvent *event);
};

#endif // IMAGEMOUSEAREA_H