summaryrefslogtreecommitdiffstats
path: root/ClickableLabel.h
diff options
context:
space:
mode:
Diffstat (limited to 'ClickableLabel.h')
-rw-r--r--ClickableLabel.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/ClickableLabel.h b/ClickableLabel.h
new file mode 100644
index 0000000..86d39e8
--- /dev/null
+++ b/ClickableLabel.h
@@ -0,0 +1,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__