2022-08-25 18:40:38 +08:00
|
|
|
#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;
|
2023-04-18 18:02:58 +08:00
|
|
|
#ifdef Q_OS_WINDOWS
|
2023-04-19 14:42:06 +08:00
|
|
|
#if(QT_VERSION_MAJOR > 5)
|
|
|
|
bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
|
|
|
|
#else
|
2022-08-25 18:40:38 +08:00
|
|
|
bool nativeEvent(const QByteArray &, void *, long *) override;
|
2023-04-19 14:42:06 +08:00
|
|
|
#endif
|
2023-04-18 18:02:58 +08:00
|
|
|
#endif
|
2022-08-25 18:40:38 +08:00
|
|
|
QPoint pressRel;
|
|
|
|
bool isActive = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BASEDLG_H
|