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;
 
  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;
 
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.