Thanks, I do have painter.restore in my code. I miss typed it in my post sorry. When I ran the program
for( n = 0; n < paintLabels.count(); ++n )
{
k = paintLabels[n];
temp = k.split( "," );
xs = temp[0].toInt( &ok );
ys = temp[1].toInt( &ok );
angle = temp[2].toDouble( &ok );
painter.translate( xs, ys );
painter.rotate( angle );
painter.drawText( 0, 0, temp[3] );
//painter.drawText( xs, ys, temp[3] );
painter.restore();
}
for( n = 0; n < paintLabels.count(); ++n )
{
k = paintLabels[n];
temp = k.split( "," );
xs = temp[0].toInt( &ok );
ys = temp[1].toInt( &ok );
angle = temp[2].toDouble( &ok );
painter.translate( xs, ys );
painter.rotate( angle );
painter.drawText( 0, 0, temp[3] );
//painter.drawText( xs, ys, temp[3] );
painter.restore();
}
To copy to clipboard, switch view to plain text mode
I got the same image plus I got "Painter::restore(), unbalanced save/restore" warnings for each element painted. Now for the inmage with and without the "painter.restore()".
[IMG]
[/IMG] and with the code
for( n = 0; n < paintLabels.count(); ++n )
{
k = paintLabels[n];
temp = k.split( "," );
xs = temp[0].toInt( &ok );
ys = temp[1].toInt( &ok );
angle = temp[2].toDouble( &ok );
//painter.translate( xs, ys );
//painter.rotate( angle );
//painter.drawText( 0, 0, temp[3] );
painter.drawText( xs, ys, temp[3] );
//painter.restore();
}
for( n = 0; n < paintLabels.count(); ++n )
{
k = paintLabels[n];
temp = k.split( "," );
xs = temp[0].toInt( &ok );
ys = temp[1].toInt( &ok );
angle = temp[2].toDouble( &ok );
//painter.translate( xs, ys );
//painter.rotate( angle );
//painter.drawText( 0, 0, temp[3] );
painter.drawText( xs, ys, temp[3] );
//painter.restore();
}
To copy to clipboard, switch view to plain text mode
I get the image
[IMG]
[/IMG] with the "painter.restore()" or with it optioned out. (name warning with it in ) I hope all this helps you.
Thanks for the tip on images, I am not sure on its use, but if after you click on the thumbnail, you click on the image again, you get my drawing.
Bookmarks