A collection of map items which are drawn above the map content in a QgsLayoutItemMap.
More...
#include <qgslayoutitemmapitem.h>
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.
- See also
- QgsLayoutItemMapItem
- Since
- QGIS 3.0
Definition at line 230 of file qgslayoutitemmapitem.h.
◆ QgsLayoutItemMapItemStack()
◆ ~QgsLayoutItemMapItemStack()
QgsLayoutItemMapItemStack::~QgsLayoutItemMapItemStack |
( |
| ) |
|
|
virtual |
◆ addItem()
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.
- Note
- After adding an item to the stack update() should be called for the QgsLayoutItemMap to prevent rendering artifacts.
- See also
- removeItem()
Definition at line 157 of file qgslayoutitemmapitem.cpp.
◆ asList()
◆ containsAdvancedEffects()
bool QgsLayoutItemMapItemStack::containsAdvancedEffects |
( |
| ) |
const |
Returns whether any items within the stack contain advanced effects, such as blending modes.
Definition at line 291 of file qgslayoutitemmapitem.cpp.
◆ drawItems()
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 264 of file qgslayoutitemmapitem.cpp.
◆ finalizeRestoreFromXml()
void QgsLayoutItemMapItemStack::finalizeRestoreFromXml |
( |
| ) |
|
|
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.
- See also
- readXml()
Definition at line 256 of file qgslayoutitemmapitem.cpp.
◆ hasEnabledItems()
bool QgsLayoutItemMapItemStack::hasEnabledItems |
( |
| ) |
const |
◆ item() [1/2]
◆ item() [2/2]
◆ moveItemDown()
void QgsLayoutItemMapItemStack::moveItemDown |
( |
const QString & |
itemId | ) |
|
|
protected |
Moves an item which matching itemId up the stack, causing it to be rendered above other items.
- Note
- After moving an item within the stack, update() should be called for the QgsLayoutItemMap to redraw the map with the new item stack order.
- See also
- moveItemUp()
Definition at line 190 of file qgslayoutitemmapitem.cpp.
◆ moveItemUp()
void QgsLayoutItemMapItemStack::moveItemUp |
( |
const QString & |
itemId | ) |
|
|
protected |
Moves an item which matching itemId up the stack, causing it to be rendered above other items.
- Note
- After moving an item within the stack, update() should be called for the QgsLayoutItemMap to redraw the map with the new item stack order.
- See also
- moveItemDown()
Definition at line 174 of file qgslayoutitemmapitem.cpp.
◆ operator[]()
Returns a reference to an item at the specified index within the stack.
- See also
- item()
- Note
- not available in Python bindings
Definition at line 229 of file qgslayoutitemmapitem.cpp.
◆ readXml()
virtual bool QgsLayoutItemMapItemStack::readXml |
( |
const QDomElement & |
element, |
|
|
const QDomDocument & |
doc, |
|
|
const QgsReadWriteContext & |
context |
|
) |
| |
|
pure virtual |
◆ removeItem()
void QgsLayoutItemMapItemStack::removeItem |
( |
const QString & |
itemId | ) |
|
|
protected |
◆ removeItems()
void QgsLayoutItemMapItemStack::removeItems |
( |
| ) |
|
|
protected |
Clears the item stack and deletes all QgsLayoutItemMapItems contained by the stack.
Definition at line 315 of file qgslayoutitemmapitem.cpp.
◆ size()
int QgsLayoutItemMapItemStack::size |
( |
| ) |
const |
|
inline |
◆ writeXml()
bool QgsLayoutItemMapItemStack::writeXml |
( |
QDomElement & |
element, |
|
|
QDomDocument & |
doc, |
|
|
const QgsReadWriteContext & |
context |
|
) |
| const |
|
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.
- See also
- readXml()
Definition at line 245 of file qgslayoutitemmapitem.cpp.
◆ mItems
◆ mMap
The documentation for this class was generated from the following files: