QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgslayoutitemmap.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayoutitemmap.h
3  -------------------
4  begin : July 2017
5  copyright : (C) 2017 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSLAYOUTITEMMAP_H
18 #define QGSLAYOUTITEMMAP_H
19 
20 #include "qgis_core.h"
21 #include "qgslayoutitem.h"
22 #include "qgslayoutitemregistry.h"
23 #include "qgsmaplayerref.h"
25 #include "qgslayoutitemmapgrid.h"
28 #include "qgstemporalrangeobject.h"
29 
30 class QgsAnnotation;
32 
39 class CORE_EXPORT QgsLayoutItemMap : public QgsLayoutItem, public QgsTemporalRangeObject
40 {
41 
42  Q_OBJECT
43 
44  public:
45 
50  {
52 
60 
66  Auto
67  };
68 
74  {
75  ShowPartialLabels = 1 << 0,
76  ShowUnplacedLabels = 1 << 1,
77  };
78  Q_DECLARE_FLAGS( MapItemFlags, MapItemFlag )
79 
80 
83  explicit QgsLayoutItemMap( QgsLayout *layout );
84  ~QgsLayoutItemMap() override;
85 
86  int type() const override;
87  QIcon icon() const override;
88  QgsLayoutItem::Flags itemFlags() const override;
89 
95  QgsLayoutItemMap::MapItemFlags mapFlags() const;
96 
102  void setMapFlags( QgsLayoutItemMap::MapItemFlags flags );
103 
107  void assignFreeId();
108 
109  //overridden to show "Map 1" type names
110  QString displayName() const override;
111 
117  static QgsLayoutItemMap *create( QgsLayout *layout ) SIP_FACTORY;
118 
119  // for now, map items behave a bit differently and don't implement draw. TODO - see if we can avoid this
120  void paint( QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget ) override;
121  Q_DECL_DEPRECATED int numberExportLayers() const override SIP_DEPRECATED;
122  void startLayeredExport() override;
123  void stopLayeredExport() override;
124  bool nextExportPart() override;
125  ExportLayerBehavior exportLayerBehavior() const override;
126  QgsLayoutItem::ExportLayerDetail exportLayerDetails() const override;
127  void setFrameStrokeWidth( QgsLayoutMeasurement width ) override;
128 
134  double scale() const;
135 
143  void setScale( double scale, bool forceUpdate = true );
144 
152  void setExtent( const QgsRectangle &extent );
153 
161  void zoomToExtent( const QgsRectangle &extent );
162 
168  QgsRectangle extent() const;
169 
170 
178  QPolygonF visibleExtentPolygon() const;
179 
189 
198  QgsCoordinateReferenceSystem presetCrs() const { return mCrs; }
199 
207  void setCrs( const QgsCoordinateReferenceSystem &crs );
208 
217  bool keepLayerSet() const { return mKeepLayerSet; }
218 
227  void setKeepLayerSet( bool enabled ) { mKeepLayerSet = enabled; }
228 
235  QList<QgsMapLayer *> layers() const;
236 
243  void setLayers( const QList<QgsMapLayer *> &layers );
244 
249  bool keepLayerStyles() const { return mKeepLayerStyles; }
250 
255  void setKeepLayerStyles( bool enabled ) { mKeepLayerStyles = enabled; }
256 
261  QMap<QString, QString> layerStyleOverrides() const { return mLayerStyleOverrides; }
262 
267  void setLayerStyleOverrides( const QMap<QString, QString> &overrides );
268 
272  void storeCurrentLayerStyles();
273 
284  bool followVisibilityPreset() const { return mFollowVisibilityPreset; }
285 
289  void setFollowVisibilityPreset( bool follow );
290 
298  QString followVisibilityPresetName() const { return mFollowVisibilityPresetName; }
299 
306  void setFollowVisibilityPresetName( const QString &name );
307 
308  void moveContent( double dx, double dy ) override;
309  void setMoveContentPreviewOffset( double dx, double dy ) override;
310 
311  void zoomContent( double factor, QPointF point ) override;
312 
313 
315  bool containsWmsLayer() const;
316 
317  bool requiresRasterization() const override;
318  bool containsAdvancedEffects() const override;
319 
326  void setMapRotation( double rotation );
327 
336  double mapRotation( QgsLayoutObject::PropertyValueType valueType = QgsLayoutObject::EvaluatedValue ) const;
337 
342  void setDrawAnnotations( bool draw ) { mDrawAnnotations = draw; }
343 
348  bool drawAnnotations() const { return mDrawAnnotations; }
349 
350 
357  bool atlasDriven() const { return mAtlasDriven; }
358 
365  void setAtlasDriven( bool enabled );
366 
376  AtlasScalingMode atlasScalingMode() const { return mAtlasScalingMode; }
377 
387  void setAtlasScalingMode( AtlasScalingMode mode ) { mAtlasScalingMode = mode; }
388 
400 
408  void setAtlasMargin( double margin ) { mAtlasMargin = margin; }
409 
415  QgsLayoutItemMapGridStack *grids() { return mGridStack.get(); }
416 
421  QgsLayoutItemMapGrid *grid();
422 
429  QgsLayoutItemMapOverviewStack *overviews() { return mOverviewStack.get(); }
430 
436  QgsLayoutItemMapOverview *overview();
437 
448  QgsLayoutMeasurement labelMargin() const;
449 
460  void setLabelMargin( const QgsLayoutMeasurement &margin );
461 
463 
469  double mapUnitsToLayoutUnits() const;
470 
478  QgsMapSettings mapSettings( const QgsRectangle &extent, QSizeF size, double dpi, bool includeLayerSettings ) const;
479 
480  void finalizeRestoreFromXml() override;
481 
486  QList<QgsMapLayer *> layersToRender( const QgsExpressionContext *context = nullptr ) const;
487 
499  void addLabelBlockingItem( QgsLayoutItem *item );
500 
512  void removeLabelBlockingItem( QgsLayoutItem *item );
513 
525  bool isLabelBlockingItem( QgsLayoutItem *item ) const;
526 
531  QgsMapRendererJob::Errors renderingErrors() const { return mRenderingErrors; }
532 
533  bool accept( QgsStyleEntityVisitorInterface *visitor ) const override;
534 
547  void addRenderedFeatureHandler( QgsRenderedFeatureHandlerInterface *handler );
548 
555  void removeRenderedFeatureHandler( QgsRenderedFeatureHandlerInterface *handler );
556 
560  QTransform layoutToMapCoordsTransform() const;
561 
562  protected:
563 
564  void draw( QgsLayoutItemRenderContext &context ) override;
565  bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const override;
566  bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context ) override;
567 
569  bool isDrawing() const {return mDrawing;}
570 
571  // In case of annotations, the bounding rectangle can be larger than the map item rectangle
572  QRectF boundingRect() const override;
573 
575  QPolygonF transformedMapPolygon() const;
576 
578  QPointF mapToItemCoords( QPointF mapCoords ) const;
579 
583  QgsRectangle requestedExtent() const;
584 
585  signals:
586 
592  void extentChanged();
593 
599  void mapRotationChanged( double newRotation );
600 
602  void preparedForAtlas();
603 
608  void layerStyleOverridesChanged();
609 
618  void themeChanged( const QString &theme );
619 
620  public slots:
621 
622  void refresh() override;
623 
624  void invalidateCache() override;
625 
627  void updateBoundingRect();
628 
630 
631  private slots:
632  void layersAboutToBeRemoved( const QList<QgsMapLayer *> &layers );
633 
634  void painterJobFinished();
635 
636  void shapeChanged();
637 
638  void mapThemeChanged( const QString &theme );
639 
641  void currentMapThemeRenamed( const QString &theme, const QString &newTheme );
642 
644  void recreateCachedImageInBackground();
645 
646  void updateAtlasFeature();
647  private:
648 
649  QgsLayoutItemMap::MapItemFlags mMapFlags = nullptr;
650 
652  int mMapId = 1;
653 
654  std::unique_ptr< QgsLayoutItemMapGridStack > mGridStack;
655  std::unique_ptr< QgsLayoutItemMapOverviewStack > mOverviewStack;
656 
657  // Map region in map units really used for rendering
658  // It can be the same as mUserExtent, but it can be bigger in on dimension if mCalculate==Scale,
659  // so that full rectangle in paper is used.
660  QgsRectangle mExtent;
661 
664 
665  // Current temporary map region in map units. This is overwritten when atlas feature changes. It's also
666  // used when the user changes the map extent and an atlas preview is enabled. This allows the user
667  // to manually tweak each atlas preview page without affecting the actual original map extent.
668  QgsRectangle mAtlasFeatureExtent;
669 
670  // We have two images used for rendering/storing cached map images.
671  // the first (mCacheFinalImage) is used ONLY for storing the most recent completed map render. It's always
672  // used when drawing map item previews. The second (mCacheRenderingImage) is used temporarily while
673  // rendering a new preview image in the background. If (and only if) the background render completes, then
674  // mCacheRenderingImage is pushed into mCacheFinalImage, and used from then on when drawing the item preview.
675  // This ensures that something is always shown in the map item, even while refreshing the preview image in the
676  // background
677  std::unique_ptr< QImage > mCacheFinalImage;
678  std::unique_ptr< QImage > mCacheRenderingImage;
679  bool mUpdatesEnabled = true;
680 
682  bool mCacheInvalidated = true;
683 
685  int mNumCachedLayers;
686 
687  // Set to true if in state of drawing. Concurrent requests to draw method are returned if set to true
688  bool mDrawing = false;
689 
690  QTimer *mBackgroundUpdateTimer = nullptr;
691  double mPreviewScaleFactor = 0;
692 
693  bool mDrawingPreview = false;
694 
696  double mXOffset = 0.0;
698  double mYOffset = 0.0;
699 
700  double mLastRenderedImageOffsetX = 0.0;
701  double mLastRenderedImageOffsetY = 0.0;
702 
704  double mMapRotation = 0;
705 
709  double mEvaluatedMapRotation = 0;
710 
712  bool mKeepLayerSet = false;
713 
715  QList< QgsMapLayerRef > mLayers;
716 
717  bool mKeepLayerStyles = false;
719  QMap<QString, QString> mLayerStyleOverrides;
720 
722  mutable QString mCachedLayerStyleOverridesPresetName;
724  mutable QMap<QString, QString> mCachedPresetLayerStyleOverrides;
725 
730  bool mFollowVisibilityPreset = false;
731 
735  QString mFollowVisibilityPresetName;
736 
738  QString mLastEvaluatedThemeName;
739 
747  void drawMap( QPainter *painter, const QgsRectangle &extent, QSizeF size, double dpi );
748 
750  void connectUpdateSlot();
751 
753  void syncLayerSet();
754 
756  const QgsLayoutItemMapGrid *constFirstMapGrid() const;
757 
759  const QgsLayoutItemMapOverview *constFirstMapOverview() const;
760 
765  QList< QgsLabelBlockingRegion > createLabelBlockingRegions( const QgsMapSettings &mapSettings ) const;
766 
768  QRectF mCurrentRectangle;
770  bool mDrawAnnotations = true;
771 
773  bool mAtlasDriven = false;
775  AtlasScalingMode mAtlasScalingMode = Auto;
777  double mAtlasMargin = 0.10;
778 
779  std::unique_ptr< QPainter > mPainter;
780  std::unique_ptr< QgsMapRendererCustomPainterJob > mPainterJob;
781  bool mPainterCancelWait = false;
782 
783  QgsLayoutMeasurement mLabelMargin{ 0 };
784  QgsLayoutMeasurement mEvaluatedLabelMargin{ 0 };
785 
786  QStringList mBlockingLabelItemUuids;
787  QList< QPointer< QgsLayoutItem > > mBlockingLabelItems;
788 
790  QgsMapRendererJob::Errors mRenderingErrors;
791 
792  QList< QgsRenderedFeatureHandlerInterface * > mRenderedFeatureHandlers;
793 
794  std::unique_ptr< QgsMapRendererStagedRenderJob > mStagedRendererJob;
795 
796  void init();
797 
799  void updateToolTip();
800 
801  QString themeToRender( const QgsExpressionContext &context ) const;
802 
804  QMap<QString, QString> layerStyleOverridesToRender( const QgsExpressionContext &context ) const;
805 
807  QgsRectangle transformedExtent() const;
808 
810  void mapPolygon( const QgsRectangle &extent, QPolygonF &poly ) const;
811 
817  void transformShift( double &xShift, double &yShift ) const;
818 
819  void drawAnnotations( QPainter *painter );
820  void drawAnnotation( const QgsAnnotation *item, QgsRenderContext &context );
821  QPointF layoutMapPosForItem( const QgsAnnotation *item ) const;
822 
823  void drawMapFrame( QPainter *p );
824  void drawMapBackground( QPainter *p );
825 
826  enum PartType
827  {
828  Start,
829  Background,
830  Layer,
831  Grid,
832  OverviewMapExtent,
833  Frame,
834  SelectionBoxes,
835  End,
836  NotLayered,
837  };
838 
840  bool shouldDrawPart( PartType part ) const;
841 
842  PartType mCurrentExportPart = NotLayered;
843  QStringList mExportThemes;
844  QStringList::iterator mExportThemeIt;
845 
850  void refreshMapExtents( const QgsExpressionContext *context = nullptr );
851 
852  void refreshLabelMargin( bool updateItem );
853 
854  QgsRectangle computeAtlasRectangle();
855 
856  void createStagedRenderJob( const QgsRectangle &extent, const QSizeF size, double dpi );
857 
858  friend class QgsLayoutItemMapGrid;
860  friend class QgsLayoutItemLegend;
861  friend class TestQgsLayoutMap;
863  friend class QgsGeoPdfRenderedFeatureHandler;
864 
865 };
866 
867 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsLayoutItemMap::MapItemFlags )
868 
869 #endif //QGSLAYOUTITEMMAP_H
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:369
QgsLayoutItemMapGrid
An individual grid which is drawn above the map content in a QgsLayoutItemMap.
Definition: qgslayoutitemmapgrid.h:138
qgslayoutitemmapgrid.h
QgsLayoutItemMap::overviews
QgsLayoutItemMapOverviewStack * overviews()
Returns the map item's overview stack, which is used to control how overviews are drawn over the map'...
Definition: qgslayoutitemmap.h:429
QgsLayoutItem::writePropertiesToElement
virtual bool writePropertiesToElement(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const
Stores item state within an XML DOM element.
Definition: qgslayoutitem.cpp:1318
QgsLayoutItemMap::grids
QgsLayoutItemMapGridStack * grids()
Returns the map item's grid stack, which is used to control how grids are drawn over the map's conten...
Definition: qgslayoutitemmap.h:415
QgsReadWriteContext
Definition: qgsreadwritecontext.h:34
QgsLayoutItemMap::keepLayerStyles
bool keepLayerStyles() const
Returns whether current styles of layers should be overridden by previously stored styles.
Definition: qgslayoutitemmap.h:249
QgsLayoutItemMap::layerStyleOverrides
QMap< QString, QString > layerStyleOverrides() const
Returns stored overrides of styles for layers.
Definition: qgslayoutitemmap.h:261
QgsLayoutItemMap::atlasScalingMode
AtlasScalingMode atlasScalingMode() const
Returns the current atlas scaling mode.
Definition: qgslayoutitemmap.h:376
qgstemporalrangeobject.h
QgsLayoutItem::icon
virtual QIcon icon() const
Returns the item's icon.
Definition: qgslayoutitem.h:331
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:105
QgsLayoutItem::finalizeRestoreFromXml
virtual void finalizeRestoreFromXml()
Called after all pending items have been restored from XML.
Definition: qgslayoutitem.cpp:825
QgsLayoutItemRenderContext
Definition: qgslayoutitem.h:44
QgsLayoutItemMap::atlasDriven
bool atlasDriven() const
Returns whether the map extent is set to follow the current atlas feature.
Definition: qgslayoutitemmap.h:357
qgsmaprenderercustompainterjob.h
QgsRenderContext
Definition: qgsrendercontext.h:57
QgsLayoutItemMap::AtlasScalingMode
AtlasScalingMode
Scaling modes used for the serial rendering (atlas)
Definition: qgslayoutitemmap.h:49
QgsStyleEntityVisitorInterface
Definition: qgsstyleentityvisitor.h:33
QgsLayoutItem::refreshDataDefinedProperty
virtual void refreshDataDefinedProperty(QgsLayoutObject::DataDefinedProperty property=QgsLayoutObject::AllProperties)
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the...
Definition: qgslayoutitem.cpp:1082
QgsLayoutItem::numberExportLayers
virtual Q_DECL_DEPRECATED int numberExportLayers() const
Returns the number of layers that this item requires for exporting during layered exports (e....
Definition: qgslayoutitem.cpp:252
qgsmaprendererstagedrenderjob.h
QgsLayoutItemMap::drawAnnotations
bool drawAnnotations() const
Returns whether annotations are drawn within the map.
Definition: qgslayoutitemmap.h:348
QgsLayoutItemMap::followVisibilityPreset
bool followVisibilityPreset() const
Returns whether the map should follow a map theme.
Definition: qgslayoutitemmap.h:284
QgsRectangle
Definition: qgsrectangle.h:41
QgsLayoutItem::readPropertiesFromElement
virtual bool readPropertiesFromElement(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)
Sets item state from a DOM element.
Definition: qgslayoutitem.cpp:1323
QgsRenderedFeatureHandlerInterface
Definition: qgsrenderedfeaturehandlerinterface.h:46
QgsLayoutItem::draw
virtual void draw(QgsLayoutItemRenderContext &context)=0
Draws the item's contents using the specified item render context.
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsLayoutItem::type
int type() const override
Returns a unique graphics item type identifier.
Definition: qgslayoutitem.cpp:124
QgsLayoutItemLegend
Definition: qgslayoutitemlegend.h:113
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
QgsLayoutItem::containsAdvancedEffects
virtual bool containsAdvancedEffects() const
Returns true if the item contains contents with blend modes or transparency effects which can only be...
Definition: qgslayoutitem.cpp:926
QgsLayoutItemMap::isDrawing
bool isDrawing() const
True if a draw is already in progress.
Definition: qgslayoutitemmap.h:569
QgsLayoutObject::AllProperties
@ AllProperties
All properties for item.
Definition: qgslayoutobject.h:135
QgsAnnotation
Abstract base class for annotation items which are drawn over a map.
Definition: qgsannotation.h:49
qgslayoutitemmapoverview.h
qgslayoutitem.h
QgsCompositionConverter
QgsCompositionConverter class converts a QGIS 2.x composition to a QGIS 3.x layout.
Definition: qgscompositionconverter.h:54
QgsLayoutItem::accept
virtual bool accept(QgsStyleEntityVisitorInterface *visitor) const
Accepts the specified style entity visitor, causing it to visit all style entities associated with th...
Definition: qgslayoutitem.cpp:1166
QgsLayoutItemMap::setAtlasScalingMode
void setAtlasScalingMode(AtlasScalingMode mode)
Sets the current atlas scaling mode.
Definition: qgslayoutitemmap.h:387
QgsLayoutItem::requiresRasterization
virtual bool requiresRasterization() const
Returns true if the item is drawn in such a way that forces the whole layout to be rasterized when ex...
Definition: qgslayoutitem.cpp:931
QgsLayoutItem::invalidateCache
virtual void invalidateCache()
Forces a deferred update of any cached image the item uses.
Definition: qgslayoutitem.cpp:1180
QgsLayoutItem::zoomContent
virtual void zoomContent(double factor, QPointF point)
Zooms content of item.
Definition: qgslayoutitem.cpp:963
QgsLayoutItemMap::MapItemFlag
MapItemFlag
Various flags that affect drawing of map items.
Definition: qgslayoutitemmap.h:73
QgsLayoutItemMap::Fixed
@ Fixed
The current scale of the map is used for each feature of the atlas.
Definition: qgslayoutitemmap.h:51
QgsLayoutItem::paint
void paint(QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget) override
Handles preparing a paint surface for the layout item and painting the item's content.
Definition: qgslayoutitem.cpp:285
QgsLayoutItemMapOverviewStack
A collection of overviews which are drawn above the map content in a QgsLayoutItemMap....
Definition: qgslayoutitemmapoverview.h:42
QgsLayoutItem
Base class for graphical items within a QgsLayout.
Definition: qgslayoutitem.h:112
QgsLayoutItemMap::renderingErrors
QgsMapRendererJob::Errors renderingErrors() const
Returns map rendering errors.
Definition: qgslayoutitemmap.h:531
QgsCoordinateReferenceSystem
Definition: qgscoordinatereferencesystem.h:206
QgsLayoutItem::refresh
void refresh() override
Refreshes the item, causing a recalculation of any property overrides and recalculation of its positi...
Definition: qgslayoutitem.cpp:1172
QgsLayoutItemMapOverview
An individual overview which is drawn above the map content in a QgsLayoutItemMap,...
Definition: qgslayoutitemmapoverview.h:126
QgsLayoutItemMap
Layout graphical items for displaying a map.
Definition: qgslayoutitemmap.h:39
QgsLayoutItemMap::followVisibilityPresetName
QString followVisibilityPresetName() const
Preset name that decides which layers and layer styles are used for map rendering.
Definition: qgslayoutitemmap.h:298
QgsLayoutItem::itemFlags
virtual Flags itemFlags() const
Returns the item's flags, which indicate how the item behaves.
Definition: qgslayoutitem.cpp:129
QgsLayoutItemMap::Predefined
@ Predefined
A scale is chosen from the predefined scales.
Definition: qgslayoutitemmap.h:59
QgsLayout
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition: qgslayout.h:49
QgsLayoutItem::displayName
virtual QString displayName() const
Gets item display name.
Definition: qgslayoutitem.cpp:107
QgsLayoutItemMap::setKeepLayerStyles
void setKeepLayerStyles(bool enabled)
Sets whether current styles of layers should be overridden by previously stored styles.
Definition: qgslayoutitemmap.h:255
QgsLayoutItemMap::setAtlasMargin
void setAtlasMargin(double margin)
Sets the margin size (percentage) used when the map is in atlas mode.
Definition: qgslayoutitemmap.h:408
QgsLayoutObject::PropertyValueType
PropertyValueType
Specifies whether the value returned by a function should be the original, user set value,...
Definition: qgslayoutobject.h:204
qgsmaplayerref.h
QgsLayoutItem::moveContent
virtual void moveContent(double dx, double dy)
Moves the content of the item, by a specified dx and dy in layout units.
Definition: qgslayoutitem.cpp:953
QgsLayoutItem::setMoveContentPreviewOffset
virtual void setMoveContentPreviewOffset(double dx, double dy)
Sets temporary offset for the item, by a specified dx and dy in layout units.
Definition: qgslayoutitem.cpp:958
QgsMapRendererJob::Errors
QList< QgsMapRendererJob::Error > Errors
Definition: qgsmaprendererjob.h:261
QgsMapSettings
Definition: qgsmapsettings.h:86
QgsLayoutItemMapGridStack
A collection of grids which is drawn above the map content in a QgsLayoutItemMap. The grid stack cont...
Definition: qgslayoutitemmapgrid.h:44
qgslayoutitemregistry.h
QgsLayoutObject::EvaluatedValue
@ EvaluatedValue
Return the current evaluated value for the property.
Definition: qgslayoutobject.h:206
QgsLayoutItemMap::setKeepLayerSet
void setKeepLayerSet(bool enabled)
Sets whether the stored layer set should be used or the current layer set of the associated project.
Definition: qgslayoutitemmap.h:227
QgsLayoutItem::createExpressionContext
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Definition: qgslayoutitem.cpp:1159
QgsTemporalRangeObject
Definition: qgstemporalrangeobject.h:33
QgsLayoutMeasurement
This class provides a method of storing measurements for use in QGIS layouts using a variety of diffe...
Definition: qgslayoutmeasurement.h:33
QgsLayoutObject::DataDefinedProperty
DataDefinedProperty
Data defined properties for different item types.
Definition: qgslayoutobject.h:132
QgsLayoutItemMap::setDrawAnnotations
void setDrawAnnotations(bool draw)
Sets whether annotations are drawn within the map.
Definition: qgslayoutitemmap.h:342
QgsLayoutItemMap::keepLayerSet
bool keepLayerSet() const
Returns whether a stored layer set should be used or the current layer set from the project associate...
Definition: qgslayoutitemmap.h:217