Problem with rotating text (Qt 4.8.2, WinCE6)
-
Hi
We are using QPainter::rotate to rotate some text on the screen using the following code:
@void Screen::paintEvent(QPaintEvent*)
{
QPainter painter(this);
painter.translate((qreal)100, (qreal)100);
painter.rotate(-90.0);
painter.drawText(0, 0, "Rotated text");
}@This worked perfectly well under Qt4.7.2 but does not work anymore under Qt4.8.2 for WinCE 6.0. The debug version throws now an assert, while the release version simply lines up the text vertically, without rotating the glyphs. If we run the same test program under Win32, everything works as expected.
Didi anybody else observe such a behaviour? Any idea what went wrong here?Best regards
Andreas
-
Hi Erik
I have added bug QTBUG-26347 to the issue tracker. Basically, the work-around is as follows:
There this is a problem in the following code:3439 bool QRasterPaintEngine::supportsTransformations(qreal pixelSize, const QTransform &m) const
3440 { 3441 #if defined(Q_WS_MAC) || (defined(Q_OS_MAC) && defined(Q_WS_QPA)) 3442 // Mac font engines don't support scaling and rotation 3443 if (m.type() > QTransform::TxTranslate) 3444 #else 3445 if (m.type() >= QTransform::TxProject) 3446 #endif 3447 return true; 3448 3449 if (pixelSize * pixelSize * qAbs(m.determinant()) >= 64 * 64) 3450 return true; 3451 3452 return false; 3453 }adding "|| defined(Q_WS_WINCE)" to line 3441 solves the problem.
Best regards
Andreas