obs-studio/UI/clickable-label.hpp

22 lines
305 B
C++
Raw Normal View History

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