Skip to content
Permalink
Browse files

QgsNumericFormatContext : use QString instead of QChar

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 514cd3af139e4a469d4fd4316e1088eab7b50d3f
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/core/numericformats/qgsnumericformat.cpp
@@ -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()

0 comments on commit 514cd3a

Please sign in to comment.