12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #ifndef WAFFLE_H
- #define WAFFLE_H
- #include <QWidget>
- #include <vector>
- #include <QMenu>
- #include "WaffleGraphicsView.h"
- #include "DieItem.h"
- #include "CMatrixCommon.h"
- #include "CWafflePackMatrix.h"
- class Waffle : public QWidget
- {
- public:
- Waffle(int flag, QWidget *parent = nullptr);
- void paintEvent(QPaintEvent *event) override;
- QColor getColorByStatus(ns_mat::PICK_DIE_STATUS status);
- void initFrom(QWidget *parent);
- void paintInitFrom(QWidget *parent);
- QPixmap getGlobalPixmap() const;
- private:
- void drawWaffle(QPainter &painter, int startX, int startY, int rows, int cols, int gridSize, int gap);
- // 华夫台的参数
- int gridSize; // 每个格子的大小
- int gap; // 格子之间的间隙
- int rows = 3; // 华夫台的行数
- int cols = 3; // 华夫台的列数
- // 华夫盒的参数
- int boxRows = 3; // 华夫盒的行数
- int boxCols = 4; // 华夫盒的列数
- int boxGap; // 华夫台之间的间隙
- QVector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT> waffleData;
- int centerX, centerY;
- QPixmap globalPixmap;
- public:
- QGraphicsScene* scene = nullptr;
- WaffleGraphicsView* view = nullptr;
- };
- #endif // WAFFLE_H
|