2017-04-24 15:52:13 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/layertree/qgslayertreemodellegendnode.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-12 11:01:48 +07:00
|
|
|
|
2017-04-25 08:27:52 +02:00
|
|
|
|
|
|
|
|
2014-08-12 11:01:48 +07:00
|
|
|
class QgsLayerTreeModelLegendNode : QObject
|
|
|
|
{
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
The QgsLegendRendererItem class is abstract interface for legend items
|
|
|
|
returned from QgsMapLayerLegend implementation.
|
2017-04-24 15:52:13 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
The objects are used in QgsLayerTreeModel. Custom implementations may offer additional interactivity
|
|
|
|
and customized look.
|
2017-04-24 15:52:13 +02:00
|
|
|
|
|
|
|
.. versionadded:: 2.6
|
2014-08-12 11:01:48 +07:00
|
|
|
%End
|
2014-11-13 23:13:13 +01:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgslayertreemodellegendnode.h"
|
|
|
|
%End
|
2014-08-12 11:01:48 +07:00
|
|
|
public:
|
|
|
|
|
2014-09-05 11:28:08 +07:00
|
|
|
enum LegendNodeRoles
|
|
|
|
{
|
2017-06-08 15:50:48 +02:00
|
|
|
RuleKeyRole,
|
2017-04-24 15:52:13 +02:00
|
|
|
ParentRuleKeyRole
|
2014-09-05 11:28:08 +07:00
|
|
|
};
|
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
QgsLayerTreeLayer *layerNode() const;
|
|
|
|
%Docstring
|
2018-05-25 13:54:27 +10:00
|
|
|
Returns pointer to the parent layer node
|
2017-04-24 15:52:13 +02:00
|
|
|
%End
|
2014-09-25 12:00:45 +02:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
QgsLayerTreeModel *model() const;
|
|
|
|
%Docstring
|
2018-05-25 13:54:27 +10:00
|
|
|
Returns pointer to model owning this legend node
|
2017-04-24 15:52:13 +02:00
|
|
|
%End
|
2014-08-12 11:01:48 +07:00
|
|
|
|
|
|
|
virtual Qt::ItemFlags flags() const;
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2018-05-25 13:54:27 +10:00
|
|
|
Returns item flags associated with the item. Default implementation returns Qt.ItemIsEnabled.
|
2017-04-24 15:52:13 +02:00
|
|
|
%End
|
2014-08-12 11:01:48 +07:00
|
|
|
|
|
|
|
virtual QVariant data( int role ) const = 0;
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2018-05-25 13:54:27 +10:00
|
|
|
Returns data associated with the item. Must be implemented in derived class.
|
2017-04-24 15:52:13 +02:00
|
|
|
%End
|
2014-08-12 11:01:48 +07:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
virtual bool setData( const QVariant &value, int role );
|
|
|
|
%Docstring
|
2019-02-26 19:54:09 +10:00
|
|
|
Sets some data associated with the item. Default implementation does nothing and returns ``False``.
|
2017-04-24 15:52:13 +02:00
|
|
|
%End
|
2014-08-12 11:01:48 +07:00
|
|
|
|
2014-08-22 11:19:45 +07:00
|
|
|
virtual bool isEmbeddedInParent() const;
|
|
|
|
virtual void setEmbeddedInParent( bool embedded );
|
|
|
|
|
|
|
|
virtual QString userLabel() const;
|
2017-04-24 15:52:13 +02:00
|
|
|
virtual void setUserLabel( const QString &userLabel );
|
2014-08-22 11:19:45 +07:00
|
|
|
|
|
|
|
virtual bool isScaleOK( double scale ) const;
|
|
|
|
|
2014-09-25 12:00:45 +02:00
|
|
|
virtual void invalidateMapBasedData();
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Notification from model that information from associated map view has changed.
|
|
|
|
Default implementation does nothing. *
|
2017-04-24 15:52:13 +02:00
|
|
|
%End
|
2014-09-25 12:00:45 +02:00
|
|
|
|
2014-08-22 11:19:45 +07:00
|
|
|
struct ItemContext
|
|
|
|
{
|
2019-01-14 21:37:36 -05:00
|
|
|
QgsRenderContext *context;
|
2017-04-24 15:52:13 +02:00
|
|
|
QPainter *painter;
|
2014-08-22 11:19:45 +07:00
|
|
|
QPointF point;
|
|
|
|
double labelXOffset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ItemMetrics
|
|
|
|
{
|
|
|
|
QSizeF symbolSize;
|
|
|
|
QSizeF labelSize;
|
|
|
|
};
|
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
virtual ItemMetrics draw( const QgsLegendSettings &settings, ItemContext *ctx );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Entry point called from QgsLegendRenderer to do the rendering.
|
|
|
|
Default implementation calls drawSymbol() and drawSymbolText() methods.
|
2017-04-24 15:52:13 +02:00
|
|
|
|
2019-02-26 09:11:18 +10:00
|
|
|
If ctx is None, this is just first stage when preparing layout - without actual rendering.
|
2017-04-24 15:52:13 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Draws symbol on the left side of the item
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param settings: Legend layout configuration
|
2019-02-26 09:11:18 +10:00
|
|
|
:param ctx: Context for rendering - may be None if only doing layout without actual rendering
|
2017-12-15 10:36:55 -04:00
|
|
|
:param itemHeight: Minimal height of the legend item - used for correct positioning when rendering
|
|
|
|
|
|
|
|
:return: Real size of the symbol (may be bigger than "normal" symbol size from settings)
|
2017-04-24 15:52:13 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual QSizeF drawSymbolText( const QgsLegendSettings &settings, ItemContext *ctx, QSizeF symbolSize ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Draws label on the right side of the item
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param settings: Legend layout configuration
|
2019-02-26 09:11:18 +10:00
|
|
|
:param ctx: Context for rendering - may be nullptrnullptr if only doing layout without actual rendering
|
2018-05-27 16:42:41 +10:00
|
|
|
:param symbolSize: Real size of the associated symbol - used for correct positioning when rendering
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
|
|
:return: Size of the label (may span multiple lines)
|
2017-04-24 15:52:13 +02:00
|
|
|
%End
|
2014-08-22 11:19:45 +07:00
|
|
|
|
2014-09-05 11:28:08 +07:00
|
|
|
signals:
|
|
|
|
void dataChanged();
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
|
|
|
Emitted on internal data change so the layer tree model can forward the signal to views
|
|
|
|
%End
|
2014-09-05 11:28:08 +07:00
|
|
|
|
2014-08-12 11:01:48 +07:00
|
|
|
protected:
|
2017-04-24 15:52:13 +02:00
|
|
|
explicit QgsLayerTreeModelLegendNode( QgsLayerTreeLayer *nodeL, QObject *parent /TransferThis/ = 0 );
|
|
|
|
%Docstring
|
|
|
|
Construct the node with pointer to its parent layer node
|
|
|
|
%End
|
2014-08-22 11:19:45 +07:00
|
|
|
|
2017-06-15 16:47:56 +02:00
|
|
|
QgsRenderContext *createTemporaryRenderContext() const /Factory/;
|
|
|
|
%Docstring
|
|
|
|
Returns a temporary context or null if legendMapViewData are not valid
|
|
|
|
%End
|
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
protected:
|
2014-08-12 11:01:48 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-08-05 08:09:43 +02:00
|
|
|
class QgsSymbolLegendNode : QgsLayerTreeModelLegendNode
|
2014-08-12 11:01:48 +07:00
|
|
|
{
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Implementation of legend node interface for displaying preview of vector symbols and their labels
|
|
|
|
and allowing interaction with the symbol / renderer.
|
2017-04-24 15:52:13 +02:00
|
|
|
|
|
|
|
.. versionadded:: 2.6
|
|
|
|
%End
|
|
|
|
|
2014-08-12 11:01:48 +07:00
|
|
|
%TypeHeaderCode
|
2017-04-24 15:52:13 +02:00
|
|
|
#include "qgslayertreemodellegendnode.h"
|
2014-08-12 11:01:48 +07:00
|
|
|
%End
|
|
|
|
public:
|
2017-04-25 08:27:52 +02:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
QgsSymbolLegendNode( QgsLayerTreeLayer *nodeLayer, const QgsLegendSymbolItem &item, QObject *parent /TransferThis/ = 0 );
|
2017-04-25 08:27:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsSymbolLegendNode.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param nodeLayer: layer node
|
|
|
|
:param item: the legend symbol item
|
|
|
|
:param parent: attach a parent QObject to the legend node.
|
2017-04-25 08:27:52 +02:00
|
|
|
%End
|
2014-08-12 11:01:48 +07:00
|
|
|
|
|
|
|
virtual Qt::ItemFlags flags() const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2014-08-12 11:01:48 +07:00
|
|
|
virtual QVariant data( int role ) const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
virtual bool setData( const QVariant &value, int role );
|
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;
|
2014-08-22 11:19:45 +07:00
|
|
|
|
|
|
|
|
|
|
|
virtual void setEmbeddedInParent( bool embedded );
|
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
virtual void setUserLabel( const QString &userLabel );
|
2014-08-22 11:19:45 +07:00
|
|
|
|
|
|
|
virtual bool isScaleOK( double scale ) const;
|
2014-09-25 12:00:45 +02:00
|
|
|
|
|
|
|
virtual void invalidateMapBasedData();
|
2015-05-08 07:00:58 +10:00
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2016-02-02 19:46:18 +11:00
|
|
|
void setIconSize( QSize sz );
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the icon size
|
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
.. versionadded:: 2.10
|
|
|
|
%End
|
2015-05-08 07:00:58 +10:00
|
|
|
QSize iconSize() const;
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
.. versionadded:: 2.10
|
|
|
|
%End
|
2015-05-08 07:00:58 +10:00
|
|
|
|
|
|
|
QSize minimumIconSize() const;
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Calculates the minimum icon size to prevent cropping. When evaluating
|
|
|
|
the size for multiple icons it is more efficient to create a single
|
2017-12-19 11:43:52 -04:00
|
|
|
render context in advance and use the variant which accepts a :py:class:`QgsRenderContext`
|
2017-12-15 10:36:55 -04:00
|
|
|
argument.
|
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
.. versionadded:: 2.10
|
|
|
|
%End
|
|
|
|
|
|
|
|
QSize minimumIconSize( QgsRenderContext *context ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Calculates the minimum icon size to prevent cropping. When evaluating
|
|
|
|
the size for multiple icons it is more efficient to create a single
|
|
|
|
render context in advance and call this method instead of minimumIconSize().
|
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
.. versionadded:: 2.18
|
|
|
|
%End
|
2015-12-07 07:39:20 +11:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
const QgsSymbol *symbol() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the symbol used by the legend node.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSymbol`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
.. versionadded:: 2.14
|
|
|
|
%End
|
|
|
|
|
2018-11-27 11:15:30 +10:00
|
|
|
void setSymbol( QgsSymbol *symbol /Transfer/ );
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2018-11-27 11:15:30 +10:00
|
|
|
Sets the ``symbol`` to be used by the legend node. The symbol change is also propagated
|
2017-12-15 10:36:55 -04:00
|
|
|
to the associated vector layer's renderer.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param symbol: new symbol for node. Ownership is transferred.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`symbol`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
.. versionadded:: 2.14
|
2018-04-18 21:52:56 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
QString textOnSymbolLabel() const;
|
|
|
|
%Docstring
|
|
|
|
Returns label of text to be shown on top of the symbol.
|
|
|
|
|
|
|
|
.. versionadded:: 3.2
|
|
|
|
%End
|
|
|
|
|
|
|
|
void setTextOnSymbolLabel( const QString &label );
|
|
|
|
%Docstring
|
|
|
|
Sets label of text to be shown on top of the symbol.
|
|
|
|
|
|
|
|
.. versionadded:: 3.2
|
|
|
|
%End
|
|
|
|
|
|
|
|
QgsTextFormat textOnSymbolTextFormat() const;
|
|
|
|
%Docstring
|
|
|
|
Returns text format of the label to be shown on top of the symbol.
|
|
|
|
|
|
|
|
.. versionadded:: 3.2
|
|
|
|
%End
|
|
|
|
|
|
|
|
void setTextOnSymbolTextFormat( const QgsTextFormat &format );
|
|
|
|
%Docstring
|
|
|
|
Sets format of text to be shown on top of the symbol.
|
|
|
|
|
|
|
|
.. versionadded:: 3.2
|
2017-04-24 15:52:13 +02:00
|
|
|
%End
|
2015-12-08 06:32:23 +11:00
|
|
|
|
2015-12-07 07:39:20 +11:00
|
|
|
public slots:
|
|
|
|
|
|
|
|
void checkAllItems();
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Checks all items belonging to the same layer as this node.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`uncheckAllItems`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
2018-12-05 12:34:43 +01:00
|
|
|
.. seealso:: :py:func:`toggleAllItems`
|
|
|
|
|
2018-05-28 11:31:08 -04:00
|
|
|
.. versionadded:: 2.14
|
2017-04-24 15:52:13 +02:00
|
|
|
%End
|
2015-12-07 07:39:20 +11:00
|
|
|
|
|
|
|
void uncheckAllItems();
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Unchecks all items belonging to the same layer as this node.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`checkAllItems`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
2018-12-05 12:34:43 +01:00
|
|
|
.. seealso:: :py:func:`toggleAllItems`
|
|
|
|
|
2018-05-28 11:31:08 -04:00
|
|
|
.. versionadded:: 2.14
|
2018-12-05 12:34:43 +01:00
|
|
|
%End
|
|
|
|
|
|
|
|
void toggleAllItems();
|
|
|
|
%Docstring
|
|
|
|
Toggle all items belonging to the same layer as this node.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`checkAllItems`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`uncheckAllItems`
|
|
|
|
|
2018-12-07 08:07:18 +01:00
|
|
|
.. versionadded:: 3.6
|
2017-04-24 15:52:13 +02:00
|
|
|
%End
|
2015-12-07 07:39:20 +11:00
|
|
|
|
2014-08-22 11:19:45 +07:00
|
|
|
};
|
2014-08-12 11:01:48 +07:00
|
|
|
|
|
|
|
|
|
|
|
class QgsSimpleLegendNode : QgsLayerTreeModelLegendNode
|
|
|
|
{
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Implementation of legend node interface for displaying arbitrary label with icon.
|
2017-04-24 15:52:13 +02:00
|
|
|
|
|
|
|
.. versionadded:: 2.6
|
|
|
|
%End
|
|
|
|
|
2014-08-12 11:01:48 +07:00
|
|
|
%TypeHeaderCode
|
2017-04-24 15:52:13 +02:00
|
|
|
#include "qgslayertreemodellegendnode.h"
|
2014-08-12 11:01:48 +07:00
|
|
|
%End
|
|
|
|
public:
|
2017-04-25 08:27:52 +02:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
QgsSimpleLegendNode( QgsLayerTreeLayer *nodeLayer, const QString &label, const QIcon &icon = QIcon(), QObject *parent /TransferThis/ = 0, const QString &key = QString() );
|
2017-04-25 08:27:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsSimpleLegendNode.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param nodeLayer: layer node
|
|
|
|
:param label: label
|
|
|
|
:param icon: icon
|
|
|
|
:param parent: attach a parent QObject to the legend node.
|
|
|
|
:param key: the rule key
|
2017-04-25 08:27:52 +02:00
|
|
|
%End
|
2014-08-12 11:01:48 +07:00
|
|
|
|
|
|
|
virtual QVariant data( int role ) const;
|
2017-04-24 15:52:13 +02:00
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2014-08-12 11:01:48 +07:00
|
|
|
};
|
|
|
|
|
2014-08-22 11:19:45 +07:00
|
|
|
|
|
|
|
class QgsImageLegendNode : QgsLayerTreeModelLegendNode
|
|
|
|
{
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Implementation of legend node interface for displaying arbitrary raster image
|
2017-04-24 15:52:13 +02:00
|
|
|
|
|
|
|
.. versionadded:: 2.6
|
|
|
|
%End
|
|
|
|
|
2014-08-22 11:19:45 +07:00
|
|
|
%TypeHeaderCode
|
2017-04-24 15:52:13 +02:00
|
|
|
#include "qgslayertreemodellegendnode.h"
|
2014-08-22 11:19:45 +07:00
|
|
|
%End
|
|
|
|
public:
|
2017-04-25 08:27:52 +02:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
QgsImageLegendNode( QgsLayerTreeLayer *nodeLayer, const QImage &img, QObject *parent /TransferThis/ = 0 );
|
2017-04-25 08:27:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsImageLegendNode.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param nodeLayer: layer node
|
|
|
|
:param img: the image
|
|
|
|
:param parent: attach a parent QObject to the legend node.
|
2017-04-25 08:27:52 +02:00
|
|
|
%End
|
2014-08-22 11:19:45 +07:00
|
|
|
|
|
|
|
virtual QVariant data( int role ) const;
|
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;
|
|
|
|
|
2014-08-22 11:19:45 +07:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class QgsRasterSymbolLegendNode : QgsLayerTreeModelLegendNode
|
|
|
|
{
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Implementation of legend node interface for displaying raster legend entries
|
2017-04-24 15:52:13 +02:00
|
|
|
|
|
|
|
.. versionadded:: 2.6
|
|
|
|
%End
|
|
|
|
|
2014-08-22 11:19:45 +07:00
|
|
|
%TypeHeaderCode
|
2017-04-24 15:52:13 +02:00
|
|
|
#include "qgslayertreemodellegendnode.h"
|
2014-08-22 11:19:45 +07:00
|
|
|
%End
|
|
|
|
public:
|
2017-04-25 08:27:52 +02:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
QgsRasterSymbolLegendNode( QgsLayerTreeLayer *nodeLayer, const QColor &color, const QString &label, QObject *parent /TransferThis/ = 0 );
|
2017-04-25 08:27:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsRasterSymbolLegendNode.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param nodeLayer: layer node
|
|
|
|
:param color: color
|
|
|
|
:param label: label
|
|
|
|
:param parent: attach a parent QObject to the legend node.
|
2017-04-25 08:27:52 +02:00
|
|
|
%End
|
2014-08-22 11:19:45 +07:00
|
|
|
|
|
|
|
virtual QVariant data( int role ) const;
|
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;
|
|
|
|
|
|
|
|
|
2014-08-22 11:19:45 +07:00
|
|
|
};
|
2016-01-04 22:51:18 +11:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
|
2016-07-19 11:45:47 +10:00
|
|
|
class QgsWmsLegendNode : QgsLayerTreeModelLegendNode
|
2016-01-04 22:51:18 +11:00
|
|
|
{
|
2017-04-24 15:52:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Implementation of legend node interface for displaying WMS legend entries
|
2017-04-24 15:52:13 +02:00
|
|
|
|
|
|
|
.. versionadded:: 2.8
|
|
|
|
%End
|
|
|
|
|
2016-01-04 22:51:18 +11:00
|
|
|
%TypeHeaderCode
|
2017-04-24 15:52:13 +02:00
|
|
|
#include "qgslayertreemodellegendnode.h"
|
2016-01-04 22:51:18 +11:00
|
|
|
%End
|
|
|
|
public:
|
2016-07-19 11:45:47 +10:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
QgsWmsLegendNode( QgsLayerTreeLayer *nodeLayer, QObject *parent /TransferThis/ = 0 );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsWmsLegendNode.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param nodeLayer: layer node
|
|
|
|
:param parent: attach a parent QObject to the legend node.
|
2017-04-24 15:52:13 +02:00
|
|
|
%End
|
2016-01-04 22:51:18 +11:00
|
|
|
|
|
|
|
virtual QVariant data( int role ) const;
|
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;
|
2016-01-04 22:51:18 +11:00
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2016-01-04 22:51:18 +11:00
|
|
|
virtual void invalidateMapBasedData();
|
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2016-01-04 22:51:18 +11:00
|
|
|
};
|
2017-04-24 15:52:13 +02:00
|
|
|
|
2017-06-15 16:47:56 +02:00
|
|
|
|
|
|
|
class QgsDataDefinedSizeLegendNode : QgsLayerTreeModelLegendNode
|
|
|
|
{
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Produces legend node with a marker symbol
|
|
|
|
|
2017-06-15 16:47:56 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgslayertreemodellegendnode.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
QgsDataDefinedSizeLegendNode( QgsLayerTreeLayer *nodeLayer, const QgsDataDefinedSizeLegend &settings, QObject *parent /TransferThis/ = 0 );
|
|
|
|
%Docstring
|
|
|
|
Construct the node using QgsDataDefinedSizeLegend as definition of the node's appearance
|
|
|
|
%End
|
2017-06-26 12:18:34 +10:00
|
|
|
~QgsDataDefinedSizeLegendNode();
|
2017-06-15 16:47:56 +02:00
|
|
|
|
|
|
|
virtual QVariant data( int role ) const;
|
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-06-15 16:47:56 +02:00
|
|
|
virtual ItemMetrics draw( const QgsLegendSettings &settings, ItemContext *ctx );
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/layertree/qgslayertreemodellegendnode.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|