27 #include <QDomElement>
28 #include <QDomDocument>
48 QDomElement styleElem = doc.createElement( QStringLiteral(
"style" ) );
50 styleElem.setAttribute( QStringLiteral(
"name" ), name );
51 styleElem.setAttribute( QStringLiteral(
"alignment" ), QString::number( mAlignment ) );
52 styleElem.setAttribute( QStringLiteral(
"indent" ), QString::number( mIndent ) );
55 styleElem.setAttribute( QStringLiteral(
"marginTop" ), QString::number( mMarginMap[
Top] ) );
57 styleElem.setAttribute( QStringLiteral(
"marginBottom" ), QString::number( mMarginMap[
Bottom] ) );
59 styleElem.setAttribute( QStringLiteral(
"marginLeft" ), QString::number( mMarginMap[
Left] ) );
61 styleElem.setAttribute( QStringLiteral(
"marginRight" ), QString::number( mMarginMap[
Right] ) );
65 elem.appendChild( styleElem );
71 if ( elem.isNull() )
return;
75 mFont.fromString( elem.attribute( QStringLiteral(
"font" ) ) );
78 mMarginMap[
Top] = elem.attribute( QStringLiteral(
"marginTop" ), QStringLiteral(
"0" ) ).toDouble();
79 mMarginMap[
Bottom] = elem.attribute( QStringLiteral(
"marginBottom" ), QStringLiteral(
"0" ) ).toDouble();
80 mMarginMap[
Left] = elem.attribute( QStringLiteral(
"marginLeft" ), QStringLiteral(
"0" ) ).toDouble();
81 mMarginMap[
Right] = elem.attribute( QStringLiteral(
"marginRight" ), QStringLiteral(
"0" ) ).toDouble();
83 mAlignment =
static_cast< Qt::Alignment
>( elem.attribute( QStringLiteral(
"alignment" ), QString::number( Qt::AlignLeft ) ).toInt() );
84 mIndent = elem.attribute( QStringLiteral(
"indent" ), QStringLiteral(
"0" ) ).toDouble();
94 return QStringLiteral(
"hidden" );
96 return QStringLiteral(
"title" );
98 return QStringLiteral(
"group" );
100 return QStringLiteral(
"subgroup" );
102 return QStringLiteral(
"symbol" );
104 return QStringLiteral(
"symbolLabel" );
111 if (
styleName == QLatin1String(
"hidden" ) )
113 else if (
styleName == QLatin1String(
"title" ) )
115 else if (
styleName == QLatin1String(
"group" ) )
117 else if (
styleName == QLatin1String(
"subgroup" ) )
119 else if (
styleName == QLatin1String(
"symbol" ) )
121 else if (
styleName == QLatin1String(
"symbolLabel" ) )
131 return QObject::tr(
"Undefined" );
133 return QObject::tr(
"Hidden" );
135 return QObject::tr(
"Title" );
137 return QObject::tr(
"Group" );
139 return QObject::tr(
"Subgroup" );
141 return QObject::tr(
"Symbol" );
143 return QObject::tr(
"Symbol label" );