@@ -262,8 +262,19 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId, const
262
262
mFontItalicBtn ->setEnabled ( true );
263
263
break ;
264
264
case QgsPalLayerSettings::Size :
265
+ {
265
266
mFontSizeSpinBox ->setEnabled ( true );
267
+ double size = mCurLabelFeat .attribute ( ddIndx ).toDouble ( &ok );
268
+ if ( ok )
269
+ {
270
+ mFontSizeSpinBox ->setValue ( size );
271
+ }
272
+ else
273
+ {
274
+ mFontSizeSpinBox ->setValue ( 0 );
275
+ }
266
276
break ;
277
+ }
267
278
default :
268
279
break ;
269
280
}
@@ -329,13 +340,13 @@ void QgsLabelPropertyDialog::updateFont( const QFont& font, bool block )
329
340
330
341
if ( block )
331
342
blockElementSignals ( true );
343
+
332
344
mFontFamilyCmbBx ->setCurrentFont ( mLabelFont );
333
345
populateFontStyleComboBox ();
334
346
mFontUnderlineBtn ->setChecked ( mLabelFont .underline () );
335
347
mFontStrikethroughBtn ->setChecked ( mLabelFont .strikeOut () );
336
348
mFontBoldBtn ->setChecked ( mLabelFont .bold () );
337
349
mFontItalicBtn ->setChecked ( mLabelFont .italic () );
338
- mFontSizeSpinBox ->setValue ( mLabelFont .pointSizeF () );
339
350
if ( block )
340
351
blockElementSignals ( false );
341
352
}
@@ -452,7 +463,13 @@ void QgsLabelPropertyDialog::on_mFontItalicBtn_toggled( bool ckd )
452
463
453
464
void QgsLabelPropertyDialog::on_mFontSizeSpinBox_valueChanged ( double d )
454
465
{
455
- insertChangedValue ( QgsPalLayerSettings::Size , d );
466
+ QVariant size ( d );
467
+ if ( d <= 0 )
468
+ {
469
+ // null value so that font size is reset to default
470
+ size.clear ();
471
+ }
472
+ insertChangedValue ( QgsPalLayerSettings::Size , size );
456
473
}
457
474
458
475
void QgsLabelPropertyDialog::on_mBufferSizeSpinBox_valueChanged ( double d )
0 commit comments