38 lines
991 B
C
38 lines
991 B
C
|
#ifndef SCREENUNIT_H
|
||
|
#define SCREENUNIT_H
|
||
|
|
||
|
#include <QWidget>
|
||
|
#include <QVBoxLayout>
|
||
|
#include <QPen>
|
||
|
|
||
|
#define m_handleLen 10
|
||
|
class ExpertWin;
|
||
|
class ScreenUnit : public QWidget {
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
explicit ScreenUnit(ExpertWin *, const QString &name, int x, int y, int w, int h, QWidget *parent = nullptr);
|
||
|
|
||
|
ExpertWin *expertWin{0};
|
||
|
QString name;
|
||
|
int mX, mY, mW, mH;
|
||
|
protected:
|
||
|
void paintEvent(QPaintEvent *) override;
|
||
|
void mousePressEvent(QMouseEvent *) override;
|
||
|
void mouseReleaseEvent(QMouseEvent *) override;
|
||
|
void mouseMoveEvent(QMouseEvent *) override;
|
||
|
void leaveEvent(QEvent *) override;
|
||
|
|
||
|
void setFrmSec(const QPoint &);
|
||
|
void setFrmSecIfNeed(Qt::WindowFrameSection frmSec, Qt::CursorShape cursor);
|
||
|
void clearSnap();
|
||
|
QPen mSidePen{Qt::white};
|
||
|
|
||
|
QPoint mPressRel{INT_MIN, INT_MIN};
|
||
|
Qt::WindowFrameSection mFrmSec{Qt::NoSection};
|
||
|
char mLRSnap{0}, mTBSnap{0};
|
||
|
QList<ScreenUnit *> mOtherEles;
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif // SCREENUNIT_H
|