22 QgsFormLabelFormatWidget::QgsFormLabelFormatWidget( QWidget *parent )
27 mFontBoldBtn->setChecked(
false );
28 mFontItalicBtn->setChecked(
false );
29 mFontUnderlineBtn->setChecked(
false );
30 mFontStrikethroughBtn->setChecked(
false );
33 mFontUnderlineBtn->setMinimumSize( buttonSize, buttonSize );
34 mFontUnderlineBtn->setMaximumSize( buttonSize, buttonSize );
35 mFontBoldBtn->setMinimumSize( buttonSize, buttonSize );
36 mFontBoldBtn->setMaximumSize( buttonSize, buttonSize );
37 mFontItalicBtn->setMinimumSize( buttonSize, buttonSize );
38 mFontItalicBtn->setMaximumSize( buttonSize, buttonSize );
40 mOverrideLabelColorGroupBox->setSaveCheckedState(
false );
41 mOverrideLabelFontGroupBox->setSaveCheckedState(
false );
42 mOverrideLabelColorGroupBox->setSaveCollapsedState(
false );
43 mOverrideLabelFontGroupBox->setSaveCollapsedState(
false );
45 btnTextColor->setAllowOpacity(
true );
46 btnTextColor->setShowNull(
true, tr(
"Default color" ) );
52 mFontFamilyCmbBx->setCurrentFont( labelStyle.
font );
53 mFontUnderlineBtn->setChecked( labelStyle.
font.underline() );
54 mFontItalicBtn->setChecked( labelStyle.
font.italic() );
55 mFontBoldBtn->setChecked( labelStyle.
font.bold() );
56 mFontStrikethroughBtn->setChecked( labelStyle.
font.strikeOut() );
57 if ( labelStyle.
color.isValid() )
59 btnTextColor->setColor( labelStyle.
color );
63 btnTextColor->setToNull();
65 mOverrideLabelColorGroupBox->setChecked( labelStyle.
overrideColor );
66 mOverrideLabelFontGroupBox->setChecked( labelStyle.
overrideFont );
67 mOverrideLabelColorGroupBox->setCollapsed( ! labelStyle.
overrideColor );
68 mOverrideLabelFontGroupBox->setCollapsed( ! labelStyle.
overrideFont );
74 style.
color = btnTextColor->color();
76 currentFont.setFamily( mFontFamilyCmbBx->currentFont().family() );
77 currentFont.setBold( mFontBoldBtn->isChecked() );
78 currentFont.setItalic( mFontItalicBtn->isChecked() );
79 currentFont.setUnderline( mFontUnderlineBtn->isChecked() );
80 currentFont.setStrikeOut( mFontStrikethroughBtn->isChecked() );
81 style.
font = currentFont;
82 style.
overrideColor = mOverrideLabelColorGroupBox->isChecked( );
83 style.
overrideFont = mOverrideLabelFontGroupBox->isChecked( );