21 : mLowerValue( range.lowerBound() )
22 , mUpperValue( range.upperBound() )
24 , mLabel( range.label() )
30 : mLowerValue( lowerValue )
31 , mUpperValue( upperValue )
38 : mLowerValue( range.mLowerValue )
39 , mUpperValue( range.mUpperValue )
40 , mSymbol( range.mSymbol ? range.mSymbol->clone() : nullptr )
41 , mLabel( range.mLabel )
42 , mRender( range.mRender )
125 if ( !
mSymbol || props.value( QStringLiteral(
"attribute" ), QString() ).isEmpty() )
128 QString attrName = props[ QStringLiteral(
"attribute" )];
130 QDomElement ruleElem = doc.createElement( QStringLiteral(
"se:Rule" ) );
131 element.appendChild( ruleElem );
133 QDomElement nameElem = doc.createElement( QStringLiteral(
"se:Name" ) );
134 nameElem.appendChild( doc.createTextNode(
mLabel ) );
135 ruleElem.appendChild( nameElem );
137 QDomElement descrElem = doc.createElement( QStringLiteral(
"se:Description" ) );
138 QDomElement titleElem = doc.createElement( QStringLiteral(
"se:Title" ) );
140 titleElem.appendChild( doc.createTextNode( !
mLabel.isEmpty() ?
mLabel : descrStr ) );
141 descrElem.appendChild( titleElem );
142 ruleElem.appendChild( descrElem );
145 QString filterFunc = QStringLiteral(
"\"%1\" %2 %3 AND \"%1\" <= %4" )
146 .arg( attrName.replace(
'\"', QLatin1String(
"\"\"" ) ),
147 firstRange ? QStringLiteral(
">=" ) : QStringLiteral(
">" ),
152 mSymbol->toSld( doc, ruleElem, props );
162 : mFormat( QStringLiteral(
"%1 - %2" ) )
163 , mReTrailingZeroes(
"[.,]?0*$" )
164 , mReNegativeZero(
"^\\-0(?:[.,]0*)?$" )
169 : mReTrailingZeroes(
"[.,]?0*$" )
170 , mReNegativeZero(
"^\\-0(?:[.,]0*)?$" )
188 return !( *
this == other );
215 QString valueStr = QLocale().toString( value,
'f',
mPrecision );
219 valueStr = valueStr.mid( 1 );
224 QString valueStr = QLocale().toString( value *
mNumberScale,
'f', 0 );
225 if ( valueStr == QLatin1String(
"-0" ) )
227 if ( valueStr != QLatin1String(
"0" ) )
239 return legend.replace( QLatin1String(
"%1" ), lowerStr ).replace( QLatin1String(
"%2" ), upperStr );
244 mFormat = element.attribute( QStringLiteral(
"format" ),
245 element.attribute( QStringLiteral(
"prefix" ), QStringLiteral(
" " ) ) +
"%1" +
246 element.attribute( QStringLiteral(
"separator" ), QStringLiteral(
" - " ) ) +
"%2" +
247 element.attribute( QStringLiteral(
"suffix" ), QStringLiteral(
" " ) )
249 setPrecision( element.attribute( QStringLiteral(
"decimalplaces" ), QStringLiteral(
"4" ) ).toInt() );
250 mTrimTrailingZeroes = element.attribute( QStringLiteral(
"trimtrailingzeroes" ), QStringLiteral(
"false" ) ) == QLatin1String(
"true" );
255 element.setAttribute( QStringLiteral(
"format" ),
mFormat );
256 element.setAttribute( QStringLiteral(
"decimalplaces" ),
mPrecision );
257 element.setAttribute( QStringLiteral(
"trimtrailingzeroes" ),
mTrimTrailingZeroes ? QStringLiteral(
"true" ) : QStringLiteral(
"false" ) );