diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2012-08-24 10:39:37 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-27 10:58:03 +0200 |
commit | 4712d88c0ef69e9724334f37319dc8e8ad0f2ab0 (patch) | |
tree | aa5159aa4079ee1af78b7ad237013e4033a0e1e0 /src/gui/text/qtextformat.h | |
parent | bc80ee36f8ffe18f8362b2328ca29f92291df132 (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 'src/gui/text/qtextformat.h')
-rw-r--r-- | src/gui/text/qtextformat.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/text/qtextformat.h b/src/gui/text/qtextformat.h index a0a1e8846e..c6c0585381 100644 --- a/src/gui/text/qtextformat.h +++ b/src/gui/text/qtextformat.h @@ -179,7 +179,7 @@ public: // character properties FirstFontProperty = 0x1FE0, FontCapitalization = FirstFontProperty, - FontAbsoluteLetterSpacing = 0x2033, // if true FontLetterSpacing is absolute + FontLetterSpacingType = 0x2033, FontLetterSpacing = 0x1FE1, FontWordSpacing = 0x1FE2, FontStretch = 0x2034, @@ -434,14 +434,12 @@ public: { setProperty(FontCapitalization, capitalization); } inline QFont::Capitalization fontCapitalization() const { return static_cast<QFont::Capitalization>(intProperty(FontCapitalization)); } - inline void setFontAbsoluteLetterSpacing(qreal absoluteSpacing) - { setProperty(FontAbsoluteLetterSpacing, absoluteSpacing); - clearProperty(FontLetterSpacing); } - inline qreal fontAbsoluteLetterSpacing() const - { return doubleProperty(FontAbsoluteLetterSpacing); } + inline void setFontLetterSpacingType(QFont::SpacingType letterSpacingType) + { setProperty(FontLetterSpacingType, letterSpacingType); } + inline QFont::SpacingType fontLetterSpacingType() const + { return static_cast<QFont::SpacingType>(intProperty(FontLetterSpacingType)); } inline void setFontLetterSpacing(qreal spacing) - { setProperty(FontLetterSpacing, spacing); - clearProperty(FontAbsoluteLetterSpacing); } + { setProperty(FontLetterSpacing, spacing); } inline qreal fontLetterSpacing() const { return doubleProperty(FontLetterSpacing); } inline void setFontWordSpacing(qreal spacing) @@ -473,7 +471,7 @@ public: inline bool fontFixedPitch() const { return boolProperty(FontFixedPitch); } - inline void setFontStretch(qreal factor) + inline void setFontStretch(int factor) { setProperty(FontStretch, factor); } inline int fontStretch() const { return intProperty(FontStretch); } |