#ifndef LAYER_H #define LAYER_H #include "main.h" #include #include #define HandleSize 10 class Layer : public QWidget { Q_OBJECT public: explicit Layer(int idx, const QString &name, QWidget *parent = 0); inline void setGeo() { setGeometry(QRect(sPos*gScale+gOrigin, sSize*gScale)); } QPoint sPos; QSize sSize{1920, 1080}; int idx = 1, rowIdx = 0; QString name; char type = 'L'; bool isSelected = false; protected: void paintEvent(QPaintEvent *) override; void mousePressEvent(QMouseEvent *) override; void mouseReleaseEvent(QMouseEvent *) override; void mouseMoveEvent(QMouseEvent *) override; void leaveEvent(QEvent *) override; void setFrmSec(const QPointF &); void setFrmSecIfNeed(Qt::WindowFrameSection frmSec, Qt::CursorShape cursor); void clearSnap(); QPen mSidePen; QRectF m_rL, m_rR, m_rT, m_rB, m_rLT, m_rRT, m_rRB, m_rLB; QPointF mPressRel{FLT_MAX, FLT_MAX}; Qt::WindowFrameSection mFrmSec = Qt::NoSection; char snapLR = 0, snapTB = 0; std::vector otherLayers; }; #endif // LAYER_H