diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-08-06 12:16:10 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-08-11 22:32:42 +0200 |
commit | 54b1ed6798d890cb290846ad57767b016ecb2f2f (patch) | |
tree | e1c07610f7f43a8a27a06180d5ee585cac692f67 /src/corelib | |
parent | 6f833eff92fe703a13214a0c1a593d94e51847d1 (diff) |
qlocale_win: return null QVariant on failed look-ups
Various functions were still returning a null QString wrapped as a
QVariant; the caller distinguishes these cases, so should get a null
QVariant so it knows the backend failed to answer the query and can
attempt whatever fall-back it may have at its disposal.
Pick-to: 6.2
Change-Id: I0983b9f3b1026f17c3f13ab92b713bee90be466c
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/text/qlocale_win.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/text/qlocale_win.cpp b/src/corelib/text/qlocale_win.cpp index a73656440f..38f04d686d 100644 --- a/src/corelib/text/qlocale_win.cpp +++ b/src/corelib/text/qlocale_win.cpp @@ -328,7 +328,7 @@ QVariant QSystemLocalePrivate::timeFormat(QLocale::FormatType type) case QLocale::NarrowFormat: break; } - return QVariant(); + return {}; } QVariant QSystemLocalePrivate::dateTimeFormat(QLocale::FormatType type) @@ -382,7 +382,7 @@ QVariant QSystemLocalePrivate::monthName(int month, QLocale::FormatType type) month -= 1; if (month < 0 || month > 11) - return QString(); + return {}; LCTYPE lctype = (type == QLocale::ShortFormat || type == QLocale::NarrowFormat) ? short_month_map[month] : long_month_map[month]; @@ -404,7 +404,7 @@ QVariant QSystemLocalePrivate::toString(QDate date, QLocale::FormatType type) text = substituteDigits(std::move(text)); return text; } - return QString(); + return {}; } QVariant QSystemLocalePrivate::toString(QTime time, QLocale::FormatType type) @@ -427,7 +427,7 @@ QVariant QSystemLocalePrivate::toString(QTime time, QLocale::FormatType type) text = substituteDigits(std::move(text)); return text; } - return QString(); + return {}; } QVariant QSystemLocalePrivate::toString(const QDateTime &dt, QLocale::FormatType type) |