The problem with QGraphicsScene is that every time I add a node it changes the whole arrangement of the nodes and the coordinate system and I end up seeing only the nodes that should be placed in the 4rth quadrant of the plane, these nodes are in the top left corner though and nothing else is displayed.

There is also a difference in the colour of the nodes depending on their position but this doesn't matter. (Just making it clear because it affects the code.)

The way I draw them is shown below:

```
void drawNetworkGraphics(std::vector<int> topology){
QBrush blackBrush(Qt::black);
QBrush blueBrush(Qt::blue);
QPen blackPen(Qt::black);
blackPen.setWidth(2);
int middleH = graphicScene->width()/2;
int middleV = graphicScene->height()/2;
for(unsigned i = 0; i< topology.size(); i++){
if(i < topology.size()-1){
if(i < topology.size()/2){
for(unsigned k = 0; k<=topology[i]; k++){
if(k < topology[i]/2){
graphicScene->addEllipse(-(40*((topology.size()/2) - i)),-30*((topology[i]/2) -k),20,20,blackPen,blackBrush);
}
else{
if(k == topology[i]){
graphicScene->addEllipse(-40*((topology.size()/2) - i),(30*k)+1,20,20,blackPen,blueBrush);
}
else
graphicScene->addEllipse(-40*((topology.size()/2) - i),(30*k)+1,20,20,blackPen,blackBrush);
}
}
}
else{
for(unsigned k = 0; k<=topology[i]; k++){
if(k < topology[i]/2){
graphicScene->addEllipse((40*i),-30*((topology[i]/2) -k),20,20,blackPen,blackBrush);
}
else{
if(k == topology[i]){
graphicScene->addEllipse((40*i)+1,(30*k),20,20,blackPen,blueBrush);
}
else
graphicScene->addEllipse((40*i)+1,(30*k),20,20,blackPen,blackBrush);
}
}
}
}
else{
for(unsigned k = 0; k<topology[i]; k++){
if(k < topology[i]/2){
graphicScene->addEllipse(40*i+1,-30*(topology[i]/2 -k),20,20,blackPen,blackBrush);
}
else{
graphicScene->addEllipse(40*i+1,30*k+1,20,20,blackPen,blackBrush);
}
}
}
}
}```
```

]]>The problem with QGraphicsScene is that every time I add a node it changes the whole arrangement of the nodes and the coordinate system and I end up seeing only the nodes that should be placed in the 4rth quadrant of the plane, these nodes are in the top left corner though and nothing else is displayed.

There is also a difference in the colour of the nodes depending on their position but this doesn't matter. (Just making it clear because it affects the code.)

The way I draw them is shown below:

```
void drawNetworkGraphics(std::vector<int> topology){
QBrush blackBrush(Qt::black);
QBrush blueBrush(Qt::blue);
QPen blackPen(Qt::black);
blackPen.setWidth(2);
int middleH = graphicScene->width()/2;
int middleV = graphicScene->height()/2;
for(unsigned i = 0; i< topology.size(); i++){
if(i < topology.size()-1){
if(i < topology.size()/2){
for(unsigned k = 0; k<=topology[i]; k++){
if(k < topology[i]/2){
graphicScene->addEllipse(-(40*((topology.size()/2) - i)),-30*((topology[i]/2) -k),20,20,blackPen,blackBrush);
}
else{
if(k == topology[i]){
graphicScene->addEllipse(-40*((topology.size()/2) - i),(30*k)+1,20,20,blackPen,blueBrush);
}
else
graphicScene->addEllipse(-40*((topology.size()/2) - i),(30*k)+1,20,20,blackPen,blackBrush);
}
}
}
else{
for(unsigned k = 0; k<=topology[i]; k++){
if(k < topology[i]/2){
graphicScene->addEllipse((40*i),-30*((topology[i]/2) -k),20,20,blackPen,blackBrush);
}
else{
if(k == topology[i]){
graphicScene->addEllipse((40*i)+1,(30*k),20,20,blackPen,blueBrush);
}
else
graphicScene->addEllipse((40*i)+1,(30*k),20,20,blackPen,blackBrush);
}
}
}
}
else{
for(unsigned k = 0; k<topology[i]; k++){
if(k < topology[i]/2){
graphicScene->addEllipse(40*i+1,-30*(topology[i]/2 -k),20,20,blackPen,blackBrush);
}
else{
graphicScene->addEllipse(40*i+1,30*k+1,20,20,blackPen,blackBrush);
}
}
}
}
}```
```

]]>