38 lines
1.1 KiB
C
38 lines
1.1 KiB
C
|
#ifndef BASEWIN_H
|
||
|
#define BASEWIN_H
|
||
|
|
||
|
#include <QWidget>
|
||
|
#include <QPen>
|
||
|
|
||
|
class BaseWin : public QWidget {
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
explicit BaseWin(QWidget *parent = nullptr);
|
||
|
QWidget *center{nullptr};
|
||
|
QPen borderPenAct{Qt::gray};
|
||
|
QPen borderPenUnact{Qt::lightGray};
|
||
|
qreal roundRadius{6.0};
|
||
|
QPointF titlePos{36, 26};
|
||
|
QPixmap icon;
|
||
|
QPointF iconPos{13, 13};
|
||
|
protected:
|
||
|
void paintEvent(QPaintEvent *) override;
|
||
|
void mousePressEvent(QMouseEvent *) override;
|
||
|
void mouseReleaseEvent(QMouseEvent *) override;
|
||
|
void mouseMoveEvent(QMouseEvent *) override;
|
||
|
void leaveEvent(QEvent *) override;
|
||
|
bool eventFilter(QObject *, QEvent *) override;
|
||
|
void changeEvent(QEvent *) override;
|
||
|
void mouseDoubleClickEvent(QMouseEvent *) override;
|
||
|
bool nativeEvent(const QByteArray &, void *, long *) override;
|
||
|
|
||
|
void setFrmSec(const QPoint &pos);
|
||
|
void setFrmSecIfNeed(Qt::WindowFrameSection frmSec, Qt::CursorShape cursor);
|
||
|
|
||
|
QPoint mPressRel{INT_MAX, INT_MAX};
|
||
|
Qt::WindowFrameSection mFrmSec{Qt::NoSection};
|
||
|
bool isActive{false};
|
||
|
};
|
||
|
|
||
|
#endif // BASEWIN_H
|