QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
qgsformannotation.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsformannotation.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 QGSFORMANNOTATION_H
19
#define QGSFORMANNOTATION_H
20
21
#include "qgis_gui.h"
22
#include "
qgis_sip.h
"
23
#include "
qgsannotation.h
"
24
#include "
qgsfeature.h
"
25
26
#include <QWidget>
27
33
class
GUI_EXPORT
QgsFormAnnotation
:
public
QgsAnnotation
34
{
35
Q_OBJECT
36
public
:
40
QgsFormAnnotation
( QObject *parent
SIP_TRANSFERTHIS
=
nullptr
);
41
42
QgsFormAnnotation
*
clone
()
const
override
SIP_FACTORY
;
43
44
QSizeF
minimumFrameSize
()
const override
;
46
QSizeF
preferredFrameSize
()
const
;
47
52
void
setDesignerForm
(
const
QString &uiFile );
53
58
QString
designerForm
()
const
{
return
mDesignerForm; }
59
60
void
writeXml
( QDomElement &elem, QDomDocument &doc,
const
QgsReadWriteContext
&context )
const override
;
61
void
readXml
(
const
QDomElement &itemElem,
const
QgsReadWriteContext
&context )
override
;
62
63
void
setAssociatedFeature
(
const
QgsFeature
&feature )
override
;
64
68
static
QgsFormAnnotation
*
create
()
SIP_FACTORY
{
return
new
QgsFormAnnotation
(); }
69
70
protected
:
71
void
renderAnnotation
(
QgsRenderContext
&context, QSizeF size )
const override
;
72
73
private
:
74
std::unique_ptr<QWidget> mDesignerWidget;
75
QSize mMinimumSize;
77
QString mDesignerForm;
78
79
QWidget *createDesignerWidget(
const
QString &filePath );
80
};
81
82
#endif
// QGSFORMANNOTATION_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::setAssociatedFeature
virtual void setAssociatedFeature(const QgsFeature &feature)
Sets the feature associated with the annotation.
Definition
qgsannotation.cpp:197
QgsAnnotation::minimumFrameSize
virtual QSizeF minimumFrameSize() const
Returns the minimum frame size for the annotation.
Definition
qgsannotation.cpp:228
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.
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition
qgsfeature.h:60
QgsFormAnnotation::create
static QgsFormAnnotation * create()
Returns a new QgsFormAnnotation object.
Definition
qgsformannotation.h:68
QgsFormAnnotation::designerForm
QString designerForm() const
Returns the path to the Qt Designer UI file to show in the annotation.
Definition
qgsformannotation.h:58
QgsFormAnnotation::QgsFormAnnotation
QgsFormAnnotation(QObject *parent=nullptr)
Constructor for QgsFormAnnotation.
Definition
qgsformannotation.cpp:49
QgsFormAnnotation::setDesignerForm
void setDesignerForm(const QString &uiFile)
Sets the path to the Qt Designer UI file to show in the annotation.
Definition
qgsformannotation.cpp:61
QgsFormAnnotation::preferredFrameSize
QSizeF preferredFrameSize() const
Returns the optimal frame size.
Definition
qgsformannotation.cpp:157
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
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
qgsannotation.h
qgsfeature.h
Generated on
for QGIS API Documentation by
1.17.0