diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2010-04-12 04:19:36 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2010-04-12 04:46:15 (GMT) |
commit | b3854b33242b0ce38d194cebb2d3a86b85e0df4b (patch) | |
tree | 854063d04f5476d75049a1f8b18f5adddd6eeec2 /src/declarative/graphicsitems/qdeclarativetext.cpp | |
parent | 87db39b013658bcd262d52f6f9e04934991d6ad1 (diff) | |
download | Qt-b3854b33242b0ce38d194cebb2d3a86b85e0df4b.zip Qt-b3854b33242b0ce38d194cebb2d3a86b85e0df4b.tar.gz Qt-b3854b33242b0ce38d194cebb2d3a86b85e0df4b.tar.bz2 |
Improve font value type documentation.
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetext.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetext.cpp | 112 |
1 files changed, 110 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 69e3543..f31f5aa 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -122,14 +122,116 @@ QDeclarativeTextPrivate::~QDeclarativeTextPrivate() /*! \qmlproperty string Text::font.family + + Sets the family name of the font. + + The family name is case insensitive and may optionally include a foundry name, e.g. "Helvetica [Cronyx]". + If the family is available from more than one foundry and the foundry isn't specified, an arbitrary foundry is chosen. + If the family isn't available a family will be set using the font matching algorithm. +*/ + +/*! \qmlproperty bool Text::font.bold + + Sets the font's weight to bold. +*/ + +/*! + \qmlproperty enumeration Text::font.weight + + Sets the font's weight. + + The weight can be one of: + \list + \o Light + \o Normal - the default + \o DemiBold + \o Bold + \o Black + \endlist + + \qml + Text { text: "Hello"; font.weight: Font.DemiBold } + \endqml +*/ + +/*! \qmlproperty bool Text::font.italic + + Sets the style of the text to italic. +*/ + +/*! \qmlproperty bool Text::font.underline + + Set the style of the text to underline. +*/ + +/*! + \qmlproperty bool Text::font.outline + + Set the style of the text to outline. +*/ + +/*! + \qmlproperty bool Text::font.strikeout + + Set the style of the text to strikeout. +*/ + +/*! \qmlproperty real Text::font.pointSize + + Sets the font size in points. The point size must be greater than zero. +*/ + +/*! \qmlproperty int Text::font.pixelSize - Set the Text's font attributes. + Sets the font size in pixels. + + Using this function makes the font device dependent. + Use \c pointSize to set the size of the font in a device independent manner. */ + +/*! + \qmlproperty real Text::font.letterSpacing + + Sets the letter spacing for the font. + + Letter spacing changes the default spacing between individual letters in the font. + A value of 100 will keep the spacing unchanged; a value of 200 will enlarge the spacing after a character by + the width of the character itself. +*/ + +/*! + \qmlproperty real Text::font.wordSpacing + + Sets the word spacing for the font. + + Word spacing changes the default spacing between individual words. + A positive value increases the word spacing by a corresponding amount of pixels, + while a negative value decreases the inter-word spacing accordingly. +*/ + +/*! + \qmlproperty enumeration Text::font.capitalization + + Sets the capitalization for the text. + + \list + \o MixedCase - This is the normal text rendering option where no capitalization change is applied. + \o AllUppercase - This alters the text to be rendered in all uppercase type. + \o AllLowercase - This alters the text to be rendered in all lowercase type. + \o SmallCaps - This alters the text to be rendered in small-caps type. + \o Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character. + \endlist + + \qml + Text { text: "Hello"; font.capitalization: Font.AllLowercase } + \endqml +*/ + QFont QDeclarativeText::font() const { Q_D(const QDeclarativeText); @@ -458,7 +560,13 @@ void QDeclarativeText::setTextFormat(TextFormat format) This property cannot be used with wrapping enabled or with rich text. - Eliding can be \c ElideNone (the default), \c ElideLeft, \c ElideMiddle, or \c ElideRight. + Eliding can be: + \list + \o ElideNone - the default + \o ElideLeft + \o ElideMiddle + \o ElideRight + \endlist If the text is a multi-length string, and the mode is not \c ElideNone, the first string that fits will be used, otherwise the last will be elided. |