mirror of
https://github.com/wf-group/wfview
synced 2026-08-13 17:32:59 -04:00
27 lines
459 B
C++
27 lines
459 B
C++
#ifndef CLICKABLELABEL_H
|
|
#define CLICKABLELABEL_H
|
|
|
|
#include <QLabel>
|
|
#include <QMouseEvent>
|
|
|
|
class ClickableLabel : public QLabel
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit ClickableLabel(QWidget *parent = nullptr);
|
|
|
|
void setActive(bool active);
|
|
bool isActive() const;
|
|
|
|
signals:
|
|
void clicked();
|
|
|
|
protected:
|
|
void mousePressEvent(QMouseEvent *event) override;
|
|
|
|
private:
|
|
void updateStyle();
|
|
bool m_active = false;
|
|
};
|
|
|
|
#endif // CLICKABLELABEL_H
|