QGIS API Documentation  2.99.0-Master (283d45a)
qgstextannotationitem.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgstextannotationitem.h
3  ------------------------
4  begin : February 9, 2010
5  copyright : (C) 2010 by Marco Hugentobler
6  email : marco dot hugentobler at hugis dot net
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSTEXTANNOTATIONITEM_H
19 #define QGSTEXTANNOTATIONITEM_H
20 
21 #include "qgsannotationitem.h"
22 #include <QTextDocument>
23 #include "qgis_gui.h"
24 
27 class GUI_EXPORT QgsTextAnnotationItem: public QgsAnnotationItem
28 {
29  public:
32 
34  QTextDocument* document() const;
36  void setDocument( const QTextDocument* doc );
37 
38  void writeXml( QDomDocument& doc ) const override;
39  void readXml( const QDomDocument& doc, const QDomElement& itemElem ) override;
40 
41  void paint( QPainter* painter ) override;
42 
43  private:
44  QTextDocument* mDocument;
45 };
46 
47 #endif // QGSTEXTANNOTATIONITEM_H
virtual void readXml(const QDomDocument &doc, const QDomElement &itemElem)=0
Deserialize from XML.
virtual void writeXml(QDomDocument &doc) const =0
Serialize to XML.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:74
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
Paint the annotation to a destination painter.
An annotation item can be either placed either on screen corrdinates or on map coordinates.
An annotation item that displays formated text.