hey there i am trying to create links between nodes that i have made but theres 1 problem. everytime i paint a link the last link that i painted onto the qpainter goes away. how can i keep the links that have been painted before on the link? i store the node Id's in an array and their position with a struct. so i just get a user input as to where they want the link to be created. my code for the painting is shown below:

Qt Code:
  1. if( drawLine == 1)
  2. {
  3. painter.setPen(myTextColor());
  4. painter.drawLine( list.position[n1]+offset, list.position[n2]+offset );
  5. painter.drawText(QRect(midpoint,textbox),0,tr("%1").arg(topology[n1][n2]));
  6.  
  7. }
To copy to clipboard, switch view to plain text mode 

i also have a capacity number that i wish to appear between the links when they get painted.