QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
annotations
qgstextannotation.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgstextannotation.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 QGSTEXTANNOTATION_H
19
#define QGSTEXTANNOTATION_H
20
21
#include "qgis_core.h"
22
#include "
qgsannotation.h
"
23
24
#include <QTextDocument>
25
31
class
CORE_EXPORT
QgsTextAnnotation
:
public
QgsAnnotation
32
{
33
Q_OBJECT
34
35
public
:
39
QgsTextAnnotation
( QObject *parent
SIP_TRANSFERTHIS
=
nullptr
);
40
41
QgsTextAnnotation
*
clone
()
const
override
SIP_FACTORY
;
42
48
const
QTextDocument *
document
()
const
;
49
55
void
setDocument
(
const
QTextDocument *doc );
56
57
void
writeXml
( QDomElement &elem, QDomDocument &doc,
const
QgsReadWriteContext
&context )
const override
;
58
void
readXml
(
const
QDomElement &itemElem,
const
QgsReadWriteContext
&context )
override
;
59
63
static
QgsTextAnnotation
*
create
()
SIP_FACTORY
{
return
new
QgsTextAnnotation
(); }
64
65
protected
:
66
void
renderAnnotation
(
QgsRenderContext
&context, QSizeF size )
const override
;
67
68
private
:
69
std::unique_ptr< QTextDocument > mDocument;
70
};
71
72
#endif
// QGSTEXTANNOTATION_H
QgsAnnotation::renderAnnotation
virtual void renderAnnotation(QgsRenderContext &context, QSizeF size) const =0
Renders the annotation's contents to a target /a context at the specified /a size.
QgsAnnotation::readXml
virtual void readXml(const QDomElement &itemElem, const QgsReadWriteContext &context)=0
Restores the annotation's state from a DOM element.
QgsAnnotation::QgsAnnotation
QgsAnnotation(QObject *parent=nullptr)
Constructor for QgsAnnotation.
Definition
qgsannotation.cpp:38
QgsAnnotation::clone
virtual QgsAnnotation * clone() const =0
Clones the annotation, returning a new copy of the annotation reflecting the annotation's current sta...
QgsAnnotation::writeXml
virtual void writeXml(QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context) const =0
Writes the annotation state to a DOM element.
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
QgsRenderContext
Contains information about the context of a rendering operation.
Definition
qgsrendercontext.h:63
QgsTextAnnotation::document
const QTextDocument * document() const
Returns the text document which will be rendered within the annotation.
Definition
qgstextannotation.cpp:48
QgsTextAnnotation::setDocument
void setDocument(const QTextDocument *doc)
Sets the text document which will be rendered within the annotation.
Definition
qgstextannotation.cpp:53
QgsTextAnnotation::create
static QgsTextAnnotation * create()
Returns a new QgsTextAnnotation object.
Definition
qgstextannotation.h:63
QgsTextAnnotation::QgsTextAnnotation
QgsTextAnnotation(QObject *parent=nullptr)
Constructor for QgsTextAnnotation.
Definition
qgstextannotation.cpp:33
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
qgsannotation.h
Generated on
for QGIS API Documentation by
1.17.0