| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <QLabel> |
| 7 |
#include <QStackedWidget> |
| 8 |
#include <QWidget> |
| 9 |
|
| 10 |
class ClickBlurLabel final : public QStackedWidget |
| 11 |
{ |
| 12 |
Q_OBJECT |
| 13 |
public: |
| 14 |
explicit ClickBlurLabel(QWidget* parent = nullptr); |
| 15 |
|
| 16 |
void setText(const QString& text); |
| 17 |
|
| 18 |
QString text() const { return m_normal_label->text(); } |
| 19 |
|
| 20 |
protected: |
| 21 |
void mousePressEvent(QMouseEvent* event) override; |
| 22 |
|
| 23 |
private: |
| 24 |
|
| 25 |
static QString GenerateBlurredText(const QString& text); |
| 26 |
|
| 27 |
QLabel* m_normal_label; |
| 28 |
QLabel* m_blurred_label; |
| 29 |
}; |