17 #ifndef QGSLAYOUTITEMMAPITEM_H 18 #define QGSLAYOUTITEMMAPITEM_H 20 #include "qgis_core.h" 59 virtual void draw( QPainter *painter ) = 0;
66 virtual bool writeXml( QDomElement &element, QDomDocument &document,
const QgsReadWriteContext &context )
const;
73 virtual bool readXml(
const QDomElement &element,
const QDomDocument &doc,
const QgsReadWriteContext &context );
83 virtual void finalizeRestoreFromXml();
100 QString
id()
const {
return mUuid; }
106 void setName(
const QString &name );
112 QString name()
const;
118 virtual void setEnabled(
bool enabled );
124 bool enabled()
const;
129 virtual bool usesAdvancedEffects()
const;
245 int size()
const {
return mItems.size(); }
252 virtual bool writeXml( QDomElement &element, QDomDocument &doc,
const QgsReadWriteContext &context )
const;
259 virtual bool readXml(
const QDomElement &element,
const QDomDocument &doc,
const QgsReadWriteContext &context ) = 0;
269 virtual void finalizeRestoreFromXml();
278 void drawItems( QPainter *painter,
bool ignoreStacking =
true );
284 bool containsAdvancedEffects()
const;
291 bool hasEnabledItems()
const;
316 void removeItem(
const QString &itemId );
324 void moveItemUp(
const QString &itemId );
332 void moveItemDown(
const QString &itemId );
349 QList< QgsLayoutItemMapItem * > asList()
const;
364 #endif //QGSLAYOUTITEMMAPITEM_H The class is used as a container of context for various read/write operations on other objects...
Base class for all map layer types.
QString mName
Friendly display name.
QgsExpressionContext createExpressionContext() const override
Creates an expression context relating to the objects' current state.
StackingPosition
Item stacking position, specifies where the in the map's stack the item should be rendered...
An item which is drawn inside a QgsLayoutItemMap, e.g., a grid or map overview.
Render above a specific map layer (see stackingLayer())
A collection of map items which are drawn above the map content in a QgsLayoutItemMap.
An interface for classes which can visit style entity (e.g.
Render below a specific map layer (see stackingLayer())
int size() const
Returns the number of items in the stack.
Render above all map layers, but below map labels.
bool mEnabled
True if item is to be displayed on map.
Layout graphical items for displaying a map.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
StackingPosition stackingPosition() const
Returns the item's stacking position, which specifies where the in the map's stack the item should be...
QgsMapLayerRef mStackingLayer
void setStackingPosition(StackingPosition position)
Sets the item's stacking position, which specifies where the in the map's stack the item should be re...
QString id() const
Returns the unique id for the map item.
A base class for objects which belong to a layout.
QList< QgsLayoutItemMapItem *> mItems
Render above all map layers and labels.
Render below all map layers.