19 #include <QDomDocument>
78 QDomElement documentElem = doc.documentElement();
79 if ( documentElem.isNull() )
83 QDomElement annotationElem = doc.createElement(
"TextAnnotationItem" );
86 annotationElem.setAttribute(
"document",
mDocument->toHtml() );
89 documentElem.appendChild( annotationElem );
96 mDocument->setHtml( itemElem.attribute(
"document",
QObject::tr(
"<html>QGIS rocks!</html>" ) ) );
97 QDomElement annotationElem = itemElem.firstChildElement(
"AnnotationItem" );
98 if ( !annotationElem.isNull() )
void _readXML(const QDomDocument &doc, const QDomElement &annotationElem)
double mFrameBorderWidth
Width of the frame.
QPointF mOffsetFromReferencePoint
Describes the shift of the item content box to the reference point.
void writeXML(QDomDocument &doc) const
QTextDocument * mDocument
Map canvas is a class for displaying all GIS data types on a canvas.
void drawSelectionBoxes(QPainter *p)
void paint(QPainter *painter)
function to be implemented by derived classes
void drawMarkerSymbol(QPainter *p)
QgsTextAnnotationItem(QgsMapCanvas *canvas)
An annotation item can be either placed either on screen corrdinates or on map coordinates.
bool mMapPositionFixed
True: the item stays at the same map position, False: the item stays on same screen position...
QTextDocument * document() const
Returns document (caller takes ownership)
void _writeXML(QDomDocument &doc, QDomElement &itemElem) const
void drawFrame(QPainter *p)
void readXML(const QDomDocument &doc, const QDomElement &itemElem)
void setDocument(const QTextDocument *doc)
Sets document (does not take ownership)
QSizeF mFrameSize
Size of the frame (without balloon)