You have to take care about the origin of your rotation. Your code rotates around the top left position of the plot cancas.
Rotating the text around the center of a rectangle would work like this ( untested, out of my memory ):
painter->save();
painter->translate( textRect.center() );
painter->rotate( -90 - i * 7.2);
textRect.
moveCenter( QPointF( 0.0,
0.0 ) );
QwtPainter::drawText(painter, textRect, Qt
::AlignLeft | Qt
::AlignBottom,
QString::number);
painter->restore();
QRectF textRect QwtScaleMap::transform(xMap, yMap, QRectF(-14,-595,100,100) );
painter->save();
painter->translate( textRect.center() );
painter->rotate( -90 - i * 7.2);
textRect.moveCenter( QPointF( 0.0, 0.0 ) );
QwtPainter::drawText(painter, textRect, Qt::AlignLeft | Qt::AlignBottom, QString::number);
painter->restore();
To copy to clipboard, switch view to plain text mode
But in your case I guess you want to align the rotated text to a specific position not to the center of some pointless rectangle.
HTH,
Uwe
Bookmarks