summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-30 12:55:24 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-30 12:55:24 (GMT)
commit853894dca607a0266f3c6d23c937dd5f55e551af (patch)
tree6af860cdf403788e9bb1cd04953149cdb2492cad /tests
parent568475d98d77c3ade027eb88e571ca8b84088002 (diff)
downloadQt-853894dca607a0266f3c6d23c937dd5f55e551af.zip
Qt-853894dca607a0266f3c6d23c937dd5f55e551af.tar.gz
Qt-853894dca607a0266f3c6d23c937dd5f55e551af.tar.bz2
Fix QStaticText test on Mac
Avoid taking fast path in drawText() since this is optimized and does not draw text completely accurate on a floating point font engine. Rather we use the slightly slower but more accurate drawText() which takes a rectangle so that the results are identical to the ones produced by drawStaticText(). Reviewed-by: TrustMe
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qstatictext/tst_qstatictext.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp
index e7a22b3..c7801ac 100644
--- a/tests/auto/qstatictext/tst_qstatictext.cpp
+++ b/tests/auto/qstatictext/tst_qstatictext.cpp
@@ -239,10 +239,10 @@ void tst_QStaticText::setFont()
imageDrawText.fill(Qt::white);
{
QPainter p(&imageDrawText);
- p.drawText(0, 0 + QFontMetrics(p.font()).ascent(), "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+ p.drawText(QRectF(0, 0, 1000, 1000), 0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
p.setFont(font);
- p.drawText(11, 120 + QFontMetrics(p.font()).ascent(), "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+ p.drawText(QRectF(11, 120, 1000, 1000), 0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
}
QPixmap imageDrawStaticText(1000, 1000);
@@ -342,7 +342,7 @@ void tst_QStaticText::rotatedPainter()
{
QPainter p(&imageDrawText);
p.rotate(30.0);
- p.drawText(0, 0 + QFontMetricsF(p.font()).ascent(), "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+ p.drawText(QRectF(0, 0, 1000, 100), 0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
}
QPixmap imageDrawStaticText(1000, 1000);
@@ -469,10 +469,10 @@ void tst_QStaticText::transformationChanged()
p.rotate(33.0);
p.scale(0.5, 0.7);
- p.drawText(0, 0 + QFontMetricsF(p.font()).ascent(), "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+ p.drawText(QRectF(0, 0, 1000, 1000), 0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
p.scale(7.0, 5.0);
- p.drawText(0, 0 + QFontMetricsF(p.font()).ascent(), "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+ p.drawText(QRectF(0, 0, 1000, 1000), 0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
}
QPixmap imageDrawStaticText(1000, 1000);