yolobs-studio/UI/clickable-label.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
305 B
C++
Raw Permalink Normal View History

2019-07-27 12:47:10 +00:00
#pragma once
#include <QLabel>
#include <QMouseEvent>
class ClickableLabel : public QLabel {
2019-09-22 21:19:10 +00:00
Q_OBJECT
2019-07-27 12:47:10 +00:00
public:
inline ClickableLabel(QWidget *parent = 0) : QLabel(parent) {}
signals:
void clicked();
protected:
void mousePressEvent(QMouseEvent *event)
{
emit clicked();
event->accept();
}
};