QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
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
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
@ StackAboveMapLayer
Render above a specific map layer (see stackingLayer())
@ StackBelowMapLayer
Render below a specific map layer (see stackingLayer())
The class is used as a container of context for various read/write operations on other objects.
QString mName
Friendly display name.
An item which is drawn inside a QgsLayoutItemMap, e.g., a grid or map overview.
An interface for classes which can visit style entity (e.g. symbol) nodes (using the visitor pattern)...
QString id() const
Returns the unique id for the map item.
A collection of map items which are drawn above the map content in a QgsLayoutItemMap....
@ StackBelowMap
Render below all map layers.
void setStackingPosition(StackingPosition position)
Sets the item's stacking position, which specifies where the in the map's stack the item should be re...
bool mEnabled
True if item is to be displayed on map.
@ StackBelowMapLabels
Render above all map layers, but below map labels.
QgsExpressionContext createExpressionContext() const override
Creates an expression context relating to the objects' current state.
Layout graphical items for displaying a map.
QList< QgsLayoutItemMapItem * > mItems
StackingPosition stackingPosition() const
Returns the item's stacking position, which specifies where the in the map's stack the item should be...
int size() const
Returns the number of items in the stack.
@ StackAboveMapLabels
Render above all map layers and labels.
StackingPosition
Item stacking position, specifies where the in the map's stack the item should be rendered.
Base class for all map layer types. This is the base class for all map layer types (vector,...
QgsMapLayerRef mStackingLayer
A base class for objects which belong to a layout.