yolobs-studio/UI/clickable-label.hpp
2019-09-22 23:19:10 +02:00

21 lines
305 B
C++

#pragma once
#include <QLabel>
#include <QMouseEvent>
class ClickableLabel : public QLabel {
Q_OBJECT
public:
inline ClickableLabel(QWidget *parent = 0) : QLabel(parent) {}
signals:
void clicked();
protected:
void mousePressEvent(QMouseEvent *event)
{
emit clicked();
event->accept();
}
};