File: qgslegendrenderer.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 (134 lines) | stat: -rw-r--r-- 3,983 bytes parent folder | download | duplicates (12)
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
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgslegendrenderer.h                                         *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/






class QgsLegendRenderer
{
%Docstring(signature="appended")
Handles automatic layout and rendering of legends.

The content is given by :py:class:`QgsLayerTreeModel` instance. Various
layout properties can be configured within
:py:class:`QgsLegendRenderer`.

All spacing and sizes are in millimeters.
%End

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

    QgsLegendRenderer( QgsLayerTreeModel *legendModel, const QgsLegendSettings &settings );
%Docstring
Constructor for QgsLegendRenderer. The ownership of the legend model is
not changed, and the model must exist for the lifetime of this renderer.
%End
    ~QgsLegendRenderer();


    QgsLayerTreeFilterProxyModel *proxyModel();
%Docstring
Returns the filter proxy model used for filtering the legend model
content during rendering.

Filters can be set on the proxy model to filter rendered legend content.

.. versionadded:: 3.40
%End

    QSizeF minimumSize( QgsRenderContext *renderContext = 0 );
%Docstring
Runs the layout algorithm and returns the minimum size required for the
legend.

.. seealso:: :py:func:`setLegendSize`

.. seealso:: :py:func:`legendSize`
%End

    void setLegendSize( QSizeF s );
%Docstring
Sets the preferred resulting legend size.

If the size is null, the legend will be drawn with the minimum possible
size to fit its content.

.. seealso:: :py:func:`legendSize`

.. seealso:: :py:func:`minimumSize`
%End

    QSizeF legendSize() const;
%Docstring
Returns the preferred legend size set by the client.

If the returned size is null, the legend will be drawn with the minimum
possible size to fit its content.

.. seealso:: :py:func:`minimumSize`

.. seealso:: :py:func:`setLegendSize`
%End

 void drawLegend( QPainter *painter ) /Deprecated/;
%Docstring
Draws the legend with given ``painter``. The legend will occupy the area
reported in :py:func:`~QgsLegendRenderer.legendSize`. The ``painter``
should be scaled beforehand so that units correspond to millimeters.

.. deprecated:: 3.40

   Use the variant which accepts a :py:class:`QgsRenderContext` instead.
%End

    void drawLegend( QgsRenderContext &context );
%Docstring
Draws the legend using a given render ``context``. The legend will
occupy the area reported in :py:func:`~QgsLegendRenderer.legendSize`.

.. versionadded:: 3.6
%End

    QJsonObject exportLegendToJson( const QgsRenderContext &context );
%Docstring
Renders the legend in a ``json`` object.

.. versionadded:: 3.8
%End

    static void setNodeLegendStyle( QgsLayerTreeNode *node, QgsLegendStyle::Style style );
%Docstring
Sets the ``style`` of a ``node``.

.. seealso:: :py:func:`nodeLegendStyle`
%End

    static QgsLegendStyle::Style nodeLegendStyle( QgsLayerTreeNode *node, QgsLayerTreeModel *model );
%Docstring
Returns the style for the given ``node``, within the specified
``model``.

.. seealso:: :py:func:`setNodeLegendStyle`
%End

  private:
    QgsLegendRenderer( const QgsLegendRenderer &other );
};

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