mirror-chatterino2/src/widgets/helper/SignalLabel.hpp

29 lines
650 B
C++
Raw Normal View History

#pragma once
2017-01-18 14:48:42 +01:00
#include <QFlags>
#include <QLabel>
2017-01-20 06:10:28 +01:00
#include <QMouseEvent>
2017-01-18 14:48:42 +01:00
#include <QWidget>
class SignalLabel : public QLabel
{
Q_OBJECT
2017-01-20 06:10:28 +01:00
2017-01-18 14:48:42 +01:00
public:
explicit SignalLabel(QWidget *parent = nullptr, Qt::WindowFlags f = 0);
virtual ~SignalLabel() override = default;
2017-01-20 06:10:28 +01:00
2017-01-18 14:48:42 +01:00
signals:
void mouseDoubleClick(QMouseEvent *ev);
2017-01-20 06:10:28 +01:00
void mouseDown();
void mouseUp();
void mouseMove(QMouseEvent *event);
2017-01-20 06:10:28 +01:00
2017-01-18 14:48:42 +01:00
protected:
void mouseDoubleClickEvent(QMouseEvent *ev) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
2017-01-18 14:48:42 +01:00
};