diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-08-09 09:49:43 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-08-09 09:59:42 (GMT) |
commit | 4f2f48caae2ae18336bff10bb1e1ab07f2dd4650 (patch) | |
tree | 9900aae619015e08984b1771949fbfe8e75c2acc /src/gui | |
parent | c5fa9eb1cb02d979502e2c9918d752c6708fb406 (diff) | |
download | Qt-4f2f48caae2ae18336bff10bb1e1ab07f2dd4650.zip Qt-4f2f48caae2ae18336bff10bb1e1ab07f2dd4650.tar.gz Qt-4f2f48caae2ae18336bff10bb1e1ab07f2dd4650.tar.bz2 |
doc: Clarify documentation of QStaticText
There has been some confusion concerning what HTML tags can be used
when using the rich text format with QStaticText. This patch attempts
to make it clearer in the documentation that the tags have to be text
related.
Reviewed-by: Samuel
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qstatictext.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp index 7396bcd..21c2e02 100644 --- a/src/gui/text/qstatictext.cpp +++ b/src/gui/text/qstatictext.cpp @@ -109,10 +109,18 @@ QT_BEGIN_NAMESPACE QPainter::drawStaticText() and can change from call to call with a minimal impact on performance. - QStaticText will attempt to guess the format of the input text using Qt::mightBeRichText(). - To force QStaticText to display its contents as either plain text or rich text, use the - function QStaticText::setTextFormat() and pass in, respectively, Qt::PlainText and - Qt::RichText. + For extra convenience, it is possible to apply formatting to the text using the HTML subset + supported by QTextDocument. QStaticText will attempt to guess the format of the input text using + Qt::mightBeRichText(), and interpret it as rich text if this function returns true. To force + QStaticText to display its contents as either plain text or rich text, use the function + QStaticText::setTextFormat() and pass in, respectively, Qt::PlainText and Qt::RichText. + + QStaticText can only represent text, so only HTML tags which alter the layout or appearance of + the text will be respected. Adding an image to the input HTML, for instance, will cause the + image to be included as part of the layout, affecting the positions of the text glyphs, but it + will not be displayed. The result will be an empty area the size of the image in the output. + Similarly, using tables will cause the text to be laid out in table format, but the borders + will not be drawn. If it's the first time the static text is drawn, or if the static text, or the painter's font has been altered since the last time it was drawn, the text's layout has to be |