diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2012-01-31 18:31:58 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-14 15:25:37 +0100 |
commit | 5d593da3d31a0c6adffb449db3ceb65328b87cd6 (patch) | |
tree | 9ceedd7af91e7fcdf60d91e9d3af8f0ad8fa74fd /dist | |
parent | 75286739de854d761bbfcababa50d1bc6dfda12a (diff) |
Remove constructors taking implicit string sizes
Constructors taking explicit sizes got a default -1 size argument that
triggers length calculation from nul-terminated strings.
This imposes a slight change in behavior: negative size arguments would
previously be ignored and generate an empty string whereas with this
patch we expect to see a nul-terminated string.
On the other hand, keeping the previous behavior could effectively hide
errors in user code and I can't find a good reason to support it.
Documentation for the constructors was updated and made more consistent
between the classes.
Change-Id: I738ac3298cffe3221c8a56e85ba2102623e7b67d
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'dist')
-rw-r--r-- | dist/changes-5.0.0 | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/dist/changes-5.0.0 b/dist/changes-5.0.0 index fc5bebd11d..e73ecc50ee 100644 --- a/dist/changes-5.0.0 +++ b/dist/changes-5.0.0 @@ -36,6 +36,13 @@ information about a particular change. - QCoreApplication::translate() will no longer return the source text when the translation is empty. Use lrelease -removeidentical for optimization. +- QString and QByteArray constructors that take a size argument will now treat + negative sizes to indicate nul-terminated strings (a nul-terminated array of + QChar, in the case of QString). In Qt 4, negative sizes were ignored and + result in empty QString and QByteArray, respectively. The size argument to + those constructors now has a default value of -1, thus replacing the separate + constructors that did the same. + - Qt::escape() is deprecated (but can be enabled via QT_DISABLE_DEPRECATED_BEFORE), use QString::toHtmlEscaped() instead. |