You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #ifndef PLCDOCUMENT_H
- #define PLCDOCUMENT_H
-
- #include "basedocument.h"
- #include <QGraphicsScene>
- #include <QGraphicsView>
-
- class PLCDocument : public BaseDocument
- {
- Q_OBJECT
- public:
- explicit PLCDocument(QWidget *parent = nullptr);
- ~PLCDocument() override;
-
- QString title() const override;
- QGraphicsView *view() const { return m_view; }
- QGraphicsScene *scene() const { return m_scene; }
-
- bool saveToFile(const QString &filePath) override;
- bool loadFromFile(const QString &filePath) override;
-
- private:
- void createGridBackground();
- void createGridPattern();
-
- QGraphicsScene *m_scene;
- QGraphicsView *m_view;
- QPixmap m_gridPattern; // 网格图案缓存
- int m_gridSize = 20; // 网格大小(像素)
- };
-
- #endif // PLCDOCUMENT_H
|