qt/ledset/expertsendpanel.h

57 lines
1.4 KiB
C
Raw Normal View History

2023-09-05 10:02:20 +08:00
#ifndef EXPERTSENDPANEL_H
#define EXPERTSENDPANEL_H
#include <QPushButton>
#include <QPen>
class ExpertSendPanel : public QWidget {
Q_OBJECT
public:
explicit ExpertSendPanel(QWidget *parent = nullptr);
int screenWidth{1280}, screenHeight{720};
double rate{1};
QPushButton *btnSendReadBack;
};
class ResizeEmitedWgt : public QWidget {
Q_OBJECT
public:
using QWidget::QWidget;
protected:
void resizeEvent(QResizeEvent *) override {emit resized();}
signals:
void resized();
};
#define m_handleLen 10
class ScreenUnit : public QWidget {
Q_OBJECT
public:
explicit ScreenUnit(ExpertSendPanel *, const QString &name, int x, int y, int w, int h, QWidget *parent = nullptr);
ExpertSendPanel *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};
std::vector<ScreenUnit *> mOtherEles;
};
#endif // EXPERTSENDPANEL_H