diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-01-15 13:18:43 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-01-15 13:18:43 (GMT) |
commit | 4b01aa0eb6e4f13b5b3a822a9e60f88a61b4d591 (patch) | |
tree | 7a37edd1dda6df78c5d340345c17bea3561b8c26 /tests/auto/qstatictext | |
parent | 4e568e32ccfc758caa302ca1e785f2208073c991 (diff) | |
download | Qt-4b01aa0eb6e4f13b5b3a822a9e60f88a61b4d591.zip Qt-4b01aa0eb6e4f13b5b3a822a9e60f88a61b4d591.tar.gz Qt-4b01aa0eb6e4f13b5b3a822a9e60f88a61b4d591.tar.bz2 |
Use fallback when drawing projected text
Projected text always has to go via paths, so we use the fall back for
this.
Diffstat (limited to 'tests/auto/qstatictext')
-rw-r--r-- | tests/auto/qstatictext/tst_qstatictext.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp index adc9593..ca83f2f 100644 --- a/tests/auto/qstatictext/tst_qstatictext.cpp +++ b/tests/auto/qstatictext/tst_qstatictext.cpp @@ -67,6 +67,7 @@ private slots: void translatedPainter(); void rotatedPainter(); void scaledPainter(); + void projectedPainter(); void rotatedScaledAndTranslatedPainter(); void transformationChanged(); }; @@ -306,6 +307,34 @@ void tst_QStaticText::scaledPainter() QCOMPARE(imageDrawStaticText, imageDrawText); } +void tst_QStaticText::projectedPainter() +{ + QTransform transform; + transform.rotate(90, Qt::XAxis); + + QPixmap imageDrawText(1000, 1000); + imageDrawText.fill(Qt::white); + { + QPainter p(&imageDrawText); + p.setTransform(transform); + + p.drawText(11, 12, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."); + } + + QPixmap imageDrawStaticText(1000, 1000); + imageDrawStaticText.fill(Qt::white); + { + QPainter p(&imageDrawStaticText); + p.setTransform(transform); + + QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit."); + p.drawStaticText(11, 12, text); + } + + QCOMPARE(imageDrawStaticText, imageDrawText); + +} + void tst_QStaticText::rotatedScaledAndTranslatedPainter() { QPixmap imageDrawText(1000, 1000); |