Skip to content

Commit f0dcf7f

Browse files
committedAug 25, 2018
Don't forget to load/save background and selection colors
1 parent d9f67f8 commit f0dcf7f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎src/3d/qgs3dmapsettings.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ void Qgs3DMapSettings::readXml( const QDomElement &elem, const QgsReadWriteConte
6363
elemOrigin.attribute( "y" ).toDouble(),
6464
elemOrigin.attribute( "z" ).toDouble() );
6565

66+
QDomElement elemColor = elem.firstChildElement( "color" );
67+
if ( !elemColor.isNull() )
68+
{
69+
mBackgroundColor = QgsSymbolLayerUtils::decodeColor( elemColor.attribute( "background" ) );
70+
mSelectionColor = QgsSymbolLayerUtils::decodeColor( elemColor.attribute( "selection" ) );
71+
}
72+
6673
QDomElement elemCrs = elem.firstChildElement( "crs" );
6774
mCrs.readXml( elemCrs );
6875

@@ -147,6 +154,11 @@ QDomElement Qgs3DMapSettings::writeXml( QDomDocument &doc, const QgsReadWriteCon
147154
elemOrigin.setAttribute( "z", QString::number( mOrigin.z() ) );
148155
elem.appendChild( elemOrigin );
149156

157+
QDomElement elemColor = doc.createElement( "color" );
158+
elemColor.setAttribute( "background", QgsSymbolLayerUtils::encodeColor( mBackgroundColor ) );
159+
elemColor.setAttribute( "selection", QgsSymbolLayerUtils::encodeColor( mSelectionColor ) );
160+
elem.appendChild( elemColor );
161+
150162
QDomElement elemCrs = doc.createElement( "crs" );
151163
mCrs.writeXml( elemCrs, doc );
152164
elem.appendChild( elemCrs );

0 commit comments

Comments
 (0)
Please sign in to comment.