18 #include <QDomDocument>
24 : mMode( other.mMode )
25 , mHorizontalPosition( other.mHorizontalPosition )
26 , mVerticalPosition( other.mVerticalPosition )
33 this->mMode = rhs.mMode;
34 this->mHorizontalPosition = rhs.mHorizontalPosition;
35 this->mVerticalPosition = rhs.mVerticalPosition;
42 out &= this->mMode == rhs.mMode;
43 out &= this->mHorizontalPosition == rhs.mHorizontalPosition;
44 out &= this->mVerticalPosition == rhs.mVerticalPosition;
55 const QString modeStr = element.attribute( QStringLiteral(
"mode" ) );
56 if ( modeStr == QLatin1String(
"Off" ) )
58 else if ( modeStr == QLatin1String(
"Crs" ) )
60 else if ( modeStr == QLatin1String(
"Cube" ) )
63 const QString horizontalStr = element.attribute( QStringLiteral(
"horizontal" ) );
64 if ( horizontalStr == QLatin1String(
"Left" ) )
65 mHorizontalPosition = Qt::AnchorPoint::AnchorLeft;
66 else if ( horizontalStr == QLatin1String(
"Middle" ) )
67 mHorizontalPosition = Qt::AnchorPoint::AnchorHorizontalCenter;
68 else if ( horizontalStr == QLatin1String(
"Right" ) )
69 mHorizontalPosition = Qt::AnchorPoint::AnchorRight;
71 const QString verticalStr = element.attribute( QStringLiteral(
"vertical" ) );
72 if ( verticalStr == QLatin1String(
"Top" ) )
73 mVerticalPosition = Qt::AnchorPoint::AnchorTop;
74 else if ( verticalStr == QLatin1String(
"Middle" ) )
75 mVerticalPosition = Qt::AnchorPoint::AnchorVerticalCenter;
76 else if ( verticalStr == QLatin1String(
"Bottom" ) )
77 mVerticalPosition = Qt::AnchorPoint::AnchorBottom;
86 str = QLatin1String(
"Crs" );
89 str = QLatin1String(
"Cube" );
94 str = QLatin1String(
"Off" );
97 element.setAttribute( QStringLiteral(
"mode" ),
str );
99 switch ( mHorizontalPosition )
101 case Qt::AnchorPoint::AnchorLeft:
102 str = QLatin1String(
"Left" );
104 case Qt::AnchorPoint::AnchorHorizontalCenter:
105 str = QLatin1String(
"Middle" );
107 case Qt::AnchorPoint::AnchorRight:
109 str = QLatin1String(
"End" );
112 element.setAttribute( QStringLiteral(
"horizontal" ),
str );
114 switch ( mVerticalPosition )
116 case Qt::AnchorPoint::AnchorBottom:
117 str = QLatin1String(
"Bottom" );
119 case Qt::AnchorPoint::AnchorVerticalCenter:
120 str = QLatin1String(
"Middle" );
122 case Qt::AnchorPoint::AnchorTop:
124 str = QLatin1String(
"Top" );
127 element.setAttribute( QStringLiteral(
"vertical" ),
str );