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

348 lines
9.4 KiB
Plaintext
Raw Normal View History

2017-10-21 14:37:54 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutitemmapitem.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsLayoutItemMapItem : QgsLayoutObject
{
%Docstring
An item which is drawn inside a QgsLayoutItemMap, e.g., a grid or map overview.
2017-12-15 10:36:55 -04:00
2017-10-21 14:37:54 +10:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgslayoutitemmapitem.h"
%End
public:
enum StackingPosition
{
StackBelowMap,
StackBelowMapLayer,
StackAboveMapLayer,
StackBelowMapLabels,
StackAboveMapLabels,
};
2017-10-21 14:37:54 +10:00
QgsLayoutItemMapItem( const QString &name, QgsLayoutItemMap *map );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsLayoutItemMapItem, attached to the specified ``map``.
2017-10-21 14:37:54 +10:00
2017-12-15 10:36:55 -04:00
The ``name`` argument gives a friendly display name for the item.
2017-10-21 14:37:54 +10:00
%End
virtual void draw( QPainter *painter ) = 0;
%Docstring
2017-12-15 10:36:55 -04:00
Draws the item on to a destination ``painter``.
2017-10-21 14:37:54 +10:00
%End
2017-10-24 12:02:57 +10:00
virtual bool writeXml( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const;
2017-10-21 14:37:54 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Stores map item state in a DOM element, where ``element`` is the DOM element
corresponding to a 'LayoutMap' tag.
.. seealso:: :py:func:`readXml`
2017-10-21 14:37:54 +10:00
%End
2017-10-24 12:02:57 +10:00
virtual bool readXml( const QDomElement &element, const QDomDocument &doc, const QgsReadWriteContext &context );
2017-10-21 14:37:54 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the map item state from a DOM document, where ``element`` is the DOM
node corresponding to a 'LayoutMapGrid' tag.
.. seealso:: :py:func:`writeXml`
%End
virtual void finalizeRestoreFromXml();
%Docstring
Called after all pending items have been restored from XML. Map items can use
this method to run steps which must take place after all items have been restored to the layout,
such as connecting to signals emitted by other items, which may not have existed in the layout
at the time readXml() was called. E.g. an overview can use this to connect to its linked
map item after restoration from XML.
.. seealso:: :py:func:`readXml`
2017-10-21 14:37:54 +10:00
%End
void setMap( QgsLayoutItemMap *map );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the corresponding layout ``map`` for the item.
.. seealso:: :py:func:`map`
2017-10-21 14:37:54 +10:00
%End
const QgsLayoutItemMap *map() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the layout item map for the item.
.. seealso:: :py:func:`setMap`
2017-10-21 14:37:54 +10:00
%End
QString id() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the unique id for the map item.
2017-10-21 14:37:54 +10:00
%End
void setName( const QString &name );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the friendly display ``name`` for the item.
.. seealso:: :py:func:`name`
2017-10-21 14:37:54 +10:00
%End
QString name() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the friendly display name for the item.
.. seealso:: :py:func:`setName`
2017-10-21 14:37:54 +10:00
%End
void setEnabled( bool enabled );
%Docstring
2019-02-26 19:54:09 +10:00
Controls whether the item will be drawn. Set ``enabled`` to ``True`` to enable drawing of the item.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`enabled`
2017-10-21 14:37:54 +10:00
%End
bool enabled() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether the item will be drawn.
.. seealso:: :py:func:`setEnabled`
2017-10-21 14:37:54 +10:00
%End
virtual bool usesAdvancedEffects() const;
%Docstring
2019-02-26 19:54:09 +10:00
Returns ``True`` if the item is drawn using advanced effects, such as blend modes.
%End
StackingPosition stackingPosition() const;
%Docstring
Returns the item's stacking position, which specifies where the in the map's
stack the item should be rendered.
.. seealso:: :py:func:`setStackingPosition`
.. seealso:: :py:func:`stackingLayer`
.. versionadded:: 3.6
%End
void setStackingPosition( StackingPosition position );
%Docstring
Sets the item's stacking ``position``, which specifies where the in the map's
stack the item should be rendered.
.. seealso:: :py:func:`stackingPosition`
.. seealso:: :py:func:`setStackingLayer`
.. versionadded:: 3.6
%End
QgsMapLayer *stackingLayer() const;
%Docstring
Returns the item's stacking layer, which specifies where the in the map's
stack the item should be rendered.
This setting is only used when stackingPosition() is StackBelowMapLayer or
StackAboveMapLayer.
.. seealso:: :py:func:`setStackingLayer`
.. seealso:: :py:func:`stackingPosition`
.. versionadded:: 3.6
%End
void setStackingLayer( QgsMapLayer *layer );
%Docstring
Sets the item's stacking ``layer``, which specifies where the in the map's
stack the item should be rendered.
This setting is only used when stackingPosition() is StackBelowMapLayer or
StackAboveMapLayer.
.. seealso:: :py:func:`stackingLayer`
.. seealso:: :py:func:`setStackingPosition`
.. versionadded:: 3.6
2017-10-21 14:37:54 +10:00
%End
protected:
};
2017-10-21 14:37:54 +10:00
class QgsLayoutItemMapItemStack
{
%Docstring
A collection of map items which are drawn above the map content in a
2017-12-19 11:43:52 -04:00
:py:class:`QgsLayoutItemMap`. The item stack controls which items are drawn and the
2017-12-15 10:36:55 -04:00
order they are drawn in.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsLayoutItemMapItem`
2018-05-28 11:31:08 -04:00
.. versionadded:: 3.0
2017-10-21 14:37:54 +10:00
%End
%TypeHeaderCode
#include "qgslayoutitemmapitem.h"
%End
public:
QgsLayoutItemMapItemStack( QgsLayoutItemMap *map );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsLayoutItemMapItemStack, attached to the
specified ``map``.
2017-10-21 14:37:54 +10:00
%End
virtual ~QgsLayoutItemMapItemStack();
int size() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the number of items in the stack.
2017-10-21 14:37:54 +10:00
%End
2017-10-24 12:02:57 +10:00
virtual bool writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) const;
2017-10-21 14:37:54 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Stores the state of the item stack in a DOM node, where ``element`` is the DOM element corresponding to a 'LayoutMap' tag.
2019-02-26 19:54:09 +10:00
Returns ``True`` if write was successful.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`readXml`
2017-10-21 14:37:54 +10:00
%End
2017-10-24 12:02:57 +10:00
virtual bool readXml( const QDomElement &element, const QDomDocument &doc, const QgsReadWriteContext &context ) = 0;
2017-10-21 14:37:54 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the item stack's state from a DOM document, where ``element`` is a DOM node corresponding to a 'LayoutMap' tag.
2019-02-26 19:54:09 +10:00
Returns ``True`` if read was successful.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`writeXml`
%End
virtual void finalizeRestoreFromXml();
%Docstring
Called after all pending items have been restored from XML. Map item stacks can use
this method to run steps which must take place after all items have been restored to the layout,
such as connecting to signals emitted by other items, which may not have existed in the layout
at the time readXml() was called. E.g. an overview can use this to connect to its linked
map item after restoration from XML.
.. seealso:: :py:func:`readXml`
2017-10-21 14:37:54 +10:00
%End
void drawItems( QPainter *painter, bool ignoreStacking = true );
2017-10-21 14:37:54 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Draws the items from the stack on a specified ``painter``.
2019-02-26 19:54:09 +10:00
If ``ignoreStacking`` is ``True``, then all items will be drawn, regardless
of their actual stacking position settings. If it is ``False``, only items
which are set to stack above the map item will be drawn.
2017-10-21 14:37:54 +10:00
%End
bool containsAdvancedEffects() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether any items within the stack contain advanced effects,
such as blending modes.
2017-10-21 14:37:54 +10:00
%End
protected:
void addItem( QgsLayoutItemMapItem *item /Transfer/ );
%Docstring
2017-12-15 10:36:55 -04:00
Adds a new map item to the stack and takes ownership of the item.
The item will be added to the end of the stack, and rendered
above any existing map items already present in the stack.
2017-10-21 14:37:54 +10:00
.. note::
After adding an item to the stack update()
2018-01-12 20:51:17 -04:00
should be called for the QgsLayoutItemMap to prevent rendering artifacts.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`removeItem`
2017-10-21 14:37:54 +10:00
%End
void removeItem( const QString &itemId );
%Docstring
2017-12-19 11:43:52 -04:00
Removes an item which matching ``itemId`` from the stack and deletes the corresponding :py:class:`QgsLayoutItemMapItem`
2017-12-15 10:36:55 -04:00
2017-10-21 14:37:54 +10:00
.. note::
After removing an item from the stack, update()
2018-01-12 20:51:17 -04:00
should be called for the QgsLayoutItemMap to prevent rendering artifacts.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`addItem`
2017-10-21 14:37:54 +10:00
%End
void moveItemUp( const QString &itemId );
%Docstring
2017-12-15 10:36:55 -04:00
Moves an item which matching ``itemId`` up the stack, causing it to be rendered above other items.
2017-10-21 14:37:54 +10:00
.. note::
After moving an item within the stack, update() should be
2018-01-12 20:51:17 -04:00
called for the QgsLayoutItemMap to redraw the map with the new item stack order.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`moveItemDown`
2017-10-21 14:37:54 +10:00
%End
void moveItemDown( const QString &itemId );
%Docstring
2017-12-15 10:36:55 -04:00
Moves an item which matching ``itemId`` up the stack, causing it to be rendered above other items.
2017-10-21 14:37:54 +10:00
.. note::
After moving an item within the stack, update() should be
2018-01-12 20:51:17 -04:00
called for the QgsLayoutItemMap to redraw the map with the new item stack order.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`moveItemUp`
2017-10-21 14:37:54 +10:00
%End
QgsLayoutItemMapItem *item( const QString &itemId ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a reference to an item which matching ``itemId`` within the stack.
2017-10-21 14:37:54 +10:00
%End
QgsLayoutItemMapItem *item( int index ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a reference to the item at the specified ``index`` within the stack.
2017-10-21 14:37:54 +10:00
%End
QList< QgsLayoutItemMapItem * > asList() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of QgsLayoutItemMapItems contained by the stack.
2017-10-21 14:37:54 +10:00
%End
protected:
void removeItems();
%Docstring
2017-12-15 10:36:55 -04:00
Clears the item stack and deletes all QgsLayoutItemMapItems contained
by the stack
2017-10-21 14:37:54 +10:00
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutitemmapitem.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/