17#include "moc_qgsformlabelformatwidget.cpp"
25QgsFormLabelFormatWidget::QgsFormLabelFormatWidget( QWidget *parent )
30 mFontBoldBtn->setChecked(
false );
31 mFontItalicBtn->setChecked(
false );
32 mFontUnderlineBtn->setChecked(
false );
33 mFontStrikethroughBtn->setChecked(
false );
36 mFontUnderlineBtn->setMinimumSize( buttonSize, buttonSize );
37 mFontUnderlineBtn->setMaximumSize( buttonSize, buttonSize );
38 mFontBoldBtn->setMinimumSize( buttonSize, buttonSize );
39 mFontBoldBtn->setMaximumSize( buttonSize, buttonSize );
40 mFontItalicBtn->setMinimumSize( buttonSize, buttonSize );
41 mFontItalicBtn->setMaximumSize( buttonSize, buttonSize );
43 mOverrideLabelColorGroupBox->setSaveCheckedState(
false );
44 mOverrideLabelFontGroupBox->setSaveCheckedState(
false );
45 mOverrideLabelColorGroupBox->setSaveCollapsedState(
false );
46 mOverrideLabelFontGroupBox->setSaveCollapsedState(
false );
48 btnTextColor->setAllowOpacity(
true );
49 btnTextColor->setShowNull(
true, tr(
"Default color" ) );
54 mFontFamilyCmbBx->setCurrentFont( labelStyle.
font );
55 mFontUnderlineBtn->setChecked( labelStyle.
font.underline() );
56 mFontItalicBtn->setChecked( labelStyle.
font.italic() );
57 mFontBoldBtn->setChecked( labelStyle.
font.bold() );
58 mFontStrikethroughBtn->setChecked( labelStyle.
font.strikeOut() );
59 if ( labelStyle.
color.isValid() )
61 btnTextColor->setColor( labelStyle.
color );
65 btnTextColor->setToNull();
67 mOverrideLabelColorGroupBox->setChecked( labelStyle.
overrideColor );
68 mOverrideLabelFontGroupBox->setChecked( labelStyle.
overrideFont );
69 mOverrideLabelColorGroupBox->setCollapsed( !labelStyle.
overrideColor );
70 mOverrideLabelFontGroupBox->setCollapsed( !labelStyle.
overrideFont );
76 style.
color = btnTextColor->color();
79 currentFont.setBold( mFontBoldBtn->isChecked() );
80 currentFont.setItalic( mFontItalicBtn->isChecked() );
81 currentFont.setUnderline( mFontUnderlineBtn->isChecked() );
82 currentFont.setStrikeOut( mFontStrikethroughBtn->isChecked() );
83 style.
font = currentFont;
84 style.
overrideColor = mOverrideLabelColorGroupBox->isChecked();
85 style.
overrideFont = mOverrideLabelFontGroupBox->isChecked();
static void setFontFamily(QFont &font, const QString &family)
Sets the family for a font object.
int scaleIconSize(int standardSize)
Scales an icon size to compensate for display pixel density, making the icon size hi-dpi friendly,...
The TabStyle struct defines color and font overrides for form fields, tabs and groups labels.
bool overrideColor
Override label color.
bool overrideFont
Override label font.