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

128 lines
4.0 KiB
Plaintext

/************************************************************************
* 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="Since 3.40. Use the variant which accepts a QgsRenderContext instead."/;
%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 *
************************************************************************/