QGIS API Documentation  2.99.0-Master (ae4d26a)
qgscomposition.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscomposition.h
3  -------------------
4  begin : January 2005
5  copyright : (C) 2005 by Radim Blazek
6  email : [email protected]
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 #ifndef QGSCOMPOSITION_H
17 #define QGSCOMPOSITION_H
18 
19 #include "qgis_core.h"
20 #include "qgis_sip.h"
21 #include "qgis.h"
22 #include <memory>
23 
24 #include <QDomDocument>
25 #include <QGraphicsScene>
26 #include <QLinkedList>
27 #include <QList>
28 #include <QPair>
29 #include <QSet>
30 #include <QUndoStack>
31 #include <QPrinter>
32 #include <QPainter>
33 
35 #include "qgscomposeritemcommand.h"
37 #include "qgsatlascomposition.h"
38 #include "qgscomposerobject.h"
39 #include "qgscomposeritem.h" // required for nested name
41 
42 class QgisApp;
43 class QgsComposerFrame;
44 class QgsComposerMap;
45 class QGraphicsRectItem;
46 class QDomElement;
47 class QgsComposerArrow;
48 class QgsComposerPolygon;
51 class QgsComposerHtml;
52 class QgsComposerTableV2;
53 class QgsComposerItem;
55 class QgsComposerLabel;
56 class QgsComposerLegend;
57 class QgsComposerMap;
58 class QgsComposerPicture;
60 class QgsComposerShape;
64 class QgsVectorLayer;
65 class QgsComposer;
66 class QgsFillSymbol;
67 class QgsComposerModel;
68 class QgsPaperItem;
69 
77 class CORE_EXPORT QgsComposition : public QGraphicsScene, public QgsExpressionContextGenerator
78 {
79  Q_OBJECT
80  Q_PROPERTY( QString name READ name WRITE setName NOTIFY nameChanged )
81 
82  public:
83 
85  enum PlotStyle
86  {
87  Preview = 0, // Use cache etc
88  Print, // Render well
89  Postscript // Fonts need different scaling!
90  };
91 
93  enum GridStyle
94  {
97  Crosses
98  };
99 
101  {
103  ZValueAbove
104  };
105 
107  {
109  Landscape
110  };
111 
115  explicit QgsComposition( QgsProject *project );
116 
119  {
120  AtlasOff, // Composition is not being controlled by an atlas
121  PreviewAtlas, // An atlas composition is being previewed in the app
122  ExportAtlas // The composition is being exported as an atlas
123  };
124 
125  ~QgsComposition();
126 
133  QgsProject *project() const;
134 
140  QString name() const { return mName; }
141 
147  void setName( const QString &name );
148 
158  void setPaperSize( double width, double height,
159  bool keepRelativeItemPosition = true );
160 
167  double paperHeight() const;
168 
175  double paperWidth() const;
176 
191  void resizePageToContents( double marginTop = 0.0, double marginRight = 0.0,
192  double marginBottom = 0.0, double marginLeft = 0.0 );
193 
205  void setResizeToContentsMargins( double marginTop, double marginRight,
206  double marginBottom, double marginLeft );
207 
219  void resizeToContentsMargins( double &marginTop SIP_OUT, double &marginRight SIP_OUT,
220  double &marginBottom SIP_OUT, double &marginLeft SIP_OUT ) const;
221 
226  double spaceBetweenPages() const { return mSpaceBetweenPages; }
227 
233  void setNumPages( const int pages );
234 
240  int numPages() const;
241 
252  bool pageIsEmpty( const int page ) const;
253 
262  bool shouldExportPage( const int page ) const;
263 
265  void setPageStyleSymbol( QgsFillSymbol *symbol );
267  QgsFillSymbol *pageStyleSymbol() { return mPageStyleSymbol; }
268 
273  QPointF positionOnPage( QPointF position ) const;
274 
279  int pageNumberForPoint( QPointF position ) const;
280 
285  void setStatusMessage( const QString &message );
286 
291  void updateSettings();
292 
293  void setSnapToGridEnabled( const bool b );
294  bool snapToGridEnabled() const {return mSnapToGrid;}
295 
296  void setGridVisible( const bool b );
297  bool gridVisible() const {return mGridVisible;}
298 
300  void setSnapLinesVisible( const bool visible );
301  bool snapLinesVisible() const {return mGuidesVisible;}
302 
303  void setAlignmentSnap( const bool s ) { mAlignmentSnap = s; }
304  bool alignmentSnap() const { return mAlignmentSnap; }
305 
306  void setSmartGuidesEnabled( const bool b ) { mSmartGuides = b; }
307  bool smartGuidesEnabled() const {return mSmartGuides;}
308 
317  void setPagesVisible( bool visible );
318 
326  bool pagesVisible() const { return mPagesVisible; }
327 
329  void clearSnapLines();
330 
331  void setSnapGridResolution( const double r );
332  double snapGridResolution() const {return mSnapGridResolution;}
333 
334  void setSnapGridOffsetX( const double offset );
335  double snapGridOffsetX() const {return mSnapGridOffsetX;}
336 
337  void setSnapGridOffsetY( const double offset );
338  double snapGridOffsetY() const {return mSnapGridOffsetY;}
339 
340  void setGridPen( const QPen &p );
341  QPen gridPen() const {return mGridPen;}
342 
343  void setGridStyle( const GridStyle s );
344  GridStyle gridStyle() const {return mGridStyle;}
345 
353  void setSnapTolerance( const int snapTolerance ) { mSnapTolerance = snapTolerance; }
354 
362  int snapTolerance() const { return mSnapTolerance; }
363 
370  void setBoundingBoxesVisible( const bool boundsVisible );
371 
378  bool boundingBoxesVisible() const { return mBoundingBoxesVisible; }
379 
381  QUndoStack *undoStack() { return mUndoStack; }
382 
389  QgsComposerItem *composerItemAt( QPointF position, const bool ignoreLocked = false ) const;
390 
398  QgsComposerItem *composerItemAt( QPointF position, const QgsComposerItem *belowItem, const bool ignoreLocked = false ) const;
399 
401  int pageNumberAt( QPointF position ) const;
402 
404  int itemPageNumber( const QgsComposerItem * ) const;
405 
411  QList<QgsComposerItem *> selectedComposerItems( const bool includeLockedItems = true );
412 
417  QList<const QgsComposerMap *> composerMapItems() const;
418 
424  template<class T> void composerItems( QList<T *> &itemList ) SIP_SKIP;
425 
433  template<class T> void composerItemsOnPage( QList<T *> &itemList, const int pageNumber ) const SIP_SKIP;
434 
439  const QgsComposerMap *getComposerMapById( const int id ) const;
440 
447  const QgsComposerItem *getComposerItemById( const QString &id ) const;
448 
453  const QgsComposerItem *getComposerItemByUuid( const QString &uuid ) const;
454 
455  int printResolution() const {return mPrintResolution;}
456  void setPrintResolution( const int dpi );
457 
458  bool printAsRaster() const {return mPrintAsRaster;}
459  void setPrintAsRaster( const bool enabled ) { mPrintAsRaster = enabled; }
460 
467  bool generateWorldFile() const { return mGenerateWorldFile; }
468 
476  void setGenerateWorldFile( bool enabled ) { mGenerateWorldFile = enabled; }
477 
485  QgsComposerMap *referenceMap() const;
486 
494  void setReferenceMap( QgsComposerMap *map );
495 
497  bool useAdvancedEffects() const {return mUseAdvancedEffects;}
499  void setUseAdvancedEffects( const bool effectsEnabled );
500 
501  QgsComposition::PlotStyle plotStyle() const { return mPlotStyle; }
502  void setPlotStyle( const QgsComposition::PlotStyle style ) { mPlotStyle = style; }
503 
505  bool writeXml( QDomElement &composerElem, QDomDocument &doc );
506 
508  bool readXml( const QDomElement &compositionElem, const QDomDocument &doc );
509 
519  bool loadFromTemplate( const QDomDocument &doc, QMap<QString, QString> *substitutionMap = nullptr,
520  bool addUndoCommands = false, const bool clearComposition = true );
521 
530  void addItemsFromXml( const QDomElement &elem, const QDomDocument &doc,
531  bool addUndoCommands = false, QPointF *pos = nullptr, bool pasteInPlace = false );
532 
534  void addItemToZList( QgsComposerItem *item );
536  void removeItemFromZList( QgsComposerItem *item );
537 
538  //functions to move selected items in hierarchy
539  void raiseSelectedItems();
540 
541  //returns true if successful
542  bool raiseItem( QgsComposerItem *item );
543  void lowerSelectedItems();
544  //returns true if successful
545  bool lowerItem( QgsComposerItem *item );
546  void moveSelectedItemsToTop();
547  //returns true if successful
548  bool moveItemToTop( QgsComposerItem *item );
549  void moveSelectedItemsToBottom();
550  //returns true if successful
551  bool moveItemToBottom( QgsComposerItem *item );
552 
553  //functions to find items by their position in the z list
554  void selectNextByZOrder( const ZValueDirection direction );
555  QgsComposerItem *getComposerItemBelow( QgsComposerItem *item ) const;
556  QgsComposerItem *getComposerItemAbove( QgsComposerItem *item ) const;
557 
558  //functions to align selected items
559  void alignSelectedItemsLeft();
560  void alignSelectedItemsHCenter();
561  void alignSelectedItemsRight();
562  void alignSelectedItemsTop();
563  void alignSelectedItemsVCenter();
564  void alignSelectedItemsBottom();
565 
566  //functions to lock and unlock items
568  void lockSelectedItems();
570  void unlockAllItems();
571 
578  QgsComposerItemGroup *groupItems( QList<QgsComposerItem *> items );
579 
588  QList<QgsComposerItem *> ungroupItems( QgsComposerItemGroup *group );
589 
594  void refreshZList();
595 
597  QPointF snapPointToGrid( QPointF scenePoint ) const;
598 
600  QList< QGraphicsLineItem * > *snapLines() {return &mSnapLines;}
601 
606  QgsComposerMouseHandles *selectionHandles() {return mSelectionHandles;} SIP_SKIP
607 
609  QGraphicsLineItem *addSnapLine();
611  void removeSnapLine( QGraphicsLineItem *line );
612 
617  QGraphicsLineItem *nearestSnapLine( const bool horizontal, const double x, const double y, const double tolerance, QList< QPair< QgsComposerItem *, QgsComposerItem::ItemPositionMode > > &snappedItems ) const SIP_SKIP;
618 
625  void beginCommand( QgsComposerItem *item, const QString &commandText, const QgsComposerMergeCommand::Context c = QgsComposerMergeCommand::Unknown );
626 
628  void endCommand();
630  void cancelCommand();
631 
632  void beginMultiFrameCommand( QgsComposerMultiFrame *multiFrame, const QString &text, const QgsComposerMultiFrameMergeCommand::Context c = QgsComposerMultiFrameMergeCommand::Unknown );
633  void endMultiFrameCommand();
635  void cancelMultiFrameCommand();
636 
638  void addMultiFrame( QgsComposerMultiFrame *multiFrame );
640  void removeMultiFrame( QgsComposerMultiFrame *multiFrame );
641 
643  void addComposerArrow( QgsComposerArrow *arrow );
645  void addComposerLabel( QgsComposerLabel *label );
647  void addComposerMap( QgsComposerMap *map );
649  void addComposerScaleBar( QgsComposerScaleBar *scaleBar );
651  void addComposerLegend( QgsComposerLegend *legend );
653  void addComposerPicture( QgsComposerPicture *picture );
655  void addComposerShape( QgsComposerShape *shape );
657  void addComposerPolygon( QgsComposerPolygon *polygon );
659  void addComposerPolyline( QgsComposerPolyline *polyline );
661  void addComposerHtmlFrame( QgsComposerHtml *html SIP_TRANSFER, QgsComposerFrame *frame SIP_TRANSFER );
663  void addComposerTableFrame( QgsComposerAttributeTableV2 *table SIP_TRANSFER, QgsComposerFrame *frame SIP_TRANSFER );
664 
666  void removeComposerItem( QgsComposerItem *item, const bool createCommand = true, const bool removeGroupItems = true );
667 
669  void pushAddRemoveCommand( QgsComposerItem *item, const QString &text, const QgsAddRemoveItemCommand::State state = QgsAddRemoveItemCommand::Added );
670 
675  void setPreventCursorChange( const bool preventChange ) { mPreventCursorChange = preventChange; }
676  bool preventCursorChange() const { return mPreventCursorChange; }
677 
678 #ifndef QT_NO_PRINTER
679  //printing
681  void beginPrint( QPrinter &printer, const bool evaluateDDPageSize = false );
683  void beginPrintAsPDF( QPrinter &printer, const QString &file );
684 
691  void doPrint( QPrinter &printer, QPainter &painter, bool startNewPage = false );
692 
697  bool print( QPrinter &printer, const bool evaluateDDPageSize = false );
698 
703  bool exportAsPDF( const QString &file );
704 #endif
705 
718  QImage printPageAsRaster( int page, QSize imageSize = QSize(), int dpi = 0 );
719 
734  QImage renderRectAsRaster( const QRectF &rect, QSize imageSize = QSize(), int dpi = 0 );
735 
743  void renderPage( QPainter *p, int page );
744 
754  void renderRect( QPainter *p, const QRectF &rect );
755 
766  void georeferenceOutput( const QString &file, QgsComposerMap *referenceMap = nullptr,
767  const QRectF &exportRegion = QRectF(), double dpi = -1 ) const;
768 
773  void computeWorldFileParameters( double &a, double &b, double &c, double &d, double &e, double &f ) const;
774 
786  void computeWorldFileParameters( const QRectF &exportRegion, double &a, double &b, double &c, double &d, double &e, double &f ) const;
787 
788  QgsAtlasComposition &atlasComposition() { return mAtlasComposition; }
789 
795  QgsComposition::AtlasMode atlasMode() const { return mAtlasMode; }
796 
803  bool setAtlasMode( const QgsComposition::AtlasMode mode );
804 
810  QList< QgsPaperItem * > pages() { return mPages; }
811 
817  QgsComposerModel *itemsModel() { return mItemsModel; }
818 
828  void setCustomProperty( const QString &key, const QVariant &value );
829 
840  QVariant customProperty( const QString &key, const QVariant &defaultValue = QVariant() ) const;
841 
850  void removeCustomProperty( const QString &key );
851 
859  QStringList customProperties() const;
860 
867  QRectF pageItemBounds( int pageNumber, bool visibleOnly = false ) const;
868 
874  QRectF compositionBounds( bool ignorePages = false, double margin = 0.0 ) const;
875 
882 
888  QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
889 
895  const QgsPropertyCollection &dataDefinedProperties() const { return mDataDefinedProperties; } SIP_SKIP
896 
897  public slots:
899  void sendItemAddedSignal( QgsComposerItem *item );
900 
904  void updateBounds();
905 
912  void refreshItems();
913 
918  void setSelectedItem( QgsComposerItem *item );
919 
925  void setAllDeselected();
926 
936  void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext *context = nullptr );
937 
944  void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
945 
946  protected:
947  void init();
948 
949 
950  private:
951 
953  QgsProject *mProject = nullptr;
954 
955  QString mName;
956 
957  QgsComposition::PlotStyle mPlotStyle;
958  double mPageWidth;
959  double mPageHeight;
960  QList< QgsPaperItem * > mPages;
961  double mSpaceBetweenPages; //space in preview between pages
962 
964  QgsFillSymbol *mPageStyleSymbol = nullptr;
965  void createDefaultPageStyleSymbol();
966 
968  QSet<QgsComposerMultiFrame *> mMultiFrames;
969 
971  int mPrintResolution;
972 
974  bool mPrintAsRaster;
975 
977  bool mGenerateWorldFile;
978 
980  QString mWorldFileMapId;
981 
983  bool mUseAdvancedEffects;
984 
986  bool mSnapToGrid;
987  bool mGridVisible;
988  double mSnapGridResolution;
989  double mSnapGridOffsetX;
990  double mSnapGridOffsetY;
991  QPen mGridPen;
992  GridStyle mGridStyle;
993 
995  bool mAlignmentSnap;
996  bool mGuidesVisible;
997  bool mSmartGuides;
998  int mSnapTolerance;
999 
1001  QList< QGraphicsLineItem * > mSnapLines;
1002 
1003  double mResizeToContentsMarginTop;
1004  double mResizeToContentsMarginRight;
1005  double mResizeToContentsMarginBottom;
1006  double mResizeToContentsMarginLeft;
1007 
1008  bool mBoundingBoxesVisible;
1009  bool mPagesVisible;
1010  QgsComposerMouseHandles *mSelectionHandles = nullptr;
1011 
1012  QUndoStack *mUndoStack = nullptr;
1013 
1014  QgsComposerItemCommand *mActiveItemCommand = nullptr;
1015  QgsComposerMultiFrameCommand *mActiveMultiFrameCommand = nullptr;
1016 
1018  QgsAtlasComposition mAtlasComposition;
1019 
1020  QgsComposition::AtlasMode mAtlasMode;
1021 
1022  bool mPreventCursorChange;
1023 
1024  QgsComposerModel *mItemsModel = nullptr;
1025 
1026  QgsPropertyCollection mDataDefinedProperties;
1027 
1028  QgsObjectCustomProperties mCustomProperties;
1029 
1030  QgsComposition(); //default constructor is forbidden
1031 
1033  void updateZValues( const bool addUndoCommands = true );
1034 
1038  int boundingRectOfSelectedItems( QRectF &bRect );
1039 
1041  void loadDefaults();
1042 
1044  void loadSettings();
1045 
1047  QPointF minPointFromXml( const QDomElement &elem ) const;
1048 
1049  void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand *c );
1050 
1051  void updatePaperItems();
1052  void addPaperItem();
1053  void removePaperItems();
1054  void deleteAndRemoveMultiFrames();
1055 
1056  static QString encodeStringForXml( const QString &str );
1057 
1058  //tries to return the current QGraphicsView attached to the composition
1059  QGraphicsView *graphicsView() const;
1060 
1065  void refreshPageSize( const QgsExpressionContext *context = nullptr );
1066 
1072  bool ddPageSizeActive() const;
1073 
1083  double *computeGeoTransform( const QgsComposerMap *referenceMap = nullptr, const QRectF &exportRegion = QRectF(), double dpi = -1 ) const;
1084 
1085 
1086  private slots:
1087  /*Prepares all data defined expressions*/
1088  void prepareAllDataDefinedExpressions();
1089 
1090  signals:
1091 
1097  void nameChanged( const QString &name );
1098 
1099  void paperSizeChanged();
1100  void nPagesChanged();
1101 
1103  void printResolutionChanged();
1104 
1106  void selectedItemChanged( QgsComposerItem *selected );
1107 
1112  void itemAdded( QgsComposerItem *item );
1113 
1115  void composerItemGroupAdded( QgsComposerItemGroup *group );
1116 
1118  void itemRemoved( QgsComposerItem * );
1119 
1121  void refreshItemsTriggered();
1122 
1124  void statusMsgChanged( const QString &message );
1125 
1130  void variablesChanged();
1131 
1132  friend class QgsComposerModel; //for accessing updateZValues (should not be public)
1133  friend class TestQgsComposition;
1134 };
1135 
1136 template<class T> void QgsComposition::composerItems( QList<T *> &itemList ) SIP_SKIP
1137 {
1138  itemList.clear();
1139  QList<QGraphicsItem *> graphicsItemList = items();
1140  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1141  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1142  {
1143  T *item = dynamic_cast<T *>( *itemIt );
1144  if ( item )
1145  {
1146  itemList.push_back( item );
1147  }
1148  }
1149 }
1150 
1151 template<class T> void QgsComposition::composerItemsOnPage( QList<T *> &itemList, const int pageNumber ) const SIP_SKIP
1152 {
1153  itemList.clear();
1154  QList<QGraphicsItem *> graphicsItemList = items();
1155  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1156  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1157  {
1158  T *item = dynamic_cast<T *>( *itemIt );
1159  if ( item && itemPageNumber( item ) == pageNumber )
1160  {
1161  itemList.push_back( item );
1162  }
1163  }
1164 }
1165 
1166 
1167 #endif
1168 
1169 
1170 
void setSnapTolerance(const int snapTolerance)
Sets the snap tolerance to use when automatically snapping items during movement and resizing to guid...
Item representing the paper.
Definition: qgspaperitem.h:46
A scale bar item that can be added to a map composition.
QUndoStack * undoStack()
Returns pointer to undo/redo command storage.
QPen gridPen() const
Composer item for polylines.
void setPrintAsRaster(const bool enabled)
double snapGridOffsetY() const
void composerItems(QList< T *> &itemList)
Return composer items of a specific type.
An item that draws an arrow between two points.
double snapGridOffsetX() const
bool snapToGridEnabled() const
QString name() const
Returns the composition&#39;s name.
void setGenerateWorldFile(bool enabled)
Sets whether the composition will generate corresponding world files when pages are exported...
QgsComposerModel * itemsModel()
Returns the items model attached to the composition.
GridStyle
Style to draw the snapping grid.
void setPlotStyle(const QgsComposition::PlotStyle style)
bool alignmentSnap() const
int printResolution() const
QgsComposerMouseHandles * selectionHandles()
Returns pointer to selection handles.
A item that forms part of a map composition.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the composition&#39;s property collection, used for data defined overrides...
bool gridVisible() const
A container for grouping several QgsComposerItems.
bool snapLinesVisible() const
bool preventCursorChange() const
QgsComposition::AtlasMode atlasMode() const
Returns the current atlas mode of the composition.
A table that displays attributes from a vector layer.
DataDefinedProperty
Data defined properties for different item types.
A composer class that displays svg files or raster format (jpg, png, ...)
QgsComposition::PlotStyle plotStyle() const
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
void setPreventCursorChange(const bool preventChange)
If true, prevents any mouse cursor changes by the composition or by any composer items Used by QgsCom...
#define SIP_SKIP
Definition: qgis_sip.h:119
QList< QgsPaperItem *> pages()
Return pages in the correct order.
bool boundingBoxesVisible() const
Returns whether selection bounding boxes should be shown in the composition.
bool useAdvancedEffects() const
Returns true if a composition should use advanced effects such as blend modes.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Abstract base class for composer items with the ability to distribute the content to several frames (...
#define SIP_TRANSFER
Definition: qgis_sip.h:36
A class to display a table in the print composer, and allow the table to span over multiple frames...
Reads and writes project states.
Definition: qgsproject.h:81
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the composition&#39;s property collection, used for data defined overrides...
void setAlignmentSnap(const bool s)
Graphics scene for map printing.
bool generateWorldFile() const
Returns true if the composition will generate corresponding world files when pages are exported...
Object representing map window.
Frame item for a composer multiframe item.
Abstract interface for generating an expression context.
bool smartGuidesEnabled() const
void composerItemsOnPage(QList< T *> &itemList, const int pageNumber) const
Return composer items of a specific type on a specified page.
A model for items attached to a composition.
A composer command class for adding / removing composer items.
Undo command to undo/redo all composer item related changes.
QgsFillSymbol * pageStyleSymbol()
Note: added in version 2.1.
A composer items that draws common shapes (ellipse, triangle, rectangle)
Composer item for polygons.
#define SIP_OUT
Definition: qgis_sip.h:51
int snapTolerance() const
Returns the snap tolerance to use when automatically snapping items during movement and resizing to g...
AtlasMode
Composition atlas modes.
GridStyle gridStyle() const
bool printAsRaster() const
QList< QGraphicsLineItem *> * snapLines()
Returns pointer to snap lines collection.
double snapGridResolution() const
Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML i...
void setSmartGuidesEnabled(const bool b)
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
A label that can be placed onto a map composition.
Class used to render an Atlas, iterating over geometry features.
QgsAtlasComposition & atlasComposition()
Handles drawing of selection outlines and mouse handles.
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the composition&#39;s property collection, used for data defined overrides.
bool pagesVisible() const
Returns whether the page items are be visible in the composition.
PlotStyle
Plot type.
Represents a vector layer which manages a vector based data sets.
A legend that can be placed onto a map composition.
double spaceBetweenPages() const
Returns the vertical space between pages in a composer view.
All properties for item.