qt/LedOK/basedlg.h
2022-08-25 18:40:38 +08:00

27 lines
695 B
C++

#ifndef BASEDLG_H
#define BASEDLG_H
#include <QDialog>
#include <QPen>
class BaseDlg : public QDialog {
Q_OBJECT
public:
explicit BaseDlg(QWidget *parent = nullptr);
QPen borderPenAct = QPen(Qt::gray);
QPen borderPenUnact = QPen(Qt::lightGray);
qreal roundRadius = 6.0;
QPixmap icon;
QPointF iconPos = QPointF(12, 12);
protected:
void paintEvent(QPaintEvent *) override;
void mousePressEvent(QMouseEvent *) override;
void mouseReleaseEvent(QMouseEvent *) override;
void mouseMoveEvent(QMouseEvent *) override;
bool nativeEvent(const QByteArray &, void *, long *) override;
QPoint pressRel;
bool isActive = false;
};
#endif // BASEDLG_H