QLabel documentation: add warning about sanitizing input

make users more aware of QLabel guessing the text format.

Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
(cherry picked from commit 31f7ecbdcdbafbac5bbfa693e4d060757244941b)

Change-Id: I681c7daf568a6107b01908fa85d2da2a7e4e228a
Reviewed-on: http://codereview.qt.nokia.com/2817
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
bb10
Peter Hartmann 2011-08-02 16:09:24 +02:00 committed by Qt by Nokia
parent ca3120aa20
commit 661fcee779
1 changed files with 7 additions and 0 deletions

View File

@ -88,6 +88,13 @@ QT_BEGIN_NAMESPACE
by clear().
\endtable
\warning When passing a QString to the constructor or calling setText(),
make sure to sanitize your input, as QLabel tries to guess whether it
displays the text as plain text or as rich text. You may want to call
setTextFormat() explicitly, e.g. in case you expect the text to be in
plain format but cannot control the text source (for instance when
displaying data loaded from the Web).
When the content is changed using any of these functions, any
previous content is cleared.