summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2012-08-24 10:39:37 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-27 10:58:03 +0200
commit4712d88c0ef69e9724334f37319dc8e8ad0f2ab0 (patch)
treeaa5159aa4079ee1af78b7ad237013e4033a0e1e0 /tests/auto/gui
parentbc80ee36f8ffe18f8362b2328ca29f92291df132 (diff)
Make letter spacing APIs in QTextFormat more consistent
Change d060b6f04f956ab3a6358f826dc6928b3353f5f7 introduced some new properties to QTextFormat which were unfinished and did not match the documentation in the same change. I've updated the API and docs to use the regular QFont enum for letter spacing type instead of introducing bools (which inhibits expansions later) or mutually exclusive properties in the text format. Change-Id: Ife44993b6746c413e421fdaf92ebaaab6ba95977 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/text/qtextformat/tst_qtextformat.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp b/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp
index 84539b86cc..4e005e7f1e 100644
--- a/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp
+++ b/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp
@@ -285,22 +285,26 @@ void tst_QTextFormat::testLetterSpacing()
QTextCharFormat format;
QCOMPARE(format.hasProperty(QTextFormat::FontLetterSpacing), false);
- QCOMPARE(format.hasProperty(QTextFormat::FontAbsoluteLetterSpacing), false);
+ QCOMPARE(format.hasProperty(QTextFormat::FontLetterSpacingType), false);
- format.setFontAbsoluteLetterSpacing(10.0);
+ format.setFontLetterSpacingType(QFont::AbsoluteSpacing);
+ format.setFontLetterSpacing(10.0);
- QCOMPARE(format.hasProperty(QTextFormat::FontLetterSpacing), false);
- QCOMPARE(format.property(QTextFormat::FontAbsoluteLetterSpacing).toDouble(), 10.0);
+ QCOMPARE(format.hasProperty(QTextFormat::FontLetterSpacing), true);
+ QCOMPARE(format.property(QTextFormat::FontLetterSpacing).toDouble(), 10.0);
+ QCOMPARE(format.property(QTextFormat::FontLetterSpacingType).toInt(), int(QFont::AbsoluteSpacing));
+ format.setFontLetterSpacingType(QFont::PercentageSpacing);
format.setFontLetterSpacing(110.0);
QCOMPARE(format.property(QTextFormat::FontLetterSpacing).toDouble(), 110.0);
- QCOMPARE(format.hasProperty(QTextFormat::FontAbsoluteLetterSpacing), false);
+ QCOMPARE(format.property(QTextFormat::FontLetterSpacingType).toInt(), int(QFont::PercentageSpacing));
- format.setFontAbsoluteLetterSpacing(10.0);
+ format.setFontLetterSpacingType(QFont::AbsoluteSpacing);
+ format.setFontLetterSpacing(10.0);
- QCOMPARE(format.hasProperty(QTextFormat::FontLetterSpacing), false);
- QCOMPARE(format.property(QTextFormat::FontAbsoluteLetterSpacing).toDouble(), 10.0);
+ QCOMPARE(format.property(QTextFormat::FontLetterSpacingType).toInt(), int(QFont::AbsoluteSpacing));
+ QCOMPARE(format.property(QTextFormat::FontLetterSpacing).toDouble(), 10.0);
}
void tst_QTextFormat::testFontStretch()