|
- #ifndef PLCEDITOR_H
- #define PLCEDITOR_H
-
- #include <QWidget>
- #include <QVBoxLayout>
- #include <QListWidget>
- #include <QGraphicsScene>
- #include <QGraphicsView>
- #include <QGraphicsRectItem>
-
- class PLCElement : public QGraphicsRectItem {
- public:
- enum Type { NormallyOpen, NormallyClosed };
-
- PLCElement(Type type, QGraphicsItem *parent = nullptr);
- Type getType() const { return type; }
-
- private:
- Type type;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
- };
-
- class PLCEditor : public QWidget
- {
- Q_OBJECT
-
- public:
- explicit PLCEditor(QWidget *parent = nullptr);
-
- public slots:
- void onNormallyOpen();
- void onNormallyClosed();
-
- private:
- QGraphicsScene* scene;
- QGraphicsView* view;
- int elementCount;
- };
-
- #endif // PLCEDITOR_H
|