- QGraphicsScene::drawBackground(painter, rect);
-
- spaceWidgets();
-
- for (BasicBlockWidget * widget : widgets) {
- QPointF kopf = widget->getEntry();
- painter->setPen(QColor(0x00, 0xff, 0x00, 0xff));
- painter->drawLine(kopf, kopf - QPointF(0, 20));
-
- auto tails = widget->getExits();
- auto next = widget->getNext();
- if (NULL != next[0]) {
- if (NULL != next[1]) {
- painter->setPen(QColor(0xff, 0x00, 0x00, 0xff));
- painter->drawLine(std::get<0>(tails), std::get<0>(tails) + QPointF(0, 20));
- drawLine(painter, std::get<0>(tails) + QPointF(0, 20), next[1]->getEntry() - QPointF(0, 20));
- painter->setPen(QColor(0x00, 0xff, 0x00, 0xff));
- painter->drawLine(std::get<2>(tails), std::get<2>(tails) + QPointF(0, 20));
- drawLine(painter, std::get<2>(tails) + QPointF(0, 20), next[0]->getEntry() - QPointF(0, 20));
- } else {
- painter->setPen(QColor(0x00, 0x00, 0x00, 0xff));
- painter->drawLine(std::get<1>(tails), std::get<1>(tails) + QPointF(0, 20));
- drawLine(painter, std::get<1>(tails) + QPointF(0, 20), next[0]->getEntry() - QPointF(0, 20));
- }
- }
- }
+ QGraphicsScene::drawBackground(painter, rect);
+
+ spaceWidgets();
+
+ for (BasicBlockWidget * widget : widgets) {
+ QPointF kopf = widget->getEntry();
+ painter->setPen(QColor(0x00, 0xff, 0x00, 0xff));
+ painter->drawLine(kopf, kopf - QPointF(0, 20));
+
+ auto tails = widget->getExits();
+ auto next = widget->getNext();
+ if (NULL != next[0]) {
+ if (NULL != next[1]) {
+ painter->setPen(QColor(0xff, 0x00, 0x00, 0xff));
+ painter->drawLine(std::get<0>(tails), std::get<0>(tails) + QPointF(0, 20));
+ drawLine(painter, widget, next[1], -1);
+
+ painter->setPen(QColor(0x00, 0xff, 0x00, 0xff));
+ painter->drawLine(std::get<2>(tails), std::get<2>(tails) + QPointF(0, 20));
+ drawLine(painter, widget, next[0], 1);
+ } else {
+ painter->setPen(QColor(0x00, 0x00, 0x00, 0xff));
+ painter->drawLine(std::get<1>(tails), std::get<1>(tails) + QPointF(0, 20));
+ drawLine(painter, widget, next[0], 0);
+ }
+ }
+ }