diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-01-31 01:04:45 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-04-12 11:12:04 +0000 |
commit | d68c162c1b90e9e5a3d9dd4b035663ba57d3391b (patch) | |
tree | e070d4e414c3c92c0857307c70feea8c2083ed9a /src/corelib/tools/qlocale_mac.mm | |
parent | 9c243d26373ba6ae3f94b21bd52b12b59140cfc3 (diff) |
QLocale: add toString(Q(Date|QTime)+, QStringView format) overloads
While at it, change the interface of qt_repeatCount() to just take
a single QStringView, since QStringView::mid() is so cheap. Add some
\internal docs.
[ChangeLog][QtCore][QLocale] Added toString(QDate/QTime/QDateTime)
overloads taking the format string as a QStringView.
Change-Id: Ic078796677a6db06227c8a3e276dbdb1039ceead
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/tools/qlocale_mac.mm')
-rw-r--r-- | src/corelib/tools/qlocale_mac.mm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm index c5519bfabf..edbaaf5d18 100644 --- a/src/corelib/tools/qlocale_mac.mm +++ b/src/corelib/tools/qlocale_mac.mm @@ -150,7 +150,7 @@ static QString macTimeToString(const QTime &time, bool short_format) // See also qtbase/util/local_database/dateconverter.py // Makes the assumption that input formats are always well formed and consecutive letters // never exceed the maximum for the format code. -static QString macToQtFormat(const QString &sys_fmt) +static QString macToQtFormat(QStringView sys_fmt) { QString result; int i = 0; @@ -166,7 +166,7 @@ static QString macToQtFormat(const QString &sys_fmt) } QChar c = sys_fmt.at(i); - int repeat = qt_repeatCount(sys_fmt, i); + int repeat = qt_repeatCount(sys_fmt.mid(i)); switch (c.unicode()) { // Qt does not support the following options |