File: qgsdatadefinedsizelegend.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (217 lines) | stat: -rw-r--r-- 6,352 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsdatadefinedsizelegend.h                                  *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/






class QgsDataDefinedSizeLegend
{
%Docstring(signature="appended")
Object that keeps configuration of appearance of marker symbol's
data-defined size in legend.

For example: the list of classes (size values), whether the classes
should appear in separate legend nodes or whether to collapse them into
one legend node.
%End

%TypeHeaderCode
#include "qgsdatadefinedsizelegend.h"
%End
  public:

    QgsDataDefinedSizeLegend();
%Docstring
Constructor for QgsDataDefinedSizeLegend.
%End

    ~QgsDataDefinedSizeLegend();

    QgsDataDefinedSizeLegend( const QgsDataDefinedSizeLegend &other );

    enum LegendType /BaseType=IntEnum/
    {
      LegendSeparated,
      LegendCollapsed,
    };

    enum VerticalAlignment /BaseType=IntEnum/
    {
      AlignCenter,
      AlignBottom,
    };

    struct SizeClass
    {
      SizeClass( double size, const QString &label );

      double size;

      QString label;
    };

    void setLegendType( LegendType type );
%Docstring
Sets how the legend should be rendered
%End
    LegendType legendType() const;
%Docstring
Returns how the legend should be rendered
%End

    void setSymbol( QgsMarkerSymbol *symbol /Transfer/ );
%Docstring
Sets marker symbol that will be used to draw markers in legend
%End
    QgsMarkerSymbol *symbol() const;
%Docstring
Returns marker symbol that will be used to draw markers in legend
%End

    void setLineSymbol( QgsLineSymbol *symbol /Transfer/ );
%Docstring
Sets the line ``symbol`` that will be used to draw callout lines in
legend.

Ownership of ``symbol`` is transferred.

.. seealso:: :py:func:`lineSymbol`

.. versionadded:: 3.14
%End

    QgsLineSymbol *lineSymbol() const;
%Docstring
Returns the line symbol that will be used to draw callout lines in
legend.

.. seealso:: :py:func:`setLineSymbol`

.. versionadded:: 3.14
%End

    void setSizeScaleTransformer( QgsSizeScaleTransformer *transformer /Transfer/ );
%Docstring
Sets transformer for scaling of symbol sizes. Takes ownership of the
object. Accepts ``None`` to set no transformer.
%End
    QgsSizeScaleTransformer *sizeScaleTransformer() const;
%Docstring
Returns transformer for scaling of symbol sizes. Returns ``None`` if no
transformer is defined.
%End

    void setClasses( const QList< QgsDataDefinedSizeLegend::SizeClass > &classes );
%Docstring
Sets list of classes: each class is a pair of symbol size (in units used
by the symbol) and label
%End
    QList< QgsDataDefinedSizeLegend::SizeClass > classes() const;
%Docstring
Returns list of classes: each class is a pair of symbol size (in units
used by the symbol) and label
%End

    void setTitle( const QString &title );
%Docstring
Sets title label for data-defined size legend
%End
    QString title() const;
%Docstring
Returns title label for data-defined size legend
%End

    void setVerticalAlignment( VerticalAlignment vAlign );
%Docstring
Sets vertical alignment of symbols - only valid for collapsed legend
%End
    VerticalAlignment verticalAlignment() const;
%Docstring
Returns vertical alignment of symbols - only valid for collapsed legend
%End

    void setFont( const QFont &font );
%Docstring
Sets font used for rendering of labels - only valid for collapsed legend
%End
    QFont font() const;
%Docstring
Returns font used for rendering of labels - only valid for collapsed
legend
%End

    void setTextColor( const QColor &color );
%Docstring
Sets text color for rendering of labels - only valid for collapsed
legend
%End
    QColor textColor() const;
%Docstring
Returns text color for rendering of labels - only valid for collapsed
legend
%End

    void setTextAlignment( Qt::AlignmentFlag flag );
%Docstring
Sets horizontal text alignment for rendering of labels - only valid for
collapsed legend
%End
    Qt::AlignmentFlag textAlignment() const;
%Docstring
Returns horizontal text alignment for rendering of labels - only valid
for collapsed legend
%End


    void updateFromSymbolAndProperty( const QgsMarkerSymbol *symbol, const QgsProperty &ddSize );
%Docstring
Updates the list of classes, source symbol and title label from given
symbol and property
%End

    QgsLegendSymbolList legendSymbolList() const;
%Docstring
Generates legend symbol items according to the configuration
%End

    void drawCollapsedLegend( QgsRenderContext &context, QSizeF *outputSize /Out/ = 0, double *labelXOffset /Out/ = 0 ) const;
%Docstring
Draw the legend if using LegendOneNodeForAll and optionally output size
of the legend and x offset of labels (in painter units). If the painter
in context is ``None``, it only does size calculation without actual
rendering. Does nothing if legend is not configured as collapsed.
%End

    QImage collapsedLegendImage( QgsRenderContext &context, const QColor &backgroundColor = Qt::transparent, double paddingMM = 1 ) const;
%Docstring
Returns output image that would be shown in the legend. Returns invalid
image if legend is not configured as collapsed.
%End

    static QgsDataDefinedSizeLegend *readXml( const QDomElement &elem, const QgsReadWriteContext &context ) /Factory/;
%Docstring
Creates instance from given element and returns it (caller takes
ownership). Returns ``None`` on error.
%End

    void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const;
%Docstring
Writes configuration to the given XML element.
%End

};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsdatadefinedsizelegend.h                                  *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/