19 #include <QDomDocument> 39 return mDocument->
clone();
45 mDocument = doc->
clone();
50 if ( !painter || !mDocument )
87 if ( documentElem.
isNull() )
106 if ( !annotationElem.
isNull() )
void drawContents(QPainter *p, const QRectF &rect)
void _readXML(const QDomDocument &doc, const QDomElement &annotationElem)
double mFrameBorderWidth
Width of the frame.
QDomNode appendChild(const QDomNode &newChild)
QString attribute(const QString &name, const QString &defValue) const
QPointF mOffsetFromReferencePoint
Describes the shift of the item content box to the reference point.
void drawMarkerSymbol(QPainter *p) const
Draws the map position marker symbol to a destination painter.
QRect boundingRect() const
QDomElement documentElement() const
void drawSelectionBoxes(QPainter *p) const
Draws selection handles around the item.
QRectF intersected(const QRectF &rectangle) const
void paint(QPainter *painter) override
function to be implemented by derived classes
QString tr(const char *sourceText, const char *disambiguation, int n)
Map canvas is a class for displaying all GIS data types on a canvas.
void readXML(const QDomDocument &doc, const QDomElement &itemElem) override
QRegion clipRegion() const
void setAttribute(const QString &name, const QString &value)
QTextDocument * document() const
Returns document (caller takes ownership)
void setUseDesignMetrics(bool b)
void _writeXML(QDomDocument &doc, QDomElement &itemElem) const
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...
void setTextWidth(qreal width)
QTextDocument * clone(QObject *parent) const
QDomElement firstChildElement(const QString &tagName) const
void translate(const QPointF &offset)
void setHtml(const QString &html)
void writeXML(QDomDocument &doc) const override
void setDocument(const QTextDocument *doc)
Sets document (does not take ownership)
QDomElement createElement(const QString &tagName)
QString toHtml(const QByteArray &encoding) const
QSizeF mFrameSize
Size of the frame (without balloon)
void drawFrame(QPainter *p) const
Draws the annotation frame to a destination painter.