Try this

Qt Code:
  1. void edpForm::paintEvent(QPaintEvent *event)
  2. {
  3. double angle;
  4. QPainter painter( this );
  5.  
  6. for( n = 0; n < paintLines.count(); ++n ) {
  7. k = paintLines[n];
  8. temp = k.split( "," );
  9. xs = temp[0].toInt( &ok );
  10. ys = temp[1].toInt( &ok );
  11. xe = temp[2].toInt( &ok );
  12. ye = temp[3].toInt( &ok );
  13. painter.drawLine( xs, ys, xe, ye );
  14. }
  15.  
  16. for( n = 0; n < paintLabels.count(); ++n ) {
  17. k = paintLabels[n];
  18. temp = k.split( "," );
  19. xs = temp[0].toInt( &ok );
  20. ys = temp[1].toInt( &ok );
  21. angle = temp[2].toDouble( &ok );
  22.  
  23. painter.save();
  24.  
  25. painter.translate( xs, ys );
  26. painter.rotate( angle );
  27. painter.drawText( 0, 0, temp[3] );
  28. //painter.drawText( xs, ys, temp[3] );
  29.  
  30. painter.restore();
  31. }
  32. }
To copy to clipboard, switch view to plain text mode