24 #include <QDomElement>
25 #include <QDomDocument>
32 QString defaultFontString = settings.value(
"/Composer/defaultFont" ).toString();
33 if ( !defaultFontString.isEmpty() )
35 mFont.setFamily( defaultFontString );
53 if ( elem.isNull() )
return;
55 QDomElement styleElem = doc.createElement(
"style" );
57 styleElem.setAttribute(
"name", name );
59 if ( mMarginMap[
Top] != 0 ) styleElem.setAttribute(
"marginTop", QString::number( mMarginMap[
Top] ) );
60 if ( mMarginMap[
Bottom] != 0 ) styleElem.setAttribute(
"marginBottom", QString::number( mMarginMap[
Bottom] ) );
61 if ( mMarginMap[
Left] != 0 ) styleElem.setAttribute(
"marginLeft", QString::number( mMarginMap[
Left] ) );
62 if ( mMarginMap[
Right] != 0 ) styleElem.setAttribute(
"marginRight", QString::number( mMarginMap[
Right] ) );
64 styleElem.setAttribute(
"font", mFont.toString() );
66 elem.appendChild( styleElem );
72 if ( elem.isNull() )
return;
74 mFont.fromString( elem.attribute(
"font" ) );
76 mMarginMap[
Top] = elem.attribute(
"marginTop",
"0" ).toDouble();
77 mMarginMap[
Bottom] = elem.attribute(
"marginBottom",
"0" ).toDouble();
78 mMarginMap[
Left] = elem.attribute(
"marginLeft",
"0" ).toDouble();
79 mMarginMap[
Right] = elem.attribute(
"marginRight",
"0" ).toDouble();
106 if ( styleName ==
"hidden" )
return Hidden;
107 else if ( styleName ==
"title" )
return Title;
108 else if ( styleName ==
"group" )
return Group;
109 else if ( styleName ==
"subgroup" )
return Subgroup;
110 else if ( styleName ==
"symbol" )
return Symbol;
111 else if ( styleName ==
"symbolLabel" )
return SymbolLabel;