|
QGIS API Documentation 3.99.0-Master (2fe06baccd8)
|
A collection of map items which are drawn above the map content in a QgsLayoutItemMap. More...
#include <qgslayoutitemmapitem.h>

Public Member Functions | |
| QgsLayoutItemMapItemStack (QgsLayoutItemMap *map) | |
| Constructor for QgsLayoutItemMapItemStack, attached to the specified map. | |
| virtual | ~QgsLayoutItemMapItemStack () |
| bool | containsAdvancedEffects () const |
| Returns whether any items within the stack contain advanced effects, such as blending modes. | |
| void | drawItems (QPainter *painter, bool ignoreStacking=true) |
| Draws the items from the stack on a specified painter. | |
| virtual void | finalizeRestoreFromXml () |
| Called after all pending items have been restored from XML. | |
| bool | hasEnabledItems () const |
Returns true if the stack has any currently enabled items. | |
| QgsLayoutItemMapItem * | item (int index) const |
| Returns a reference to the item at the specified index within the stack. | |
| virtual bool | readXml (const QDomElement &element, const QDomDocument &doc, const QgsReadWriteContext &context)=0 |
| Sets the item stack's state from a DOM document, where element is a DOM node corresponding to a 'LayoutMap' tag. | |
| int | size () const |
| Returns the number of items in the stack. | |
| virtual bool | writeXml (QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context) const |
| Stores the state of the item stack in a DOM node, where element is the DOM element corresponding to a 'LayoutMap' tag. | |
Protected Member Functions | |
| void | addItem (QgsLayoutItemMapItem *item) |
| Adds a new map item to the stack and takes ownership of the item. | |
| QList< QgsLayoutItemMapItem * > | asList () const |
| Returns a list of QgsLayoutItemMapItems contained by the stack. | |
| QgsLayoutItemMapItem * | item (const QString &itemId) const |
| Returns a reference to an item which matching itemId within the stack. | |
| void | moveItemDown (const QString &itemId) |
| Moves an item which matching itemId up the stack, causing it to be rendered above other items. | |
| void | moveItemUp (const QString &itemId) |
| Moves an item which matching itemId up the stack, causing it to be rendered above other items. | |
| QgsLayoutItemMapItem & | operator[] (int index) |
| Returns a reference to an item at the specified index within the stack. | |
| void | removeItem (const QString &itemId) |
| Removes an item which matching itemId from the stack and deletes the corresponding QgsLayoutItemMapItem. | |
| void | removeItems () |
| Clears the item stack and deletes all QgsLayoutItemMapItems contained by the stack. | |
Protected Attributes | |
| QList< QgsLayoutItemMapItem * > | mItems |
| QgsLayoutItemMap * | mMap = nullptr |
A collection of map items which are drawn above the map content in a QgsLayoutItemMap.
The item stack controls which items are drawn and the order they are drawn in.
Definition at line 228 of file qgslayoutitemmapitem.h.
| QgsLayoutItemMapItemStack::QgsLayoutItemMapItemStack | ( | QgsLayoutItemMap * | map | ) |
Constructor for QgsLayoutItemMapItemStack, attached to the specified map.
Definition at line 149 of file qgslayoutitemmapitem.cpp.
|
virtual |
Definition at line 155 of file qgslayoutitemmapitem.cpp.
|
protected |
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.
Definition at line 160 of file qgslayoutitemmapitem.cpp.
|
protected |
Returns a list of QgsLayoutItemMapItems contained by the stack.
Definition at line 237 of file qgslayoutitemmapitem.cpp.
| bool QgsLayoutItemMapItemStack::containsAdvancedEffects | ( | ) | const |
Returns whether any items within the stack contain advanced effects, such as blending modes.
Definition at line 294 of file qgslayoutitemmapitem.cpp.
| void QgsLayoutItemMapItemStack::drawItems | ( | QPainter * | painter, |
| bool | ignoreStacking = true ) |
Draws the items from the stack on a specified painter.
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.
Definition at line 267 of file qgslayoutitemmapitem.cpp.
|
virtual |
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.
Definition at line 259 of file qgslayoutitemmapitem.cpp.
| bool QgsLayoutItemMapItemStack::hasEnabledItems | ( | ) | const |
Returns true if the stack has any currently enabled items.
Definition at line 306 of file qgslayoutitemmapitem.cpp.
|
protected |
Returns a reference to an item which matching itemId within the stack.
Definition at line 209 of file qgslayoutitemmapitem.cpp.
| QgsLayoutItemMapItem * QgsLayoutItemMapItemStack::item | ( | int | index | ) | const |
Returns a reference to the item at the specified index within the stack.
Definition at line 222 of file qgslayoutitemmapitem.cpp.
|
protected |
Moves an item which matching itemId up the stack, causing it to be rendered above other items.
Definition at line 193 of file qgslayoutitemmapitem.cpp.
|
protected |
Moves an item which matching itemId up the stack, causing it to be rendered above other items.
Definition at line 177 of file qgslayoutitemmapitem.cpp.
|
protected |
Returns a reference to an item at the specified index within the stack.
Definition at line 232 of file qgslayoutitemmapitem.cpp.
|
pure virtual |
Sets the item stack's state from a DOM document, where element is a DOM node corresponding to a 'LayoutMap' tag.
Returns true if read was successful.
Implemented in QgsLayoutItemMapGridStack, and QgsLayoutItemMapOverviewStack.
|
protected |
Removes an item which matching itemId from the stack and deletes the corresponding QgsLayoutItemMapItem.
Definition at line 165 of file qgslayoutitemmapitem.cpp.
|
protected |
Clears the item stack and deletes all QgsLayoutItemMapItems contained by the stack.
Definition at line 318 of file qgslayoutitemmapitem.cpp.
|
inline |
Returns the number of items in the stack.
Definition at line 243 of file qgslayoutitemmapitem.h.
|
virtual |
Stores the state of the item stack in a DOM node, where element is the DOM element corresponding to a 'LayoutMap' tag.
Returns true if write was successful.
Definition at line 248 of file qgslayoutitemmapitem.cpp.
|
protected |
Definition at line 351 of file qgslayoutitemmapitem.h.
|
protected |
Definition at line 353 of file qgslayoutitemmapitem.h.