From 31f7ecbdcdbafbac5bbfa693e4d060757244941b Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 2 Aug 2011 16:09:24 +0200 Subject: QLabel documentation: add warning about sanitizing input make users more aware of QLabel guessing the text format. Reviewed-by: Gabriel de Dietrich --- src/gui/widgets/qlabel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp index 26dd0e1..7a94f42 100644 --- a/src/gui/widgets/qlabel.cpp +++ b/src/gui/widgets/qlabel.cpp @@ -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. -- cgit v0.12