Skip to content

Commit

Permalink
QgsNumericFormatContext : use QString instead of QChar
Browse files Browse the repository at this point in the history
With Qt6, these methods return strings to be prepared
 for utf-16 surrogates
 Do we care? If yes, we need to switch all members of QgsNumericFormatContext to QString
  • Loading branch information
m-kuhn authored and nyalldawson committed Mar 26, 2021
1 parent 75e9f01 commit 514cd3a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/core/numericformats/qgsnumericformat.cpp
Expand Up @@ -23,13 +23,26 @@
QgsNumericFormatContext::QgsNumericFormatContext()
{
QLocale l;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
mThousandsSep = l.groupSeparator();
mDecimalSep = l.decimalPoint();
mPercent = l.percent();
mZeroDigit = l.zeroDigit();
mNegativeSign = l.negativeSign();
mPositiveSign = l.positiveSign();
mExponential = l.exponential();
#else
// With Qt6, these methods return strings to be prepared
// for utf-16 surrogates
// Do we care? If yes, we need to switch all members of QgsNumericFormatContext to QString
mThousandsSep = l.groupSeparator().at( 0 );
mDecimalSep = l.decimalPoint().at( 0 );
mPercent = l.percent().at( 0 );
mZeroDigit = l.zeroDigit().at( 0 );
mNegativeSign = l.negativeSign().at( 0 );
mPositiveSign = l.positiveSign().at( 0 );
mExponential = l.exponential().at( 0 );
#endif
}

int QgsNumericFormat::sortKey()
Expand Down

0 comments on commit 514cd3a

Please sign in to comment.