19 #include <QDomDocument>
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 );
104 mDocument->setHtml( itemElem.attribute(
"document",
QObject::tr(
"<html>QGIS rocks!</html>" ) ) );
105 QDomElement annotationElem = itemElem.firstChildElement(
"AnnotationItem" );
106 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)