2021-03-05 02:35:15 +03:00
|
|
|
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2017-10-20 20:58:23 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
|
|
|
class Label : public QLabel
|
|
|
|
{
|
2021-09-18 01:22:33 +03:00
|
|
|
Q_OBJECT
|
2017-10-20 20:58:23 +03:00
|
|
|
|
|
|
|
public:
|
2021-09-18 01:22:33 +03:00
|
|
|
explicit Label(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
|
|
|
|
explicit Label(const QString &text,
|
|
|
|
QWidget *parent = Q_NULLPTR,
|
|
|
|
Qt::WindowFlags f = Qt::WindowFlags());
|
2017-10-20 20:58:23 +03:00
|
|
|
|
|
|
|
signals:
|
2021-09-18 01:22:33 +03:00
|
|
|
void clicked(QMouseEvent *e);
|
|
|
|
void pressed(QMouseEvent *e);
|
|
|
|
void released(QMouseEvent *e);
|
2017-10-20 20:58:23 +03:00
|
|
|
|
|
|
|
protected:
|
2021-09-18 01:22:33 +03:00
|
|
|
void mousePressEvent(QMouseEvent *e) override;
|
|
|
|
void mouseReleaseEvent(QMouseEvent *e) override;
|
2017-10-20 20:58:23 +03:00
|
|
|
|
2021-09-18 01:22:33 +03:00
|
|
|
QPoint pressPosition_;
|
2017-10-20 20:58:23 +03:00
|
|
|
};
|