summaryrefslogtreecommitdiffstats
path: root/ClickableLabel.h
blob: 86d39e8671d76dc90fe490ce7116b5265dc06736 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef __CLICKABLE_LABEL_H__
#define __CLICKABLE_LABEL_H__

#include <QLabel>
#include <QWidget>
#include <QString>

class ClickableLabel : public QLabel
{
    Q_OBJECT
    public:
        ClickableLabel(const QString& text="", QWidget* parent=0 ):QLabel(parent)
        {
            setText(text);
        }
        ~ClickableLabel(){}
    signals:
        void clicked();
    protected:
        void mouseReleaseEvent(QMouseEvent* event) { emit clicked(); }
};

#endif // __CLICKABLE_LABEL_H__