[docs] QLatin1String: add some guidance as to when to use it

Change-Id: I391be8bda3a5cb4873b89b437d2b76b1cd88261f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
This commit is contained in:
Marc Mutz 2015-10-18 16:42:49 +02:00 committed by Mitch Curtis
parent 101a6bda45
commit 5a2d0cf5fe

View File

@ -8222,6 +8222,13 @@ QString &QString::setRawData(const QChar *unicode, int size)
\snippet code/src_corelib_tools_qstring.cpp 6
\note If the function you're calling with a QLatin1String
argument isn't actually overloaded to take QLatin1String, the
implicit conversion to QString will trigger a memory allocation,
which is usually what you want to avoid by using QLatin1String
in the first place. In those cases, using QStringLiteral may be
the better option.
\sa QString, QLatin1Char, {QStringLiteral()}{QStringLiteral}
*/