QGIS API Documentation  2.99.0-Master (0a63d1f)
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 <memory>
21 
22 #include <QDomDocument>
23 #include <QGraphicsScene>
24 #include <QLinkedList>
25 #include <QList>
26 #include <QPair>
27 #include <QSet>
28 #include <QUndoStack>
29 #include <QPrinter>
30 #include <QPainter>
31 
33 #include "qgscomposeritemcommand.h"
35 #include "qgsatlascomposition.h"
36 #include "qgscomposerobject.h"
37 #include "qgscomposeritem.h" // required for nested name
39 
40 class QgisApp;
41 class QgsComposerFrame;
42 class QgsComposerMap;
43 class QGraphicsRectItem;
44 class QDomElement;
45 class QgsComposerArrow;
46 class QgsComposerPolygon;
49 class QgsComposerHtml;
50 class QgsComposerTableV2;
51 class QgsComposerItem;
53 class QgsComposerLabel;
54 class QgsComposerLegend;
55 class QgsComposerMap;
56 class QgsComposerPicture;
58 class QgsComposerShape;
62 class QgsVectorLayer;
63 class QgsComposer;
64 class QgsFillSymbol;
65 class QgsDataDefined;
66 class QgsComposerModel;
67 class QgsPaperItem;
68 
75 class CORE_EXPORT QgsComposition : public QGraphicsScene, public QgsExpressionContextGenerator
76 {
77  Q_OBJECT
78  public:
79 
81  enum PlotStyle
82  {
83  Preview = 0, // Use cache etc
84  Print, // Render well
85  Postscript // Fonts need different scaling!
86  };
87 
89  enum GridStyle
90  {
93  Crosses
94  };
95 
97  {
99  ZValueAbove
100  };
101 
103  {
105  Landscape
106  };
107 
109  explicit QgsComposition( const QgsMapSettings& mapSettings, QgsProject* project );
110 
113  {
114  AtlasOff, // Composition is not being controlled by an atlas
115  PreviewAtlas, // An atlas composition is being previewed in the app
116  ExportAtlas // The composition is being exported as an atlas
117  };
118 
119  ~QgsComposition();
120 
127  QgsProject* project() const;
128 
137  void setPaperSize( double width, double height,
138  bool keepRelativeItemPosition = true );
139 
145  double paperHeight() const;
146 
152  double paperWidth() const;
153 
167  void resizePageToContents( double marginTop = 0.0, double marginRight = 0.0,
168  double marginBottom = 0.0, double marginLeft = 0.0 );
169 
180  void setResizeToContentsMargins( double marginTop, double marginRight,
181  double marginBottom, double marginLeft );
182 
193  void resizeToContentsMargins( double& marginTop, double& marginRight,
194  double& marginBottom, double& marginLeft ) const;
195 
199  double spaceBetweenPages() const { return mSpaceBetweenPages; }
200 
205  void setNumPages( const int pages );
206 
211  int numPages() const;
212 
222  bool pageIsEmpty( const int page ) const;
223 
231  bool shouldExportPage( const int page ) const;
232 
234  void setPageStyleSymbol( QgsFillSymbol* symbol );
236  QgsFillSymbol* pageStyleSymbol() { return mPageStyleSymbol; }
237 
241  QPointF positionOnPage( QPointF position ) const;
242 
246  int pageNumberForPoint( QPointF position ) const;
247 
251  void setStatusMessage( const QString & message );
252 
256  void updateSettings();
257 
258  void setSnapToGridEnabled( const bool b );
259  bool snapToGridEnabled() const {return mSnapToGrid;}
260 
261  void setGridVisible( const bool b );
262  bool gridVisible() const {return mGridVisible;}
263 
265  void setSnapLinesVisible( const bool visible );
266  bool snapLinesVisible() const {return mGuidesVisible;}
267 
268  void setAlignmentSnap( const bool s ) { mAlignmentSnap = s; }
269  bool alignmentSnap() const { return mAlignmentSnap; }
270 
271  void setSmartGuidesEnabled( const bool b ) { mSmartGuides = b; }
272  bool smartGuidesEnabled() const {return mSmartGuides;}
273 
281  void setPagesVisible( bool visible );
282 
289  bool pagesVisible() const { return mPagesVisible; }
290 
292  void clearSnapLines();
293 
294  void setSnapGridResolution( const double r );
295  double snapGridResolution() const {return mSnapGridResolution;}
296 
297  void setSnapGridOffsetX( const double offset );
298  double snapGridOffsetX() const {return mSnapGridOffsetX;}
299 
300  void setSnapGridOffsetY( const double offset );
301  double snapGridOffsetY() const {return mSnapGridOffsetY;}
302 
303  void setGridPen( const QPen& p );
304  QPen gridPen() const {return mGridPen;}
305 
306  void setGridStyle( const GridStyle s );
307  GridStyle gridStyle() const {return mGridStyle;}
308 
315  void setSnapTolerance( const int snapTolerance ) { mSnapTolerance = snapTolerance; }
316 
323  int snapTolerance() const { return mSnapTolerance; }
324 
330  void setBoundingBoxesVisible( const bool boundsVisible );
331 
337  bool boundingBoxesVisible() const { return mBoundingBoxesVisible; }
338 
340  QUndoStack* undoStack() { return mUndoStack; }
341 
347  QgsComposerItem* composerItemAt( QPointF position, const bool ignoreLocked = false ) const;
348 
355  QgsComposerItem* composerItemAt( QPointF position, const QgsComposerItem* belowItem, const bool ignoreLocked = false ) const;
356 
358  int pageNumberAt( QPointF position ) const;
359 
361  int itemPageNumber( const QgsComposerItem* ) const;
362 
367  QList<QgsComposerItem*> selectedComposerItems( const bool includeLockedItems = true );
368 
372  QList<const QgsComposerMap*> composerMapItems() const;
373 
378  template<class T> void composerItems( QList<T*>& itemList );
379 
386  template<class T> void composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const;
387 
391  const QgsComposerMap* getComposerMapById( const int id ) const;
392 
398  const QgsComposerItem* getComposerItemById( const QString& theId ) const;
399 
403  const QgsComposerItem* getComposerItemByUuid( const QString& theUuid ) const;
404 
405  int printResolution() const {return mPrintResolution;}
406  void setPrintResolution( const int dpi );
407 
408  bool printAsRaster() const {return mPrintAsRaster;}
409  void setPrintAsRaster( const bool enabled ) { mPrintAsRaster = enabled; }
410 
416  bool generateWorldFile() const { return mGenerateWorldFile; }
417 
424  void setGenerateWorldFile( bool enabled ) { mGenerateWorldFile = enabled; }
425 
432  QgsComposerMap* referenceMap() const;
433 
440  void setReferenceMap( QgsComposerMap* map );
441 
443  bool useAdvancedEffects() const {return mUseAdvancedEffects;}
445  void setUseAdvancedEffects( const bool effectsEnabled );
446 
449  const QgsMapSettings& mapSettings() const { return mMapSettings; }
450 
451  QgsComposition::PlotStyle plotStyle() const { return mPlotStyle; }
452  void setPlotStyle( const QgsComposition::PlotStyle style ) { mPlotStyle = style; }
453 
455  bool writeXml( QDomElement& composerElem, QDomDocument& doc );
456 
458  bool readXml( const QDomElement& compositionElem, const QDomDocument& doc );
459 
468  bool loadFromTemplate( const QDomDocument& doc, QMap<QString, QString>* substitutionMap = nullptr,
469  bool addUndoCommands = false, const bool clearComposition = true );
470 
480  void addItemsFromXml( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore = nullptr,
481  bool addUndoCommands = false, QPointF* pos = nullptr, bool pasteInPlace = false );
482 
484  void addItemToZList( QgsComposerItem* item );
486  void removeItemFromZList( QgsComposerItem* item );
487 
488  //functions to move selected items in hierarchy
489  void raiseSelectedItems();
490 
491  //returns true if successful
492  bool raiseItem( QgsComposerItem* item );
493  void lowerSelectedItems();
494  //returns true if successful
495  bool lowerItem( QgsComposerItem* item );
496  void moveSelectedItemsToTop();
497  //returns true if successful
498  bool moveItemToTop( QgsComposerItem* item );
499  void moveSelectedItemsToBottom();
500  //returns true if successful
501  bool moveItemToBottom( QgsComposerItem* item );
502 
503  //functions to find items by their position in the z list
504  void selectNextByZOrder( const ZValueDirection direction );
505  QgsComposerItem* getComposerItemBelow( QgsComposerItem* item ) const;
506  QgsComposerItem* getComposerItemAbove( QgsComposerItem* item ) const;
507 
508  //functions to align selected items
509  void alignSelectedItemsLeft();
510  void alignSelectedItemsHCenter();
511  void alignSelectedItemsRight();
512  void alignSelectedItemsTop();
513  void alignSelectedItemsVCenter();
514  void alignSelectedItemsBottom();
515 
516  //functions to lock and unlock items
518  void lockSelectedItems();
520  void unlockAllItems();
521 
527  QgsComposerItemGroup* groupItems( QList<QgsComposerItem*> items );
528 
536  QList<QgsComposerItem*> ungroupItems( QgsComposerItemGroup* group );
537 
541  void refreshZList();
542 
544  QPointF snapPointToGrid( QPointF scenePoint ) const;
545 
547  QList< QGraphicsLineItem* >* snapLines() {return &mSnapLines;}
548 
552  QgsComposerMouseHandles* selectionHandles() {return mSelectionHandles;}
553 
555  QGraphicsLineItem* addSnapLine();
557  void removeSnapLine( QGraphicsLineItem* line );
558 
562  QGraphicsLineItem* nearestSnapLine( const bool horizontal, const double x, const double y, const double tolerance, QList< QPair< QgsComposerItem*, QgsComposerItem::ItemPositionMode > >& snappedItems ) const;
563 
569  void beginCommand( QgsComposerItem* item, const QString& commandText, const QgsComposerMergeCommand::Context c = QgsComposerMergeCommand::Unknown );
570 
572  void endCommand();
574  void cancelCommand();
575 
576  void beginMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, const QgsComposerMultiFrameMergeCommand::Context c = QgsComposerMultiFrameMergeCommand::Unknown );
577  void endMultiFrameCommand();
579  void cancelMultiFrameCommand();
580 
582  void addMultiFrame( QgsComposerMultiFrame* multiFrame );
584  void removeMultiFrame( QgsComposerMultiFrame* multiFrame );
585 
588  void addComposerArrow( QgsComposerArrow* arrow );
590  void addComposerLabel( QgsComposerLabel* label );
592  void addComposerMap( QgsComposerMap* map, const bool setDefaultPreviewStyle = true );
594  void addComposerScaleBar( QgsComposerScaleBar* scaleBar );
596  void addComposerLegend( QgsComposerLegend* legend );
598  void addComposerPicture( QgsComposerPicture* picture );
600  void addComposerShape( QgsComposerShape* shape );
602  void addComposerPolygon( QgsComposerPolygon* polygon );
604  void addComposerPolyline( QgsComposerPolyline* polyline );
606  void addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame );
608  void addComposerTableFrame( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
609 
611  void removeComposerItem( QgsComposerItem* item, const bool createCommand = true, const bool removeGroupItems = true );
612 
614  void pushAddRemoveCommand( QgsComposerItem* item, const QString& text, const QgsAddRemoveItemCommand::State state = QgsAddRemoveItemCommand::Added );
615 
619  void setPreventCursorChange( const bool preventChange ) { mPreventCursorChange = preventChange; }
620  bool preventCursorChange() const { return mPreventCursorChange; }
621 
622 #ifndef QT_NO_PRINTER
623  //printing
625  void beginPrint( QPrinter& printer, const bool evaluateDDPageSize = false );
627  void beginPrintAsPDF( QPrinter& printer, const QString& file );
628 
634  void doPrint( QPrinter& printer, QPainter& painter, bool startNewPage = false );
635 
639  bool print( QPrinter &printer, const bool evaluateDDPageSize = false );
640 
644  bool exportAsPDF( const QString& file );
645 #endif
646 
658  QImage printPageAsRaster( int page, QSize imageSize = QSize(), int dpi = 0 );
659 
673  QImage renderRectAsRaster( const QRectF& rect, QSize imageSize = QSize(), int dpi = 0 );
674 
681  void renderPage( QPainter* p, int page );
682 
691  void renderRect( QPainter* p, const QRectF& rect );
692 
702  void georeferenceOutput( const QString& file, QgsComposerMap* referenceMap = nullptr,
703  const QRectF& exportRegion = QRectF(), double dpi = -1 ) const;
704 
708  void computeWorldFileParameters( double& a, double& b, double& c, double& d, double& e, double& f ) const;
709 
720  void computeWorldFileParameters( const QRectF& exportRegion, double& a, double& b, double& c, double& d, double& e, double& f ) const;
721 
722  QgsAtlasComposition& atlasComposition() { return mAtlasComposition; }
723 
728  QgsComposition::AtlasMode atlasMode() const { return mAtlasMode; }
729 
735  bool setAtlasMode( const QgsComposition::AtlasMode mode );
736 
741  QList< QgsPaperItem* > pages() { return mPages; }
742 
747  QgsDataDefined* dataDefinedProperty( const QgsComposerObject::DataDefinedProperty property );
748 
757  void setDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property, bool active, bool useExpression, const QString &expression, const QString &field );
758 
763  QgsComposerModel * itemsModel() { return mItemsModel; }
764 
773  void setCustomProperty( const QString &key, const QVariant &value );
774 
784  QVariant customProperty( const QString &key, const QVariant &defaultValue = QVariant() ) const;
785 
793  void removeCustomProperty( const QString &key );
794 
801  QStringList customProperties() const;
802 
808  QRectF pageItemBounds( int pageNumber, bool visibleOnly = false ) const;
809 
814  QRectF compositionBounds( bool ignorePages = false, double margin = 0.0 ) const;
815 
816  public slots:
818  void sendItemAddedSignal( QgsComposerItem* item );
819 
822  void updateBounds();
823 
829  void refreshItems();
830 
834  void setSelectedItem( QgsComposerItem* item );
835 
840  void setAllDeselected();
841 
850  void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext* context = nullptr );
851 
857 
858  protected:
859  void init();
860 
861 
862  private:
864  const QgsMapSettings& mMapSettings;
865 
867  QgsProject* mProject;
868 
869  QgsComposition::PlotStyle mPlotStyle;
870  double mPageWidth;
871  double mPageHeight;
872  QList< QgsPaperItem* > mPages;
873  double mSpaceBetweenPages; //space in preview between pages
874 
876  QgsFillSymbol* mPageStyleSymbol;
877  void createDefaultPageStyleSymbol();
878 
880  QSet<QgsComposerMultiFrame*> mMultiFrames;
881 
883  int mPrintResolution;
884 
886  bool mPrintAsRaster;
887 
889  bool mGenerateWorldFile;
890 
892  QString mWorldFileMapId;
893 
895  bool mUseAdvancedEffects;
896 
898  bool mSnapToGrid;
899  bool mGridVisible;
900  double mSnapGridResolution;
901  double mSnapGridOffsetX;
902  double mSnapGridOffsetY;
903  QPen mGridPen;
904  GridStyle mGridStyle;
905 
907  bool mAlignmentSnap;
908  bool mGuidesVisible;
909  bool mSmartGuides;
910  int mSnapTolerance;
911 
913  QList< QGraphicsLineItem* > mSnapLines;
914 
915  double mResizeToContentsMarginTop;
916  double mResizeToContentsMarginRight;
917  double mResizeToContentsMarginBottom;
918  double mResizeToContentsMarginLeft;
919 
920  bool mBoundingBoxesVisible;
921  bool mPagesVisible;
922  QgsComposerMouseHandles* mSelectionHandles;
923 
924  QUndoStack* mUndoStack;
925 
926  QgsComposerItemCommand* mActiveItemCommand;
927  QgsComposerMultiFrameCommand* mActiveMultiFrameCommand;
928 
930  QgsAtlasComposition mAtlasComposition;
931 
932  QgsComposition::AtlasMode mAtlasMode;
933 
934  bool mPreventCursorChange;
935 
936  QgsComposerModel * mItemsModel;
937 
939  QMap< QgsComposerObject::DataDefinedProperty, QString > mDataDefinedNames;
941  QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* > mDataDefinedProperties;
942 
943  QgsObjectCustomProperties mCustomProperties;
944 
945  QgsComposition(); //default constructor is forbidden
946 
948  void updateZValues( const bool addUndoCommands = true );
949 
952  int boundingRectOfSelectedItems( QRectF& bRect );
953 
955  void loadDefaults();
956 
958  void loadSettings();
959 
961  QPointF minPointFromXml( const QDomElement& elem ) const;
962 
963  void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c );
964 
965  void updatePaperItems();
966  void addPaperItem();
967  void removePaperItems();
968  void deleteAndRemoveMultiFrames();
969 
970  static QString encodeStringForXml( const QString& str );
971 
972  //tries to return the current QGraphicsView attached to the composition
973  QGraphicsView* graphicsView() const;
974 
978  void refreshPageSize( const QgsExpressionContext* context = nullptr );
979 
989  bool dataDefinedEvaluate( QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue,
990  const QgsExpressionContext& context,
991  QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* >* dataDefinedProperties );
992 
998  bool dataDefinedActive( const QgsComposerObject::DataDefinedProperty property,
999  const QMap<QgsComposerObject::DataDefinedProperty, QgsDataDefined *> *dataDefinedProperties ) const;
1000 
1009  QVariant dataDefinedValue( QgsComposerObject::DataDefinedProperty property, const QgsFeature *feature, const QgsFields& fields,
1010  const QgsExpressionContext& context,
1011  QMap<QgsComposerObject::DataDefinedProperty, QgsDataDefined *> *dataDefinedProperties ) const;
1012 
1013 
1021  void prepareDataDefinedExpression( QgsDataDefined *dd, QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* >* dataDefinedProperties, const QgsExpressionContext& context ) const;
1022 
1027  bool ddPageSizeActive() const;
1028 
1037  double* computeGeoTransform( const QgsComposerMap* referenceMap = nullptr, const QRectF& exportRegion = QRectF(), double dpi = -1 ) const;
1038 
1039 
1040  private slots:
1041  /*Prepares all data defined expressions*/
1042  void prepareAllDataDefinedExpressions();
1043 
1044  signals:
1045  void paperSizeChanged();
1046  void nPagesChanged();
1047 
1049  void printResolutionChanged();
1050 
1052  void selectedItemChanged( QgsComposerItem* selected );
1054  void composerArrowAdded( QgsComposerArrow* arrow );
1056  void composerPolygonAdded( QgsComposerPolygon* polygon );
1058  void composerPolylineAdded( QgsComposerPolyline* polyline );
1060  void composerHtmlFrameAdded( QgsComposerHtml* html, QgsComposerFrame* frame );
1062  void composerItemGroupAdded( QgsComposerItemGroup* group );
1064  void composerLabelAdded( QgsComposerLabel* label );
1066  void composerMapAdded( QgsComposerMap* map );
1068  void composerScaleBarAdded( QgsComposerScaleBar* scalebar );
1070  void composerLegendAdded( QgsComposerLegend* legend );
1072  void composerPictureAdded( QgsComposerPicture* picture );
1074  void composerShapeAdded( QgsComposerShape* shape );
1076  void composerTableFrameAdded( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
1078  void itemRemoved( QgsComposerItem* );
1079 
1081  void refreshItemsTriggered();
1082 
1084  void statusMsgChanged( const QString& message );
1085 
1089  void variablesChanged();
1090 
1091  friend class QgsComposerObject; //for accessing dataDefinedEvaluate, readDataDefinedPropertyMap and writeDataDefinedPropertyMap
1092  friend class QgsComposerModel; //for accessing updateZValues (should not be public)
1093  friend class TestQgsComposition;
1094 };
1095 
1096 template<class T> void QgsComposition::composerItems( QList<T*>& itemList )
1097 {
1098  itemList.clear();
1099  QList<QGraphicsItem *> graphicsItemList = items();
1100  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1101  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1102  {
1103  T* item = dynamic_cast<T*>( *itemIt );
1104  if ( item )
1105  {
1106  itemList.push_back( item );
1107  }
1108  }
1109 }
1110 
1111 template<class T> void QgsComposition::composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const
1112 {
1113  itemList.clear();
1114  QList<QGraphicsItem *> graphicsItemList = items();
1115  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1116  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1117  {
1118  T* item = dynamic_cast<T*>( *itemIt );
1119  if ( item && itemPageNumber( item ) == pageNumber )
1120  {
1121  itemList.push_back( item );
1122  }
1123  }
1124 }
1125 
1126 
1127 #endif
1128 
1129 
1130 
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:42
A scale bar item that can be added to a map composition.
QUndoStack * undoStack()
Returns pointer to undo/redo command storage.
QPen gridPen() const
A base class for objects which belong to a map composition.
Composer item for polylines.
void setPrintAsRaster(const bool enabled)
double snapGridOffsetY() const
void composerItems(QList< T *> &itemList)
Return composer items of a specific type.
A container class for data source field mapping or expression.
An item that draws an arrow between two points.
double snapGridOffsetX() const
bool snapToGridEnabled() const
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.
bool gridVisible() const
Container of fields for a vector layer.
Definition: qgsfields.h:39
A container for grouping several QgsComposerItems.
bool snapLinesVisible() const
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:136
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
The QgsMapSettings class contains configuration for rendering of the map.
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...
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 (...
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:72
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...
const QgsMapSettings & mapSettings() const
Return setting of QGIS map canvas.
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.
QList< QgsPaperItem *> pages()
Return pages in the correct order.
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.
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
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 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.
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.
QList< QGraphicsLineItem *> * snapLines()
Returns pointer to snap lines collection.