28 lines
625 B
C++
28 lines
625 B
C++
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include <QGraphicsScene>
|
|
#include <QGraphicsView>
|
|
|
|
namespace Xybrid::Data { class Graph; }
|
|
|
|
namespace Xybrid::UI {
|
|
class PatchboardScene : public QGraphicsScene {
|
|
std::shared_ptr<Data::Graph> graph;
|
|
QGraphicsView* view;
|
|
|
|
void autoSetSize();
|
|
|
|
public:
|
|
PatchboardScene(QGraphicsView* view, const std::shared_ptr<Data::Graph>& graph);
|
|
~PatchboardScene() override = default;
|
|
|
|
void drawBackground(QPainter*, const QRectF&) override;
|
|
|
|
void contextMenuEvent(QGraphicsSceneContextMenuEvent*) override;
|
|
|
|
void refresh();
|
|
};
|
|
}
|