21 mBackgroundColor( Qt::transparent ),
22 mHAlignment( Qt::AlignLeft ),
24 mSortOrder( Qt::AscendingOrder ),
38 QDomElement bgColorElem = doc.createElement(
"backgroundColor" );
39 bgColorElem.setAttribute(
"red", QString::number( mBackgroundColor.red() ) );
40 bgColorElem.setAttribute(
"green", QString::number( mBackgroundColor.green() ) );
41 bgColorElem.setAttribute(
"blue", QString::number( mBackgroundColor.blue() ) );
42 bgColorElem.setAttribute(
"alpha", QString::number( mBackgroundColor.alpha() ) );
43 columnElem.appendChild( bgColorElem );
45 columnElem.setAttribute(
"hAlignment", mHAlignment );
47 columnElem.setAttribute(
"heading", mHeading );
48 columnElem.setAttribute(
"attribute", mAttribute );
50 columnElem.setAttribute(
"sortByRank", QString::number( mSortByRank ) );
51 columnElem.setAttribute(
"sortOrder", QString::number( mSortOrder ) );
53 columnElem.setAttribute(
"width", QString::number( mWidth ) );
60 mHAlignment = ( Qt::AlignmentFlag )columnElem.attribute(
"hAlignment", QString::number( Qt::AlignLeft ) ).toInt();
61 mHeading = columnElem.attribute(
"heading",
"" );
62 mAttribute = columnElem.attribute(
"attribute",
"" );
63 mSortByRank = columnElem.attribute(
"sortByRank",
"0" ).toInt();
64 mSortOrder = ( Qt::SortOrder )columnElem.attribute(
"sortOrder", QString::number( Qt::AscendingOrder ) ).toInt();
65 mWidth = columnElem.attribute(
"width",
"0.0" ).toDouble();
67 QDomNodeList bgColorList = columnElem.elementsByTagName(
"backgroundColor" );
68 if ( bgColorList.size() > 0 )
70 QDomElement bgColorElem = bgColorList.at( 0 ).toElement();
71 bool redOk, greenOk, blueOk, alphaOk;
72 int bgRed, bgGreen, bgBlue, bgAlpha;
73 bgRed = bgColorElem.attribute(
"red" ).toDouble( &redOk );
74 bgGreen = bgColorElem.attribute(
"green" ).toDouble( &greenOk );
75 bgBlue = bgColorElem.attribute(
"blue" ).toDouble( &blueOk );
76 bgAlpha = bgColorElem.attribute(
"alpha" ).toDouble( &alphaOk );
77 if ( redOk && greenOk && blueOk && alphaOk )
79 mBackgroundColor = QColor( bgRed, bgGreen, bgBlue, bgAlpha );