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 ) );
54 styleElem.setAttribute( QStringLiteral(
"marginTop" ), QString::number( mMarginMap[
Top] ) );
56 styleElem.setAttribute( QStringLiteral(
"marginBottom" ), QString::number( mMarginMap[
Bottom] ) );
58 styleElem.setAttribute( QStringLiteral(
"marginLeft" ), QString::number( mMarginMap[
Left] ) );
60 styleElem.setAttribute( QStringLiteral(
"marginRight" ), QString::number( mMarginMap[
Right] ) );
64 elem.appendChild( styleElem );
70 if ( elem.isNull() )
return;
74 mFont.fromString( elem.attribute( QStringLiteral(
"font" ) ) );
77 mMarginMap[
Top] = elem.attribute( QStringLiteral(
"marginTop" ), QStringLiteral(
"0" ) ).toDouble();
78 mMarginMap[
Bottom] = elem.attribute( QStringLiteral(
"marginBottom" ), QStringLiteral(
"0" ) ).toDouble();
79 mMarginMap[
Left] = elem.attribute( QStringLiteral(
"marginLeft" ), QStringLiteral(
"0" ) ).toDouble();
80 mMarginMap[
Right] = elem.attribute( QStringLiteral(
"marginRight" ), QStringLiteral(
"0" ) ).toDouble();
82 mAlignment =
static_cast< Qt::Alignment
>( elem.attribute( QStringLiteral(
"alignment" ), QString::number( Qt::AlignLeft ) ).toInt() );
92 return QStringLiteral(
"hidden" );
94 return QStringLiteral(
"title" );
96 return QStringLiteral(
"group" );
98 return QStringLiteral(
"subgroup" );
100 return QStringLiteral(
"symbol" );
102 return QStringLiteral(
"symbolLabel" );
109 if (
styleName == QLatin1String(
"hidden" ) )
111 else if (
styleName == QLatin1String(
"title" ) )
113 else if (
styleName == QLatin1String(
"group" ) )
115 else if (
styleName == QLatin1String(
"subgroup" ) )
117 else if (
styleName == QLatin1String(
"symbol" ) )
119 else if (
styleName == QLatin1String(
"symbolLabel" ) )
129 return QObject::tr(
"Undefined" );
131 return QObject::tr(
"Hidden" );
133 return QObject::tr(
"Title" );
135 return QObject::tr(
"Group" );
137 return QObject::tr(
"Subgroup" );
139 return QObject::tr(
"Symbol" );
141 return QObject::tr(
"Symbol label" );