149 QDomElement propsElem = pft->
dom().firstChildElement( QStringLiteral(
"qgis" ) ).toElement().firstChildElement( QStringLiteral(
"properties" ) );
150 if ( !propsElem.isNull() )
152 const QDomNodeList srsNodes = propsElem.elementsByTagName( QStringLiteral(
"SpatialRefSys" ) );
154 QDomElement projElem;
155 if ( srsNodes.count() > 0 )
157 srsElem = srsNodes.at( 0 ).toElement();
158 const QDomNodeList projNodes = srsElem.elementsByTagName( QStringLiteral(
"ProjectionsEnabled" ) );
159 if ( projNodes.count() == 0 )
161 projElem = pft->
dom().createElement( QStringLiteral(
"ProjectionsEnabled" ) );
162 projElem.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"int" ) );
163 const QDomText projText = pft->
dom().createTextNode( QStringLiteral(
"0" ) );
164 projElem.appendChild( projText );
165 srsElem.appendChild( projElem );
170 srsElem = pft->
dom().createElement( QStringLiteral(
"SpatialRefSys" ) );
171 projElem = pft->
dom().createElement( QStringLiteral(
"ProjectionsEnabled" ) );
172 projElem.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"int" ) );
173 const QDomText projText = pft->
dom().createTextNode( QStringLiteral(
"0" ) );
174 projElem.appendChild( projText );
175 srsElem.appendChild( projElem );
176 propsElem.appendChild( srsElem );
182 const QDomNodeList canvasNodes = pft->
dom().elementsByTagName( QStringLiteral(
"mapcanvas" ) );
183 if ( canvasNodes.count() > 0 )
185 const QDomElement canvasElem = canvasNodes.at( 0 ).toElement();
186 const QDomNodeList canvasSrsNodes = canvasElem.elementsByTagName( QStringLiteral(
"spatialrefsys" ) );
187 if ( canvasSrsNodes.count() > 0 )
189 const QDomElement canvasSrsElem = canvasSrsNodes.at( 0 ).toElement();
194 const QDomNodeList proj4Nodes = canvasSrsElem.elementsByTagName( QStringLiteral(
"proj4" ) );
195 if ( proj4Nodes.count() > 0 )
197 const QDomElement proj4Node = proj4Nodes.at( 0 ).toElement();
198 proj = proj4Node.text();
200 const QDomNodeList authidNodes = canvasSrsElem.elementsByTagName( QStringLiteral(
"authid" ) );
201 if ( authidNodes.count() > 0 )
203 const QDomElement authidNode = authidNodes.at( 0 ).toElement();
204 authid = authidNode.text();
206 const QDomNodeList srsidNodes = canvasSrsElem.elementsByTagName( QStringLiteral(
"srsid" ) );
207 if ( srsidNodes.count() > 0 )
209 const QDomElement srsidNode = srsidNodes.at( 0 ).toElement();
210 srsid = srsidNode.text();
214 const QDomNodeList oldProjectProj4Nodes = srsElem.elementsByTagName( QStringLiteral(
"ProjectCRSProj4String" ) );
215 for (
int i = oldProjectProj4Nodes.count(); i >= 0; --i )
217 srsElem.removeChild( oldProjectProj4Nodes.at( i ) );
219 const QDomNodeList oldProjectCrsNodes = srsElem.elementsByTagName( QStringLiteral(
"ProjectCrs" ) );
220 for (
int i = oldProjectCrsNodes.count(); i >= 0; --i )
222 srsElem.removeChild( oldProjectCrsNodes.at( i ) );
224 const QDomNodeList oldProjectCrsIdNodes = srsElem.elementsByTagName( QStringLiteral(
"ProjectCRSID" ) );
225 for (
int i = oldProjectCrsIdNodes.count(); i >= 0; --i )
227 srsElem.removeChild( oldProjectCrsIdNodes.at( i ) );
229 const QDomNodeList projectionsEnabledNodes = srsElem.elementsByTagName( QStringLiteral(
"ProjectionsEnabled" ) );
230 for (
int i = projectionsEnabledNodes.count(); i >= 0; --i )
232 srsElem.removeChild( projectionsEnabledNodes.at( i ) );
235 QDomElement proj4Elem = pft->
dom().createElement( QStringLiteral(
"ProjectCRSProj4String" ) );
236 proj4Elem.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"QString" ) );
237 const QDomText proj4Text = pft->
dom().createTextNode( proj );
238 proj4Elem.appendChild( proj4Text );
239 QDomElement projectCrsElem = pft->
dom().createElement( QStringLiteral(
"ProjectCrs" ) );
240 projectCrsElem.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"QString" ) );
241 const QDomText projectCrsText = pft->
dom().createTextNode( authid );
242 projectCrsElem.appendChild( projectCrsText );
243 QDomElement projectCrsIdElem = pft->
dom().createElement( QStringLiteral(
"ProjectCRSID" ) );
244 projectCrsIdElem.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"int" ) );
245 const QDomText srsidText = pft->
dom().createTextNode( srsid );
246 projectCrsIdElem.appendChild( srsidText );
247 QDomElement projectionsEnabledElem = pft->
dom().createElement( QStringLiteral(
"ProjectionsEnabled" ) );
248 projectionsEnabledElem.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"int" ) );
249 const QDomText projectionsEnabledText = pft->
dom().createTextNode( QStringLiteral(
"1" ) );
250 projectionsEnabledElem.appendChild( projectionsEnabledText );
251 srsElem.appendChild( proj4Elem );
252 srsElem.appendChild( projectCrsElem );
253 srsElem.appendChild( projectCrsIdElem );
254 srsElem.appendChild( projectionsEnabledElem );
256 const QDomNodeList srsNodes = propsElem.elementsByTagName( QStringLiteral(
"SpatialRefSys" ) );
257 for (
int i = srsNodes.count(); i >= 0; --i )
259 propsElem.removeChild( srsNodes.at( i ) );
261 propsElem.appendChild( srsElem );
267 const QDomNodeList mapLayers = pft->
dom().elementsByTagName( QStringLiteral(
"maplayer" ) );
269 for (
int mapLayerIndex = 0; mapLayerIndex < mapLayers.count(); ++mapLayerIndex )
271 QDomElement layerElem = mapLayers.at( mapLayerIndex ).toElement();
274 QDomElement fieldConfigurationElement = pft->
dom().createElement( QStringLiteral(
"fieldConfiguration" ) );
275 layerElem.appendChild( fieldConfigurationElement );
277 const QDomNodeList editTypeNodes = layerElem.namedItem( QStringLiteral(
"edittypes" ) ).childNodes();
278 QDomElement constraintExpressionsElem = pft->
dom().createElement( QStringLiteral(
"constraintExpressions" ) );
279 layerElem.appendChild( constraintExpressionsElem );
281 for (
int i = 0; i < editTypeNodes.size(); ++i )
283 const QDomNode editTypeNode = editTypeNodes.at( i );
284 const QDomElement editTypeElement = editTypeNode.toElement();
286 QDomElement fieldElement = pft->
dom().createElement( QStringLiteral(
"field" ) );
287 fieldConfigurationElement.appendChild( fieldElement );
289 const QString name = editTypeElement.attribute( QStringLiteral(
"name" ) );
290 fieldElement.setAttribute( QStringLiteral(
"name" ), name );
291 QDomElement constraintExpressionElem = pft->
dom().createElement( QStringLiteral(
"constraint" ) );
292 constraintExpressionElem.setAttribute( QStringLiteral(
"field" ), name );
293 constraintExpressionsElem.appendChild( constraintExpressionElem );
295 QDomElement editWidgetElement = pft->
dom().createElement( QStringLiteral(
"editWidget" ) );
296 fieldElement.appendChild( editWidgetElement );
298 const QString ewv2Type = editTypeElement.attribute( QStringLiteral(
"widgetv2type" ) );
299 editWidgetElement.setAttribute( QStringLiteral(
"type" ), ewv2Type );
301 const QDomElement ewv2CfgElem = editTypeElement.namedItem( QStringLiteral(
"widgetv2config" ) ).toElement();
303 if ( !ewv2CfgElem.isNull() )
305 QDomElement editWidgetConfigElement = pft->
dom().createElement( QStringLiteral(
"config" ) );
306 editWidgetElement.appendChild( editWidgetConfigElement );
308 QVariantMap editWidgetConfiguration;
310 const QDomNamedNodeMap configAttrs = ewv2CfgElem.attributes();
311 for (
int configIndex = 0; configIndex < configAttrs.count(); ++configIndex )
313 const QDomAttr configAttr = configAttrs.item( configIndex ).toAttr();
314 if ( configAttr.name() == QLatin1String(
"fieldEditable" ) )
316 editWidgetConfigElement.setAttribute( QStringLiteral(
"fieldEditable" ), configAttr.value() );
318 else if ( configAttr.name() == QLatin1String(
"labelOnTop" ) )
320 editWidgetConfigElement.setAttribute( QStringLiteral(
"labelOnTop" ), configAttr.value() );
322 else if ( configAttr.name() == QLatin1String(
"notNull" ) )
324 editWidgetConfigElement.setAttribute( QStringLiteral(
"notNull" ), configAttr.value() );
326 else if ( configAttr.name() == QLatin1String(
"constraint" ) )
328 constraintExpressionElem.setAttribute( QStringLiteral(
"exp" ), configAttr.value() );
330 else if ( configAttr.name() == QLatin1String(
"constraintDescription" ) )
332 constraintExpressionElem.setAttribute( QStringLiteral(
"desc" ), configAttr.value() );
336 editWidgetConfiguration.insert( configAttr.name(), configAttr.value() );
340 if ( ewv2Type == QLatin1String(
"ValueMap" ) )
342 const QDomNodeList configElements = ewv2CfgElem.childNodes();
344 for (
int configIndex = 0; configIndex < configElements.count(); ++configIndex )
346 const QDomElement configElem = configElements.at( configIndex ).toElement();
347 map.insert( configElem.attribute( QStringLiteral(
"key" ) ), configElem.attribute( QStringLiteral(
"value" ) ) );
349 editWidgetConfiguration.insert( QStringLiteral(
"map" ), map );
351 else if ( ewv2Type == QLatin1String(
"Photo" ) )
353 editWidgetElement.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"ExternalResource" ) );
355 editWidgetConfiguration.insert( QStringLiteral(
"DocumentViewer" ), 1 );
356 editWidgetConfiguration.insert( QStringLiteral(
"DocumentViewerHeight" ), editWidgetConfiguration.value( QStringLiteral(
"Height" ) ) );
357 editWidgetConfiguration.insert( QStringLiteral(
"DocumentViewerWidth" ), editWidgetConfiguration.value( QStringLiteral(
"Width" ) ) );
358 editWidgetConfiguration.insert( QStringLiteral(
"RelativeStorage" ), 1 );
360 else if ( ewv2Type == QLatin1String(
"FileName" ) )
362 editWidgetElement.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"ExternalResource" ) );
364 editWidgetConfiguration.insert( QStringLiteral(
"RelativeStorage" ), 1 );
366 else if ( ewv2Type == QLatin1String(
"WebView" ) )
368 editWidgetElement.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"ExternalResource" ) );
370 editWidgetConfiguration.insert( QStringLiteral(
"DocumentViewerHeight" ), editWidgetConfiguration.value( QStringLiteral(
"Height" ) ) );
371 editWidgetConfiguration.insert( QStringLiteral(
"DocumentViewerWidth" ), editWidgetConfiguration.value( QStringLiteral(
"Width" ) ) );
372 editWidgetConfiguration.insert( QStringLiteral(
"RelativeStorage" ), 1 );
386 const QDomNode noDataNode = rasterPropertiesElem.namedItem( QStringLiteral(
"mNoDataValue" ) );
387 const QDomElement noDataElement = noDataNode.toElement();
388 if ( !noDataElement.text().isEmpty() )
391 QDomElement noDataElem = doc.createElement( QStringLiteral(
"noData" ) );
393 QDomElement noDataRangeList = doc.createElement( QStringLiteral(
"noDataRangeList" ) );
394 noDataRangeList.setAttribute( QStringLiteral(
"bandNo" ), 1 );
396 QDomElement noDataRange = doc.createElement( QStringLiteral(
"noDataRange" ) );
397 noDataRange.setAttribute( QStringLiteral(
"min" ), noDataElement.text() );
398 noDataRange.setAttribute( QStringLiteral(
"max" ), noDataElement.text() );
399 noDataRangeList.appendChild( noDataRange );
401 noDataElem.appendChild( noDataRangeList );
403 parentNode.appendChild( noDataElem );
406 QDomElement rasterRendererElem = doc.createElement( QStringLiteral(
"rasterrenderer" ) );
410 rasterRendererElem.setAttribute( QStringLiteral(
"invertColor" ), QStringLiteral(
"0" ) );
411 const QDomElement invertColorElem = rasterPropertiesElem.firstChildElement( QStringLiteral(
"mInvertColor" ) );
412 if ( !invertColorElem.isNull() )
414 if ( invertColorElem.text() == QLatin1String(
"true" ) )
416 rasterRendererElem.setAttribute( QStringLiteral(
"invertColor" ), QStringLiteral(
"1" ) );
421 rasterRendererElem.setAttribute( QStringLiteral(
"opacity" ), QStringLiteral(
"1" ) );
422 const QDomElement transparencyElem = parentNode.firstChildElement( QStringLiteral(
"transparencyLevelInt" ) );
423 if ( !transparencyElem.isNull() )
425 const double transparency = transparencyElem.text().toInt();
426 rasterRendererElem.setAttribute( QStringLiteral(
"opacity" ), QString::number( transparency / 255.0 ) );
430 rasterRendererElem.setAttribute( QStringLiteral(
"alphaBand" ), -1 );
433 const int grayBand =
rasterBandNumber( rasterPropertiesElem, QStringLiteral(
"mGrayBandName" ), rlayer );
436 QString drawingStyle = rasterPropertiesElem.firstChildElement( QStringLiteral(
"mDrawingStyle" ) ).text();
443 if ( drawingStyle == QLatin1String(
"PalettedColor" ) )
445 const QDomElement customColorRampElem = rasterPropertiesElem.firstChildElement( QStringLiteral(
"customColorRamp" ) );
446 const QDomNodeList colorRampEntryList = customColorRampElem.elementsByTagName( QStringLiteral(
"colorRampEntry" ) );
448 for (
int i = 0; i < colorRampEntryList.size(); ++i )
450 const QDomElement colorRampEntryElem = colorRampEntryList.at( i ).toElement();
451 const QString strValue = colorRampEntryElem.attribute( QStringLiteral(
"value" ) );
452 const double value = strValue.toDouble();
453 if ( value < 0 || value > 10000 || !
qgsDoubleNear( value,
static_cast< int >( value ) ) )
455 QgsDebugMsgLevel( QStringLiteral(
"forcing SingleBandPseudoColor value = %1" ).arg( value ), 2 );
456 drawingStyle = QStringLiteral(
"SingleBandPseudoColor" );
462 if ( drawingStyle == QLatin1String(
"SingleBandGray" ) )
464 rasterRendererElem.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"singlebandgray" ) );
465 rasterRendererElem.setAttribute( QStringLiteral(
"grayBand" ), grayBand );
468 else if ( drawingStyle == QLatin1String(
"SingleBandPseudoColor" ) )
470 rasterRendererElem.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"singlebandpseudocolor" ) );
471 rasterRendererElem.setAttribute( QStringLiteral(
"band" ), grayBand );
472 QDomElement newRasterShaderElem = doc.createElement( QStringLiteral(
"rastershader" ) );
473 QDomElement newColorRampShaderElem = doc.createElement( QStringLiteral(
"colorrampshader" ) );
474 newRasterShaderElem.appendChild( newColorRampShaderElem );
475 rasterRendererElem.appendChild( newRasterShaderElem );
478 const QString colorShadingAlgorithm = rasterPropertiesElem.firstChildElement( QStringLiteral(
"mColorShadingAlgorithm" ) ).text();
479 if ( colorShadingAlgorithm == QLatin1String(
"PseudoColorShader" ) || colorShadingAlgorithm == QLatin1String(
"FreakOutShader" ) )
481 newColorRampShaderElem.setAttribute( QStringLiteral(
"colorRampType" ), QStringLiteral(
"INTERPOLATED" ) );
487 const double breakSize = ( maxValue - minValue ) / 3;
489 QStringList colorList;
490 if ( colorShadingAlgorithm == QLatin1String(
"FreakOutShader" ) )
492 colorList << QStringLiteral(
"#ff00ff" ) << QStringLiteral(
"#00ffff" ) << QStringLiteral(
"#ff0000" ) << QStringLiteral(
"#00ff00" );
496 colorList << QStringLiteral(
"#0000ff" ) << QStringLiteral(
"#00ffff" ) << QStringLiteral(
"#ffff00" ) << QStringLiteral(
"#ff0000" );
498 QStringList::const_iterator colorIt = colorList.constBegin();
499 double boundValue = minValue;
500 for ( ; colorIt != colorList.constEnd(); ++colorIt )
502 QDomElement newItemElem = doc.createElement( QStringLiteral(
"item" ) );
503 newItemElem.setAttribute( QStringLiteral(
"value" ), QString::number( boundValue ) );
504 newItemElem.setAttribute( QStringLiteral(
"label" ), QString::number( boundValue ) );
505 newItemElem.setAttribute( QStringLiteral(
"color" ), *colorIt );
506 newColorRampShaderElem.appendChild( newItemElem );
507 boundValue += breakSize;
510 else if ( colorShadingAlgorithm == QLatin1String(
"ColorRampShader" ) )
512 const QDomElement customColorRampElem = rasterPropertiesElem.firstChildElement( QStringLiteral(
"customColorRamp" ) );
513 const QString type = customColorRampElem.firstChildElement( QStringLiteral(
"colorRampType" ) ).text();
514 newColorRampShaderElem.setAttribute( QStringLiteral(
"colorRampType" ), type );
515 const QDomNodeList colorNodeList = customColorRampElem.elementsByTagName( QStringLiteral(
"colorRampEntry" ) );
517 QString value, label;
519 int red, green, blue;
520 QDomElement currentItemElem;
521 for (
int i = 0; i < colorNodeList.size(); ++i )
523 currentItemElem = colorNodeList.at( i ).toElement();
524 value = currentItemElem.attribute( QStringLiteral(
"value" ) );
525 label = currentItemElem.attribute( QStringLiteral(
"label" ) );
526 red = currentItemElem.attribute( QStringLiteral(
"red" ) ).toInt();
527 green = currentItemElem.attribute( QStringLiteral(
"green" ) ).toInt();
528 blue = currentItemElem.attribute( QStringLiteral(
"blue" ) ).toInt();
529 newColor = QColor( red, green, blue );
530 QDomElement newItemElem = doc.createElement( QStringLiteral(
"item" ) );
531 newItemElem.setAttribute( QStringLiteral(
"value" ), value );
532 newItemElem.setAttribute( QStringLiteral(
"label" ), label );
533 newItemElem.setAttribute( QStringLiteral(
"color" ), newColor.name() );
534 newColorRampShaderElem.appendChild( newItemElem );
538 else if ( drawingStyle == QLatin1String(
"PalettedColor" ) )
540 rasterRendererElem.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"paletted" ) );
541 rasterRendererElem.setAttribute( QStringLiteral(
"band" ), grayBand );
542 const QDomElement customColorRampElem = rasterPropertiesElem.firstChildElement( QStringLiteral(
"customColorRamp" ) );
543 const QDomNodeList colorRampEntryList = customColorRampElem.elementsByTagName( QStringLiteral(
"colorRampEntry" ) );
544 QDomElement newColorPaletteElem = doc.createElement( QStringLiteral(
"colorPalette" ) );
550 QDomElement colorRampEntryElem;
551 for (
int i = 0; i < colorRampEntryList.size(); ++i )
553 colorRampEntryElem = colorRampEntryList.at( i ).toElement();
554 QDomElement newPaletteElem = doc.createElement( QStringLiteral(
"paletteEntry" ) );
555 value =
static_cast< int >( colorRampEntryElem.attribute( QStringLiteral(
"value" ) ).toDouble() );
556 newPaletteElem.setAttribute( QStringLiteral(
"value" ), value );
557 red = colorRampEntryElem.attribute( QStringLiteral(
"red" ) ).toInt();
558 green = colorRampEntryElem.attribute( QStringLiteral(
"green" ) ).toInt();
559 blue = colorRampEntryElem.attribute( QStringLiteral(
"blue" ) ).toInt();
560 newPaletteElem.setAttribute( QStringLiteral(
"color" ), QColor( red, green, blue ).name() );
561 const QString label = colorRampEntryElem.attribute( QStringLiteral(
"label" ) );
562 if ( !label.isEmpty() )
564 newPaletteElem.setAttribute( QStringLiteral(
"label" ), label );
566 newColorPaletteElem.appendChild( newPaletteElem );
568 rasterRendererElem.appendChild( newColorPaletteElem );
570 else if ( drawingStyle == QLatin1String(
"MultiBandColor" ) )
572 rasterRendererElem.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"multibandcolor" ) );
575 const int redBand =
rasterBandNumber( rasterPropertiesElem, QStringLiteral(
"mRedBandName" ), rlayer );
576 const int greenBand =
rasterBandNumber( rasterPropertiesElem, QStringLiteral(
"mGreenBandName" ), rlayer );
577 const int blueBand =
rasterBandNumber( rasterPropertiesElem, QStringLiteral(
"mBlueBandName" ), rlayer );
578 rasterRendererElem.setAttribute( QStringLiteral(
"redBand" ), redBand );
579 rasterRendererElem.setAttribute( QStringLiteral(
"greenBand" ), greenBand );
580 rasterRendererElem.setAttribute( QStringLiteral(
"blueBand" ), blueBand );
590 if ( !parentNode.isNull() )
592 parentNode.replaceChild( rasterRendererElem, rasterPropertiesElem );
629 if ( rasterproperties.isNull() || rendererElem.isNull() )
634 double minimumValue = 0;
635 double maximumValue = 0;
636 const QDomElement contrastMinMaxElem = rasterproperties.firstChildElement( QStringLiteral(
"contrastEnhancementMinMaxValues" ) );
637 if ( contrastMinMaxElem.isNull() )
642 const QDomElement contrastEnhancementAlgorithmElem = rasterproperties.firstChildElement( QStringLiteral(
"mContrastEnhancementAlgorithm" ) );
643 if ( contrastEnhancementAlgorithmElem.isNull() )
649 int algorithmEnum = 0;
650 const QString algorithmString = contrastEnhancementAlgorithmElem.
text();
651 if ( algorithmString == QLatin1String(
"StretchToMinimumMaximum" ) )
655 else if ( algorithmString == QLatin1String(
"StretchAndClipToMinimumMaximum" ) )
659 else if ( algorithmString == QLatin1String(
"ClipToMinimumMaximum" ) )
663 else if ( algorithmString == QLatin1String(
"UserDefinedEnhancement" ) )
668 const QDomNodeList minMaxEntryList = contrastMinMaxElem.elementsByTagName( QStringLiteral(
"minMaxEntry" ) );
669 QStringList enhancementNameList;
670 if ( minMaxEntryList.size() == 1 )
672 enhancementNameList << QStringLiteral(
"contrastEnhancement" );
674 if ( minMaxEntryList.size() == 3 )
676 enhancementNameList << QStringLiteral(
"redContrastEnhancement" ) << QStringLiteral(
"greenContrastEnhancement" ) << QStringLiteral(
"blueContrastEnhancement" );
678 if ( minMaxEntryList.size() > enhancementNameList.size() )
683 QDomElement minMaxEntryElem;
684 for (
int i = 0; i < minMaxEntryList.size(); ++i )
686 minMaxEntryElem = minMaxEntryList.at( i ).toElement();
687 const QDomElement minElem = minMaxEntryElem.firstChildElement( QStringLiteral(
"min" ) );
688 if ( minElem.isNull() )
692 minimumValue = minElem.text().toDouble();
694 const QDomElement maxElem = minMaxEntryElem.firstChildElement( QStringLiteral(
"max" ) );
695 if ( maxElem.isNull() )
699 maximumValue = maxElem.text().toDouble();
701 QDomElement newContrastEnhancementElem = doc.createElement( enhancementNameList.at( i ) );
702 QDomElement newMinValElem = doc.createElement( QStringLiteral(
"minValue" ) );
703 const QDomText minText = doc.createTextNode( QString::number( minimumValue ) );
704 newMinValElem.appendChild( minText );
705 newContrastEnhancementElem.appendChild( newMinValElem );
706 QDomElement newMaxValElem = doc.createElement( QStringLiteral(
"maxValue" ) );
707 const QDomText maxText = doc.createTextNode( QString::number( maximumValue ) );
708 newMaxValElem.appendChild( maxText );
709 newContrastEnhancementElem.appendChild( newMaxValElem );
711 QDomElement newAlgorithmElem = doc.createElement( QStringLiteral(
"algorithm" ) );
712 const QDomText newAlgorithmText = doc.createTextNode( QString::number( algorithmEnum ) );
713 newAlgorithmElem.appendChild( newAlgorithmText );
714 newContrastEnhancementElem.appendChild( newAlgorithmElem );
716 rendererElem.appendChild( newContrastEnhancementElem );