19 #include <QDomDocument>
24 mDocument->setUseDesignMetrics(
true );
39 return mDocument->clone();
45 mDocument = doc->clone();
50 if ( !painter || !mDocument )
67 QRectF clipRect = QRectF( 0, 0,
mFrameSize.width() - frameWidth / 2.0,
mFrameSize.height() - frameWidth / 2.0 );
68 if ( painter->hasClipping() )
73 clipRect = clipRect.intersected( painter->clipRegion().boundingRect() );
76 mDocument->drawContents( painter, clipRect );
86 QDomElement documentElem = doc.documentElement();
87 if ( documentElem.isNull() )
91 QDomElement annotationElem = doc.createElement(
"TextAnnotationItem" );
94 annotationElem.setAttribute(
"document", mDocument->toHtml() );
97 documentElem.appendChild( annotationElem );
103 mDocument =
new QTextDocument;
104 mDocument->setHtml( itemElem.attribute(
"document",
QObject::tr(
"<html>QGIS rocks!</html>" ) ) );
105 QDomElement annotationElem = itemElem.firstChildElement(
"AnnotationItem" );
106 if ( !annotationElem.isNull() )