QString::front() was introduced in Qt 5.10.

This commit is contained in:
Roman Telezhynskyi 2023-02-21 09:57:49 +02:00
parent 647cee5e36
commit 647653a40a
2 changed files with 80 additions and 0 deletions

View File

@ -415,7 +415,11 @@ QChar LocaleSign0(const QLocale &locale)
const QString sign = locale.toString(0); const QString sign = locale.toString(0);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -431,7 +435,11 @@ QChar LocaleSign1(const QLocale &locale)
const QString sign = locale.toString(1); const QString sign = locale.toString(1);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -447,7 +455,11 @@ QChar LocaleSign2(const QLocale &locale)
const QString sign = locale.toString(2); const QString sign = locale.toString(2);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -463,7 +475,11 @@ QChar LocaleSign3(const QLocale &locale)
const QString sign = locale.toString(3); const QString sign = locale.toString(3);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -479,7 +495,11 @@ QChar LocaleSign4(const QLocale &locale)
const QString sign = locale.toString(4); const QString sign = locale.toString(4);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -495,7 +515,11 @@ QChar LocaleSign5(const QLocale &locale)
const QString sign = locale.toString(5); const QString sign = locale.toString(5);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -511,7 +535,11 @@ QChar LocaleSign6(const QLocale &locale)
const QString sign = locale.toString(6); const QString sign = locale.toString(6);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -527,7 +555,11 @@ QChar LocaleSign7(const QLocale &locale)
const QString sign = locale.toString(7); const QString sign = locale.toString(7);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -543,7 +575,11 @@ QChar LocaleSign8(const QLocale &locale)
const QString sign = locale.toString(8); const QString sign = locale.toString(8);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -559,7 +595,11 @@ QChar LocaleSign9(const QLocale &locale)
const QString sign = locale.toString(9); const QString sign = locale.toString(9);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)

View File

@ -69,7 +69,11 @@ auto VPELocaleSign0(const QLocale &locale) -> QChar
const QString sign = locale.toString(0); const QString sign = locale.toString(0);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -85,7 +89,11 @@ auto VPELocaleSign1(const QLocale &locale) -> QChar
const QString sign = locale.toString(1); const QString sign = locale.toString(1);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -101,7 +109,11 @@ auto VPELocaleSign2(const QLocale &locale) -> QChar
const QString sign = locale.toString(2); const QString sign = locale.toString(2);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -117,7 +129,11 @@ auto VPELocaleSign3(const QLocale &locale) -> QChar
const QString sign = locale.toString(3); const QString sign = locale.toString(3);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -133,7 +149,11 @@ auto VPELocaleSign4(const QLocale &locale) -> QChar
const QString sign = locale.toString(4); const QString sign = locale.toString(4);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -149,7 +169,11 @@ auto VPELocaleSign5(const QLocale &locale) -> QChar
const QString sign = locale.toString(5); const QString sign = locale.toString(5);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -165,7 +189,11 @@ auto VPELocaleSign6(const QLocale &locale) -> QChar
const QString sign = locale.toString(6); const QString sign = locale.toString(6);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -181,7 +209,11 @@ auto VPELocaleSign7(const QLocale &locale) -> QChar
const QString sign = locale.toString(7); const QString sign = locale.toString(7);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -197,7 +229,11 @@ auto VPELocaleSign8(const QLocale &locale) -> QChar
const QString sign = locale.toString(8); const QString sign = locale.toString(8);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -213,7 +249,11 @@ auto VPELocaleSign9(const QLocale &locale) -> QChar
const QString sign = locale.toString(9); const QString sign = locale.toString(9);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)