diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-08-24 13:09:04 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-08-24 13:09:04 (GMT) |
commit | f58296de0d88f1b7f58efbabbb12a9e8afe6828c (patch) | |
tree | 436b343e8a749b3fcff47c8cab0ddcecc35cddf8 /src/gui/text/qstatictext.cpp | |
parent | acf678e57ed088f3e56a551cac6c7c3322005750 (diff) | |
parent | 7a5fa8af2d0c3329dd1962d6b053388a960f8305 (diff) | |
download | Qt-f58296de0d88f1b7f58efbabbb12a9e8afe6828c.zip Qt-f58296de0d88f1b7f58efbabbb12a9e8afe6828c.tar.gz Qt-f58296de0d88f1b7f58efbabbb12a9e8afe6828c.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
Diffstat (limited to 'src/gui/text/qstatictext.cpp')
-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 |