Hi, i'm using Qt4.1.4
I have three lines forming a triange.
I want to label these lines s1, s2, s3 at the midpoint of each line, rotated to the angle of the line.
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. {
  8. k = paintLines[n];
  9. temp = k.split( "," );
  10. xs = temp[0].toInt( &ok );
  11. ys = temp[1].toInt( &ok );
  12. xe = temp[2].toInt( &ok );
  13. ye = temp[3].toInt( &ok );
  14. painter.drawLine( xs, ys, xe, ye );
  15. }
  16. for( n = 0; n < paintLabels.count(); ++n )
  17. {
  18. k = paintLabels[n];
  19. temp = k.split( "," );
  20. xs = temp[0].toInt( &ok );
  21. ys = temp[1].toInt( &ok );
  22. angle = temp[2].toDouble( &ok );
  23. painter.translate( xs, ys );
  24. painter.rotate( angle );
  25. painter.drawText( 0, 0, temp[3] );
  26. //painter.drawText( xs, ys, temp[3] );
  27. }
  28. }
To copy to clipboard, switch view to plain text mode 
With the code as shown, I get the label s1, rotated to the angle of the line and at the midpoint of the line. The other two lines are not labeled.

If I option out the 3 lines above the optioned out line and activate the bottom line, I get each line labled at their midpoints, but the labels are not rotated.

This tells me, that the data is OK., so there must be somthing wrong with my code. Help would be appreciated.

I am having a great deal of trouble with the switch from Qt3 to Qt4 dealing with graphics, so I am being very verbose

thanks