@@ -155,7 +155,7 @@ QgsPalLayerSettings::QgsPalLayerSettings()
155
155
yOffset = 0 ;
156
156
angleOffset = 0 ;
157
157
centroidWhole = false ;
158
- // textFont = QFont ();
158
+ textFont = QApplication::font ();
159
159
textNamedStyle = QString ( " " );
160
160
textColor = Qt::black;
161
161
textTransp = 0 ;
@@ -363,6 +363,8 @@ void QgsPalLayerSettings::readFromLayer( QgsVectorLayer* layer )
363
363
if ( layer->customProperty ( " labeling" ).toString () != QString ( " pal" ) )
364
364
return ; // there's no information available
365
365
366
+ // NOTE: set defaults for newly added properties, for backwards compatibility
367
+
366
368
fieldName = layer->customProperty ( " labeling/fieldName" ).toString ();
367
369
isExpression = layer->customProperty ( " labeling/isExpression" ).toBool ();
368
370
placement = ( Placement ) layer->customProperty ( " labeling/placement" ).toInt ();
@@ -373,7 +375,7 @@ void QgsPalLayerSettings::readFromLayer( QgsVectorLayer* layer )
373
375
yOffset = layer->customProperty ( " labeling/yOffset" , QVariant ( 0.0 ) ).toDouble ();
374
376
angleOffset = layer->customProperty ( " labeling/angleOffset" , QVariant ( 0.0 ) ).toDouble ();
375
377
centroidWhole = layer->customProperty ( " labeling/centroidWhole" , QVariant ( false ) ).toBool ();
376
- QString fontFamily = layer->customProperty ( " labeling/fontFamily" ).toString ();
378
+ QString fontFamily = layer->customProperty ( " labeling/fontFamily" , QVariant ( QApplication::font (). family () ) ).toString ();
377
379
double fontSize = layer->customProperty ( " labeling/fontSize" ).toDouble ();
378
380
int fontWeight = layer->customProperty ( " labeling/fontWeight" ).toInt ();
379
381
bool fontItalic = layer->customProperty ( " labeling/fontItalic" ).toBool ();
0 commit comments