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 void setEnabled(
bool enabled );
124 bool enabled()
const;
129 virtual bool usesAdvancedEffects()
const;
225 int size()
const {
return mItems.size(); }
232 virtual bool writeXml( QDomElement &element, QDomDocument &doc,
const QgsReadWriteContext &context )
const;
239 virtual bool readXml(
const QDomElement &element,
const QDomDocument &doc,
const QgsReadWriteContext &context ) = 0;
249 virtual void finalizeRestoreFromXml();
258 void drawItems( QPainter *painter,
bool ignoreStacking =
true );
264 bool containsAdvancedEffects()
const;
284 void removeItem(
const QString &itemId );
292 void moveItemUp(
const QString &itemId );
300 void moveItemDown(
const QString &itemId );
322 QList< QgsLayoutItemMapItem * > asList()
const;
337 #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.
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.
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.
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.