#ifndef MODULEUNIT_H #define MODULEUNIT_H #include #include #include #define m_handleLen 10 class ExpertBoxLayoutWin; class ModuleUnit : public QWidget { Q_OBJECT public: explicit ModuleUnit(ExpertBoxLayoutWin *, const QString &name, int x, int y, int w, int h, QWidget *parent = nullptr); ExpertBoxLayoutWin *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 mOtherEles; }; #endif // MODULEUNIT_H