QGIS/python/core/auto_generated/qgslegendrenderer.sip.in

114 lines
3.5 KiB
Plaintext
Raw Normal View History

2017-05-14 09:48:41 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgslegendrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsLegendRenderer
{
2017-05-14 09:48:41 +02:00
%Docstring
The QgsLegendRenderer class handles automatic layout and rendering of legend.
2017-12-15 10:36:55 -04:00
The content is given by QgsLayerTreeModel instance. Various layout properties can be configured
within QgsLegendRenderer.
2017-05-14 09:48:41 +02:00
2017-12-15 10:36:55 -04:00
All spacing and sizes are in millimeters.
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.6
%End
2017-05-14 09:48:41 +02:00
%TypeHeaderCode
#include "qgslegendrenderer.h"
%End
public:
2019-01-10 09:38:25 +10:00
QgsLegendRenderer( QgsLayerTreeModel *legendModel, const QgsLegendSettings &settings );
2017-05-14 09:48:41 +02:00
%Docstring
2019-01-10 09:38:25 +10:00
Constructor for QgsLegendRenderer. The ownership of the legend model is not changed,
and the model must exist for the lifetime of this renderer.
2017-05-14 09:48:41 +02:00
%End
QSizeF minimumSize( QgsRenderContext *renderContext = 0 );
2017-05-14 09:48:41 +02:00
%Docstring
2019-01-10 09:38:25 +10:00
Runs the layout algorithm and returns the minimum size required for the legend.
.. seealso:: :py:func:`setLegendSize`
.. seealso:: :py:func:`legendSize`
2017-05-14 09:48:41 +02:00
%End
void setLegendSize( QSizeF s );
2017-05-14 09:48:41 +02:00
%Docstring
Sets the preferred resulting legend size.
2019-01-10 09:38:25 +10:00
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`
2017-05-14 09:48:41 +02:00
%End
QSizeF legendSize() const;
2017-05-14 09:48:41 +02:00
%Docstring
2019-01-10 09:38:25 +10:00
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`
2017-05-14 09:48:41 +02:00
%End
void drawLegend( QPainter *painter ) /Deprecated/;
2017-05-14 09:48:41 +02:00
%Docstring
Draws the legend with given ``painter``. The legend will occupy the area reported in :py:func:`~QgsLegendRenderer.legendSize`.
2019-01-10 09:38:25 +10:00
The ``painter`` should be scaled beforehand so that units correspond to millimeters.
.. deprecated::
Use the variant which accepts a QgsRenderContext instead.
2017-05-14 09:48:41 +02:00
%End
2019-01-10 09:39:33 +10:00
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`.
2019-01-10 09:39:33 +10:00
.. versionadded:: 3.6
2019-03-04 15:02:49 +00:00
%End
2020-05-08 23:36:47 +02:00
QJsonObject exportLegendToJson( const QgsRenderContext &context );
2019-03-04 15:02:49 +00:00
%Docstring
Renders the legend in a ``json`` object.
.. versionadded:: 3.8
%End
static void setNodeLegendStyle( QgsLayerTreeNode *node, QgsLegendStyle::Style style );
2019-01-08 18:23:49 -05:00
%Docstring
2019-01-10 09:38:25 +10:00
Sets the ``style`` of a ``node``.
.. seealso:: :py:func:`nodeLegendStyle`
2019-01-08 18:23:49 -05:00
%End
static QgsLegendStyle::Style nodeLegendStyle( QgsLayerTreeNode *node, QgsLayerTreeModel *model );
2019-01-08 18:23:49 -05:00
%Docstring
2019-01-10 09:38:25 +10:00
Returns the style for the given ``node``, within the specified ``model``.
.. seealso:: :py:func:`setNodeLegendStyle`
2019-01-08 18:23:49 -05:00
%End
};
2017-05-14 09:48:41 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgslegendrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/