27 : mContent( other.mContent )
28 , mBackgroundColor( other.mBackgroundColor )
29 , mForegroundColor( other.mForegroundColor )
30 , mTextFormat( other.mTextFormat )
31 , mFormat( other.mFormat ? other.mFormat->clone() : nullptr )
32 , mHAlign( other.mHAlign )
33 , mVAlign( other.mVAlign )
40 mContent = other.mContent;
41 mBackgroundColor = other.mBackgroundColor;
42 mForegroundColor = other.mForegroundColor;
43 mTextFormat = other.mTextFormat;
44 mFormat.reset( other.mFormat ? other.mFormat->clone() :
nullptr );
45 mHAlign = other.mHAlign;
46 mVAlign = other.mVAlign;
57 mFormat.reset( format );
63 res.insert( QStringLiteral(
"content" ), mContent );
64 res.insert( QStringLiteral(
"background" ), mBackgroundColor );
65 res.insert( QStringLiteral(
"foreground" ), mForegroundColor );
68 res.insert( QStringLiteral(
"format_type" ), mFormat->id() );
69 res.insert( QStringLiteral(
"format" ), mFormat->configuration( context ) );
75 QDomElement textElem = mTextFormat.
writeXml( textDoc, context );
76 textDoc.appendChild( textElem );
77 res.insert( QStringLiteral(
"text_format" ), textDoc.toString() );
80 res.insert( QStringLiteral(
"halign" ),
static_cast< int >( mHAlign ) );
81 res.insert( QStringLiteral(
"valign" ),
static_cast< int >( mVAlign ) );
88 mContent =
properties.value( QStringLiteral(
"content" ) );
89 mBackgroundColor =
properties.value( QStringLiteral(
"background" ) ).value< QColor >();
90 mForegroundColor =
properties.value( QStringLiteral(
"foreground" ) ).value< QColor >();
94 const QString textXml =
properties.value( QStringLiteral(
"text_format" ) ).toString();
95 if ( !textXml.isEmpty() )
97 doc.setContent( textXml );
98 elem = doc.documentElement();
99 mTextFormat.
readXml( elem, context );
106 if (
properties.contains( QStringLiteral(
"format_type" ) ) )
110 properties.value( QStringLiteral(
"format" ) ).toMap(),
118 mHAlign =
static_cast< Qt::Alignment
>(
properties.value( QStringLiteral(
"halign" ), Qt::AlignLeft ).toInt() );
119 mVAlign =
static_cast< Qt::Alignment
>(
properties.value( QStringLiteral(
"valign" ), Qt::AlignVCenter ).toInt() );