17#ifndef QGSLAYOUTITEMMAPITEM_H
18#define QGSLAYOUTITEMMAPITEM_H
58 virtual void draw( QPainter *painter ) = 0;
65 virtual bool writeXml( QDomElement &element, QDomDocument &document,
const QgsReadWriteContext &context )
const;
72 virtual bool readXml(
const QDomElement &element,
const QDomDocument &doc,
const QgsReadWriteContext &context );
82 virtual void finalizeRestoreFromXml();
99 QString
id()
const {
return mUuid; }
105 void setName(
const QString &name );
111 QString name()
const;
117 virtual void setEnabled(
bool enabled );
123 bool enabled()
const;
128 virtual bool usesAdvancedEffects()
const;
243 int size()
const {
return mItems.size(); }
250 virtual bool writeXml( QDomElement &element, QDomDocument &doc,
const QgsReadWriteContext &context )
const;
267 virtual void finalizeRestoreFromXml();
276 void drawItems( QPainter *painter,
bool ignoreStacking =
true );
282 bool containsAdvancedEffects()
const;
289 bool hasEnabledItems()
const;
314 void removeItem(
const QString &itemId );
322 void moveItemUp(
const QString &itemId );
330 void moveItemDown(
const QString &itemId );
347 QList< QgsLayoutItemMapItem * > asList()
const;
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
A collection of map items which are drawn above the map content in a QgsLayoutItemMap.
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 'Layo...
QList< QgsLayoutItemMapItem * > mItems
int size() const
Returns the number of items in the stack.
An item which is drawn inside a QgsLayoutItemMap, e.g., a grid or map overview.
QString id() const
Returns the unique id for the map item.
StackingPosition
Item stacking position, specifies where the in the map's stack the item should be rendered.
@ StackBelowMapLabels
Render above all map layers, but below map labels.
@ StackAboveMapLabels
Render above all map layers and labels.
@ StackBelowMapLayer
Render below a specific map layer (see stackingLayer())
@ StackAboveMapLayer
Render above a specific map layer (see stackingLayer())
@ StackBelowMap
Render below all map layers.
QString mName
Friendly display name.
QgsMapLayerRef mStackingLayer
bool mEnabled
True if item is to be displayed on map.
void setStackingPosition(StackingPosition position)
Sets the item's stacking position, which specifies where the in the map's stack the item should be re...
StackingPosition stackingPosition() const
Returns the item's stacking position, which specifies where the in the map's stack the item should be...
virtual void draw(QPainter *painter)=0
Draws the item on to a destination painter.
Layout graphical items for displaying a map.
A base class for objects which belong to a layout.
QgsExpressionContext createExpressionContext() const override
Creates an expression context relating to the objects' current state.
Base class for all map layer types.
The class is used as a container of context for various read/write operations on other objects.
An interface for classes which can visit style entity (e.g.