#ifndef DISPLAY_SCHEMA_H #define DISPLAY_SCHEMA_H #include #include #include #include namespace display { class BusConnection; class Schema: public QGraphicsView { Q_OBJECT public: enum State { DEFAULT, CREATING_CONNECTION }; struct Context { display::Pin *pin; QPointF startingPoint; }; State state = DEFAULT; Context context; Schema(); std::vector connections; void setSchema(domain::Schema* schema, domain::Library* library); void updateConnections(); protected: void dragEnterEvent(QDragEnterEvent *event) override; void dropEvent(QDropEvent *event) override; void dragMoveEvent(QDragMoveEvent *event) override; private: QGraphicsScene scene; domain::Schema* schema; domain::Library* library; }; } // namespace display #endif // DISPLAY_SCHEMA_H