yolobs-studio/UI/clickable-label.hpp
2019-07-27 14:47:10 +02:00

21 lines
308 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();
}
};