summaryrefslogtreecommitdiffstats
path: root/src/corelib/text
Commit message (Collapse)AuthorAgeFilesLines
* QStringView: clean up storage_typeMarc Mutz2019-07-292-11/+3
| | | | | | | | | | | Now that all supported compilers support char16_t, we don't need the storage_type == wchar_t hack for MSVC anymore. Remove it. Adapt docs. Change-Id: I55df6c8a9fa5a9c7e6f53ba89f3850956b369061 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* qstringalgorithms.h: add pure, noexcept, constexprMarc Mutz2019-07-293-7/+8
| | | | | | | ... where they were missing. Change-Id: I58c32e57675b5d5ee500722933ef4a356a679e46 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QStringView: two fixes for newly-added toWCharArray()Marc Mutz2019-07-293-14/+16
| | | | | | | | | | | | | | | | | | | | Amends e89fbd8c3aa50a24e5fc02ab710ccca67fce98e2. - While QString::data() never returns nullptr, QStringView::data() may, which makes calling QStringView{}.toWCharArray() UB on Windows (since memcpy's 2nd argument must never be nullptr, even if the size is zero). Fix by protecting the memcpy call. - QStringView, by design, does not use out-of-line member functions, because calling these forces the QStringView object onto the stack. Fix by making inline. Also use the more efficient qToStringViewIgnoringNull(), as the result does not depend on QString::isNull() (no characters are written either way), and add a missing article to the function's docs. Change-Id: I5d6b31361522812b0db8303b93c43d4b9ed11933 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Tidy up some messy code in QLocaleEdward Welbourne2019-07-261-24/+8
| | | | | | | | It was using if/else with extraneous braces, where simple ternary operators will do. It was doing a StringView content check clumsily when mid() and startsWith() suffice. Change-Id: I693f29ce5b425d53469d2c756fe27459f36470e9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Split all the over-long lines in qlocale.cppEdward Welbourne2019-07-251-56/+110
| | | | | | | | | | There were many. Reflowed some documentation to 80 columns, split all code lines that exceeded 100 columns. Revised the splitting in a few cases that were inelegant or conflicted with our coding style. Added braces to some bodies of split control lines. Change-Id: I56eb9632f6399f0db1293477966f7d553f196a5b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Extend QString::arg(QString, ..., QString) to more than 9 argumentsMarc Mutz2019-07-242-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | Now that we have QStringView::arg(), we can use it to implement a similarly flexible QString::arg(). It's not as straight-forward as in QStringView, though: QString has existing arg() overloads that all become worse matches with the introduction of the new, perfectly-forwarding overload. So in order to allow calling of the other arg() functions, first constrain the new arg() function to arguments that are convertible to QString, QStringView, or QLatin1String, and then delegate to the QStringView version. To stay compatible with the previous overloads, which accepted anything that implicitly converts to QString (in particular, QStringBuilder expressions), add a new overload of qStringLikeToView, taking const QString &. This benefits the existing QStringView and QLatin1View versions, too. [ChangeLog][QtCore][QString] QString::arg(QString, ..., QString) can now be called with more than nine arguments, as well as with QStringViews. Change-Id: I1e717a1bc696346808bcae45dc47762a492c8714 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-171-4/+3
| | | | | | | | | | Conflicts: src/corelib/global/qlogging.cpp src/gui/painting/qtextureglyphcache_p.h src/gui/text/qfontengine.cpp src/widgets/widgets/qlineedit.cpp Change-Id: Ic8798538df466b7141caa8bbf1fb7605eb56be37
* Fix qdoublescanprint_p.h path in corelibTasuku Suzuki2019-07-151-1/+1
| | | | | | | | | | | The qdoublescanprint_p.h header moved from tools/ to text/ when text/ was introduced. Amends a9aa206b7b8ac4e69f8c46233b4080e00e845ff5. Change-Id: Ia7167fc3c4cdb05d4f2e56c0a0427a80e3cee362 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-121-2/+2
| | | | Change-Id: Icaabf08f9af539ddf844d96bc9c3a2d09408ba8a
* Move text-related code out of corelib/tools/ to corelib/text/Edward Welbourne2019-07-1062-0/+73651
This includes byte array, string, char, unicode, locale, collation and regular expressions. Change-Id: I8b125fa52c8c513eb57a0f1298b91910e5a0d786 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>