diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-02-16 12:38:10 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-02-16 13:12:51 (GMT) |
commit | e4e92b74980c4f601d080e1e072b556b7318c915 (patch) | |
tree | 51fd15333c62895ba7c0afa9f3730d7c8417164f /tests/auto/qstatictext/tst_qstatictext.cpp | |
parent | 181631276e1bf9a103eeb1a8dc9f195d51e3c279 (diff) | |
download | Qt-e4e92b74980c4f601d080e1e072b556b7318c915.zip Qt-e4e92b74980c4f601d080e1e072b556b7318c915.tar.gz Qt-e4e92b74980c4f601d080e1e072b556b7318c915.tar.bz2 |
Rename QStaticText::setUseBackendOptimizations to setPerformanceHint()
Make the API more general and more readable by using a PerformanceHint
enum instead of an on/off-trigger for the OpenGL-specific caching.
Reviewed-by: Samuel
Diffstat (limited to 'tests/auto/qstatictext/tst_qstatictext.cpp')
-rw-r--r-- | tests/auto/qstatictext/tst_qstatictext.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp index 69e9dc5..a99ae74 100644 --- a/tests/auto/qstatictext/tst_qstatictext.cpp +++ b/tests/auto/qstatictext/tst_qstatictext.cpp @@ -89,17 +89,18 @@ void tst_QStaticText::constructionAndDestruction() QStaticText text("My text"); } +Q_DECLARE_METATYPE(QStaticText::PerformanceHint) void tst_QStaticText::drawToPoint_data() { - QTest::addColumn<bool>("useBackendOptimizations"); + QTest::addColumn<QStaticText::PerformanceHint>("performanceHint"); - QTest::newRow("Without backend optimizations") << false; - QTest::newRow("With backend optimizations") << true; + QTest::newRow("Moderate caching") << QStaticText::ModerateCaching; + QTest::newRow("Aggressive caching") << QStaticText::AggressiveCaching; } void tst_QStaticText::drawToPoint() { - QFETCH(bool, useBackendOptimizations); + QFETCH(QStaticText::PerformanceHint, performanceHint); QPixmap imageDrawText(1000, 1000); imageDrawText.fill(Qt::white); @@ -113,7 +114,7 @@ void tst_QStaticText::drawToPoint() { QPainter p(&imageDrawStaticText); QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit."); - text.setUseBackendOptimizations(useBackendOptimizations); + text.setPerformanceHint(performanceHint); p.drawStaticText(QPointF(11, 12), text); } @@ -122,15 +123,15 @@ void tst_QStaticText::drawToPoint() void tst_QStaticText::drawToRect_data() { - QTest::addColumn<bool>("useBackendOptimizations"); + QTest::addColumn<QStaticText::PerformanceHint>("performanceHint"); - QTest::newRow("Without backend optimizations") << false; - QTest::newRow("With backend optimizations") << true; + QTest::newRow("Moderate caching") << QStaticText::ModerateCaching; + QTest::newRow("Aggressive caching") << QStaticText::AggressiveCaching; } void tst_QStaticText::drawToRect() { - QFETCH(bool, useBackendOptimizations); + QFETCH(QStaticText::PerformanceHint, performanceHint); QPixmap imageDrawText(1000, 1000); imageDrawText.fill(Qt::white); @@ -144,7 +145,7 @@ void tst_QStaticText::drawToRect() { QPainter p(&imageDrawStaticText); QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.", QSizeF(10, 500)); - text.setUseBackendOptimizations(useBackendOptimizations); + text.setPerformanceHint(performanceHint); p.drawStaticText(QPointF(11, 12), text); } |