--- /dev/null
+#ifndef INCLUDE__CFGScene_hxx
+#define INCLUDE__CFGScene_hxx
+
+#include "gui/qt.hxx"
+#include "BasicBlockWidget.hxx"
+
+#include <vector>
+
+class CFGScene : public QGraphicsScene {
+public:
+ CFGScene(QWidget * parent = 0)
+ : QGraphicsScene(parent) {}
+
+ // Take special care when adding a BasicBlock to the scene as we
+ // need to draw arrows for it later on
+ void addItem(BasicBlockWidget* block) {
+ widgets.push_back(block);
+ QGraphicsScene::addItem(block);
+ }
+
+ virtual void drawBackground(QPainter* painter, const QRectF & rect);
+private:
+ std::vector<BasicBlockWidget*> widgets;
+
+ void drawLine(QPainter* painter, QPointF from, QPointF to, bool left = true);
+
+ void spaceWidgets();
+};
+
+#endif