QGIS/python/core/auto_generated/layout/qgslayoutitemlegend.sip.in

515 lines
12 KiB
Plaintext
Raw Normal View History

2017-10-24 17:50:58 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutitemlegend.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsLegendModel : QgsLayerTreeModel
{
%Docstring
2017-12-15 10:36:55 -04:00
Item model implementation based on layer tree model for layout legend.
2017-10-24 17:50:58 +10:00
2017-12-15 10:36:55 -04:00
Overrides some functionality of QgsLayerTreeModel to better fit the needs of layout legends.
2017-10-24 17:50:58 +10:00
.. versionadded:: 2.6
%End
%TypeHeaderCode
#include "qgslayoutitemlegend.h"
%End
public:
QgsLegendModel( QgsLayerTree *rootNode, QObject *parent /TransferThis/ = 0 );
%Docstring
Construct the model based on the given layer tree
%End
virtual QVariant data( const QModelIndex &index, int role ) const;
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
};
class QgsLayoutItemLegend : QgsLayoutItem
{
%Docstring
2017-12-15 10:36:55 -04:00
A layout item subclass for map legends.
2017-10-24 17:50:58 +10:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgslayoutitemlegend.h"
%End
public:
QgsLayoutItemLegend( QgsLayout *layout );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsLayoutItemLegend, with the specified parent ``layout``.
2017-10-24 17:50:58 +10:00
%End
static QgsLayoutItemLegend *create( QgsLayout *layout ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a new legend item for the specified ``layout``.
The caller takes responsibility for deleting the returned object.
2017-10-24 17:50:58 +10:00
%End
virtual int type() const;
virtual QIcon icon() const;
2017-10-24 17:50:58 +10:00
virtual QString displayName() const;
void adjustBoxSize();
%Docstring
2017-12-15 10:36:55 -04:00
Sets the legend's item bounds to fit the whole legend content.
2017-10-24 17:50:58 +10:00
%End
void setResizeToContents( bool enabled );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether the legend should automatically resize to fit its contents.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param enabled: set to false to disable automatic resizing. The legend frame will not
be expanded to fit legend items, and items may be cropped from display.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`resizeToContents`
2017-10-24 17:50:58 +10:00
%End
bool resizeToContents() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether the legend should automatically resize to fit its contents.
.. seealso:: :py:func:`setResizeToContents`
2017-10-24 17:50:58 +10:00
%End
QgsLegendModel *model();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the legend model.
2017-10-24 17:50:58 +10:00
%End
void setAutoUpdateModel( bool autoUpdate );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether the legend content should auto update to reflect changes in the project's
layer tree.
.. seealso:: :py:func:`autoUpdateModel`
2017-10-24 17:50:58 +10:00
%End
bool autoUpdateModel() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether the legend content should auto update to reflect changes in the project's
layer tree.
.. seealso:: :py:func:`setAutoUpdateModel`
2017-10-24 17:50:58 +10:00
%End
void setLegendFilterByMapEnabled( bool enabled );
%Docstring
2017-12-15 10:36:55 -04:00
Set whether legend items should be filtered to show just the ones visible in the associated map.
.. seealso:: :py:func:`legendFilterByMapEnabled`
2017-10-24 17:50:58 +10:00
%End
bool legendFilterByMapEnabled() const;
%Docstring
2017-12-15 10:36:55 -04:00
Find out whether legend items are filtered to show just the ones visible in the associated map
.. seealso:: :py:func:`setLegendFilterByMapEnabled`
2017-10-24 17:50:58 +10:00
%End
void setLegendFilterOutAtlas( bool doFilter );
%Docstring
2017-12-15 10:36:55 -04:00
When set to true, during an atlas rendering, it will filter out legend elements
where features are outside the current atlas feature.
.. seealso:: :py:func:`legendFilterOutAtlas`
2017-10-24 17:50:58 +10:00
%End
bool legendFilterOutAtlas() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether to filter out legend elements outside of the current atlas feature.
.. seealso:: :py:func:`setLegendFilterOutAtlas`
2017-10-24 17:50:58 +10:00
%End
void setTitle( const QString &title );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the legend ``title``.
.. seealso:: :py:func:`title`
2017-10-24 17:50:58 +10:00
%End
QString title() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the legend title.
.. seealso:: :py:func:`setTitle`
2017-10-24 17:50:58 +10:00
%End
Qt::AlignmentFlag titleAlignment() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the alignment of the legend title.
.. seealso:: :py:func:`setTitleAlignment`
2017-10-24 17:50:58 +10:00
%End
void setTitleAlignment( Qt::AlignmentFlag alignment );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``alignment`` of the legend title.
.. seealso:: :py:func:`titleAlignment`
2017-10-24 17:50:58 +10:00
%End
QgsLegendStyle &rstyle( QgsLegendStyle::Style s );
%Docstring
2017-12-15 10:36:55 -04:00
Returns reference to modifiable legend style.
2017-10-24 17:50:58 +10:00
%End
QgsLegendStyle style( QgsLegendStyle::Style s ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns legend style.
2017-10-24 17:50:58 +10:00
%End
void setStyle( QgsLegendStyle::Style component, const QgsLegendStyle &style );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the style of ``component`` to ``style`` for the legend.
2017-10-24 17:50:58 +10:00
%End
QFont styleFont( QgsLegendStyle::Style component ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the font settings for a legend ``component``.
.. seealso:: :py:func:`setStyleFont`
2017-10-24 17:50:58 +10:00
%End
void setStyleFont( QgsLegendStyle::Style component, const QFont &font );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the style ``font`` for a legend ``component``.
.. seealso:: :py:func:`styleFont`
2017-10-24 17:50:58 +10:00
%End
void setStyleMargin( QgsLegendStyle::Style component, double margin );
%Docstring
2017-12-15 10:36:55 -04:00
Set the ``margin`` for a legend ``component``.
2017-10-24 17:50:58 +10:00
%End
void setStyleMargin( QgsLegendStyle::Style component, QgsLegendStyle::Side side, double margin );
%Docstring
2017-12-15 10:36:55 -04:00
Set the ``margin`` for a particular ``side`` of a legend ``component``.
2017-10-24 17:50:58 +10:00
%End
double lineSpacing() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the spacing in-between lines in layout units.
.. seealso:: :py:func:`setLineSpacing`
2017-10-24 17:50:58 +10:00
%End
void setLineSpacing( double spacing );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``spacing`` in-between multiple lines.
.. seealso:: :py:func:`lineSpacing`
2017-10-24 17:50:58 +10:00
%End
double boxSpace() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the legend box space.
.. seealso:: :py:func:`setBoxSpace`
2017-10-24 17:50:58 +10:00
%End
void setBoxSpace( double space );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the legend box ``space``.
.. seealso:: :py:func:`boxSpace`
2017-10-24 17:50:58 +10:00
%End
double columnSpace() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the legend column spacing.
.. seealso:: :py:func:`setColumnSpace`
2017-10-24 17:50:58 +10:00
%End
void setColumnSpace( double spacing );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the legend column ``spacing``.
.. seealso:: :py:func:`columnSpace`
2017-10-24 17:50:58 +10:00
%End
QColor fontColor() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the legend font color.
.. seealso:: :py:func:`setFontColor`
2017-10-24 17:50:58 +10:00
%End
void setFontColor( const QColor &color );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the legend font ``color``.
.. seealso:: :py:func:`fontColor`
2017-10-24 17:50:58 +10:00
%End
double symbolWidth() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the legend symbol width.
.. seealso:: :py:func:`setSymbolWidth`
2017-10-24 17:50:58 +10:00
%End
void setSymbolWidth( double width );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the legend symbol ``width``.
.. seealso:: :py:func:`symbolWidth`
2017-10-24 17:50:58 +10:00
%End
double symbolHeight() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the legend symbol height.
.. seealso:: :py:func:`setSymbolHeight`
2017-10-24 17:50:58 +10:00
%End
void setSymbolHeight( double height );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the legend symbol ``height``.
.. seealso:: :py:func:`symbolHeight`
2017-10-24 17:50:58 +10:00
%End
double wmsLegendWidth() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the WMS legend width.
.. seealso:: :py:func:`setWmsLegendWidth`
2017-10-24 17:50:58 +10:00
%End
void setWmsLegendWidth( double width );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the WMS legend ``width``.
.. seealso:: :py:func:`wmsLegendWidth`
2017-10-24 17:50:58 +10:00
%End
double wmsLegendHeight() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the WMS legend height.
.. seealso:: :py:func:`setWmsLegendHeight`
2017-10-24 17:50:58 +10:00
%End
void setWmsLegendHeight( double height );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the WMS legend ``height``.
.. seealso:: :py:func:`wmsLegendHeight`
2017-10-24 17:50:58 +10:00
%End
void setWrapString( const QString &string );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the legend text wrapping ``string``.
.. seealso:: :py:func:`wrapString`
2017-10-24 17:50:58 +10:00
%End
QString wrapString() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the legend text wrapping string.
.. seealso:: :py:func:`setWrapString`
2017-10-24 17:50:58 +10:00
%End
int columnCount() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the legend column count.
.. seealso:: :py:func:`setColumnCount`
2017-10-24 17:50:58 +10:00
%End
void setColumnCount( int count );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the legend column ``count``.
.. seealso:: :py:func:`columnCount`
2017-10-24 17:50:58 +10:00
%End
bool splitLayer() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether the legend items from a single layer can be split
over multiple columns.
.. seealso:: :py:func:`setSplitLayer`
2017-10-24 17:50:58 +10:00
%End
void setSplitLayer( bool enabled );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether the legend items from a single layer can be split
over multiple columns.
.. seealso:: :py:func:`splitLayer`
2017-10-24 17:50:58 +10:00
%End
bool equalColumnWidth() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether column widths should be equalized.
.. seealso:: :py:func:`setEqualColumnWidth`
2017-10-24 17:50:58 +10:00
%End
void setEqualColumnWidth( bool equalize );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether column widths should be equalized.
.. seealso:: :py:func:`equalColumnWidth`
2017-10-24 17:50:58 +10:00
%End
bool drawRasterStroke() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether a stroke will be drawn around raster symbol items.
.. seealso:: :py:func:`setDrawRasterStroke`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`rasterStrokeColor`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`rasterStrokeWidth`
2017-10-24 17:50:58 +10:00
%End
void setDrawRasterStroke( bool enabled );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether a stroke will be drawn around raster symbol items.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param enabled: set to true to draw borders
.. seealso:: :py:func:`drawRasterStroke`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setRasterStrokeColor`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setRasterStrokeWidth`
2017-10-24 17:50:58 +10:00
%End
QColor rasterStrokeColor() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the stroke color for the stroke drawn around raster symbol items. The stroke is
only drawn if drawRasterStroke() is true.
.. seealso:: :py:func:`setRasterStrokeColor`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`drawRasterStroke`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`rasterStrokeWidth`
2017-10-24 17:50:58 +10:00
%End
void setRasterStrokeColor( const QColor &color );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the stroke ``color`` for the stroke drawn around raster symbol items. The stroke is
only drawn if drawRasterStroke() is true.
.. seealso:: :py:func:`rasterStrokeColor`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setDrawRasterStroke`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setRasterStrokeWidth`
2017-10-24 17:50:58 +10:00
%End
double rasterStrokeWidth() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the stroke width (in layout units) for the stroke drawn around raster symbol items. The stroke is
only drawn if drawRasterStroke() is true.
.. seealso:: :py:func:`setRasterStrokeWidth`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`drawRasterStroke`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`rasterStrokeColor`
2017-10-24 17:50:58 +10:00
%End
void setRasterStrokeWidth( double width );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the stroke width for the stroke drawn around raster symbol items. The stroke is
only drawn if drawRasterStroke() is true.
.. seealso:: :py:func:`rasterStrokeWidth`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setDrawRasterStroke`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setRasterStrokeColor`
2017-10-24 17:50:58 +10:00
%End
void setLinkedMap( QgsLayoutItemMap *map );
2017-10-24 17:50:58 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``map`` to associate with the legend.
.. seealso:: :py:func:`linkedMap`
2017-10-24 17:50:58 +10:00
%End
QgsLayoutItemMap *linkedMap() const;
2017-10-24 17:50:58 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the associated map.
.. seealso:: :py:func:`setLinkedMap`
2017-10-24 17:50:58 +10:00
%End
void updateLegend();
%Docstring
2017-12-15 10:36:55 -04:00
Updates the model and all legend entries.
2017-10-24 17:50:58 +10:00
%End
void updateFilterByMap( bool redraw = true );
%Docstring
2017-12-15 10:36:55 -04:00
Updates the legend content when filtered by map.
2017-10-24 17:50:58 +10:00
%End
const QgsLegendSettings &legendSettings() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the legend's renderer settings object.
2017-10-24 17:50:58 +10:00
%End
virtual void paint( QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget );
virtual void finalizeRestoreFromXml();
2017-10-24 17:50:58 +10:00
public slots:
2017-12-31 14:53:14 +10:00
virtual void refresh();
2017-10-24 17:50:58 +10:00
virtual void refreshDataDefinedProperty( const QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
protected:
virtual void draw( QgsLayoutItemRenderContext &context );
2017-10-24 17:50:58 +10:00
2017-10-24 18:01:18 +10:00
virtual bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const;
virtual bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context );
2017-10-24 17:50:58 +10:00
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutitemlegend.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/