QGIS API Documentation  2.99.0-Master (c42dad3)
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 <memory>
20 
21 #include <QDomDocument>
22 #include <QGraphicsScene>
23 #include <QLinkedList>
24 #include <QList>
25 #include <QPair>
26 #include <QSet>
27 #include <QUndoStack>
28 #include <QPrinter>
29 #include <QPainter>
30 
32 #include "qgscomposeritemcommand.h"
34 #include "qgsatlascomposition.h"
35 #include "qgscomposerobject.h"
36 #include "qgscomposeritem.h" // required for nested name
38 
39 class QgisApp;
40 class QgsComposerFrame;
41 class QgsComposerMap;
42 class QGraphicsRectItem;
43 class QDomElement;
44 class QgsComposerArrow;
45 class QgsComposerPolygon;
48 class QgsComposerHtml;
49 class QgsComposerTableV2;
50 class QgsComposerItem;
52 class QgsComposerLabel;
53 class QgsComposerLegend;
54 class QgsComposerMap;
55 class QgsComposerPicture;
57 class QgsComposerShape;
61 class QgsVectorLayer;
62 class QgsComposer;
63 class QgsFillSymbol;
64 class QgsDataDefined;
65 class QgsComposerModel;
66 class QgsPaperItem;
67 
74 class CORE_EXPORT QgsComposition : public QGraphicsScene, public QgsExpressionContextGenerator
75 {
76  Q_OBJECT
77  public:
78 
80  enum PlotStyle
81  {
82  Preview = 0, // Use cache etc
83  Print, // Render well
84  Postscript // Fonts need different scaling!
85  };
86 
88  enum GridStyle
89  {
92  Crosses
93  };
94 
96  {
98  ZValueAbove
99  };
100 
102  {
104  Landscape
105  };
106 
107  explicit QgsComposition( const QgsMapSettings& mapSettings );
108 
111  {
112  AtlasOff, // Composition is not being controlled by an atlas
113  PreviewAtlas, // An atlas composition is being previewed in the app
114  ExportAtlas // The composition is being exported as an atlas
115  };
116 
117  ~QgsComposition();
118 
127  void setPaperSize( double width, double height,
128  bool keepRelativeItemPosition = true );
129 
135  double paperHeight() const;
136 
142  double paperWidth() const;
143 
157  void resizePageToContents( double marginTop = 0.0, double marginRight = 0.0,
158  double marginBottom = 0.0, double marginLeft = 0.0 );
159 
170  void setResizeToContentsMargins( double marginTop, double marginRight,
171  double marginBottom, double marginLeft );
172 
183  void resizeToContentsMargins( double& marginTop, double& marginRight,
184  double& marginBottom, double& marginLeft ) const;
185 
189  double spaceBetweenPages() const { return mSpaceBetweenPages; }
190 
195  void setNumPages( const int pages );
196 
201  int numPages() const;
202 
212  bool pageIsEmpty( const int page ) const;
213 
221  bool shouldExportPage( const int page ) const;
222 
224  void setPageStyleSymbol( QgsFillSymbol* symbol );
226  QgsFillSymbol* pageStyleSymbol() { return mPageStyleSymbol; }
227 
231  QPointF positionOnPage( QPointF position ) const;
232 
236  int pageNumberForPoint( QPointF position ) const;
237 
241  void setStatusMessage( const QString & message );
242 
246  void updateSettings();
247 
248  void setSnapToGridEnabled( const bool b );
249  bool snapToGridEnabled() const {return mSnapToGrid;}
250 
251  void setGridVisible( const bool b );
252  bool gridVisible() const {return mGridVisible;}
253 
255  void setSnapLinesVisible( const bool visible );
256  bool snapLinesVisible() const {return mGuidesVisible;}
257 
258  void setAlignmentSnap( const bool s ) { mAlignmentSnap = s; }
259  bool alignmentSnap() const { return mAlignmentSnap; }
260 
261  void setSmartGuidesEnabled( const bool b ) { mSmartGuides = b; }
262  bool smartGuidesEnabled() const {return mSmartGuides;}
263 
271  void setPagesVisible( bool visible );
272 
279  bool pagesVisible() const { return mPagesVisible; }
280 
282  void clearSnapLines();
283 
284  void setSnapGridResolution( const double r );
285  double snapGridResolution() const {return mSnapGridResolution;}
286 
287  void setSnapGridOffsetX( const double offset );
288  double snapGridOffsetX() const {return mSnapGridOffsetX;}
289 
290  void setSnapGridOffsetY( const double offset );
291  double snapGridOffsetY() const {return mSnapGridOffsetY;}
292 
293  void setGridPen( const QPen& p );
294  const QPen& gridPen() const {return mGridPen;}
295 
296  void setGridStyle( const GridStyle s );
297  GridStyle gridStyle() const {return mGridStyle;}
298 
305  void setSnapTolerance( const int snapTolerance ) { mSnapTolerance = snapTolerance; }
306 
313  int snapTolerance() const { return mSnapTolerance; }
314 
320  void setBoundingBoxesVisible( const bool boundsVisible );
321 
327  bool boundingBoxesVisible() const { return mBoundingBoxesVisible; }
328 
330  QUndoStack* undoStack() { return mUndoStack; }
331 
337  QgsComposerItem* composerItemAt( QPointF position, const bool ignoreLocked = false ) const;
338 
345  QgsComposerItem* composerItemAt( QPointF position, const QgsComposerItem* belowItem, const bool ignoreLocked = false ) const;
346 
348  int pageNumberAt( QPointF position ) const;
349 
351  int itemPageNumber( const QgsComposerItem* ) const;
352 
357  QList<QgsComposerItem*> selectedComposerItems( const bool includeLockedItems = true );
358 
362  QList<const QgsComposerMap*> composerMapItems() const;
363 
368  template<class T> void composerItems( QList<T*>& itemList );
369 
376  template<class T> void composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const;
377 
381  const QgsComposerMap* getComposerMapById( const int id ) const;
382 
388  const QgsComposerItem* getComposerItemById( const QString& theId ) const;
389 
393  const QgsComposerItem* getComposerItemByUuid( const QString& theUuid ) const;
394 
395  int printResolution() const {return mPrintResolution;}
396  void setPrintResolution( const int dpi );
397 
398  bool printAsRaster() const {return mPrintAsRaster;}
399  void setPrintAsRaster( const bool enabled ) { mPrintAsRaster = enabled; }
400 
406  bool generateWorldFile() const { return mGenerateWorldFile; }
407 
414  void setGenerateWorldFile( bool enabled ) { mGenerateWorldFile = enabled; }
415 
421  QgsComposerMap* worldFileMap() const;
422 
429  void setWorldFileMap( QgsComposerMap* map );
430 
432  bool useAdvancedEffects() const {return mUseAdvancedEffects;}
434  void setUseAdvancedEffects( const bool effectsEnabled );
435 
438  const QgsMapSettings& mapSettings() const { return mMapSettings; }
439 
440  QgsComposition::PlotStyle plotStyle() const { return mPlotStyle; }
441  void setPlotStyle( const QgsComposition::PlotStyle style ) { mPlotStyle = style; }
442 
444  bool writeXml( QDomElement& composerElem, QDomDocument& doc );
445 
447  bool readXml( const QDomElement& compositionElem, const QDomDocument& doc );
448 
457  bool loadFromTemplate( const QDomDocument& doc, QMap<QString, QString>* substitutionMap = nullptr,
458  bool addUndoCommands = false, const bool clearComposition = true );
459 
469  void addItemsFromXml( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore = nullptr,
470  bool addUndoCommands = false, QPointF* pos = nullptr, bool pasteInPlace = false );
471 
473  void addItemToZList( QgsComposerItem* item );
475  void removeItemFromZList( QgsComposerItem* item );
476 
477  //functions to move selected items in hierarchy
478  void raiseSelectedItems();
479 
480  //returns true if successful
481  bool raiseItem( QgsComposerItem* item );
482  void lowerSelectedItems();
483  //returns true if successful
484  bool lowerItem( QgsComposerItem* item );
485  void moveSelectedItemsToTop();
486  //returns true if successful
487  bool moveItemToTop( QgsComposerItem* item );
488  void moveSelectedItemsToBottom();
489  //returns true if successful
490  bool moveItemToBottom( QgsComposerItem* item );
491 
492  //functions to find items by their position in the z list
493  void selectNextByZOrder( const ZValueDirection direction );
494  QgsComposerItem* getComposerItemBelow( QgsComposerItem* item ) const;
495  QgsComposerItem* getComposerItemAbove( QgsComposerItem* item ) const;
496 
497  //functions to align selected items
498  void alignSelectedItemsLeft();
499  void alignSelectedItemsHCenter();
500  void alignSelectedItemsRight();
501  void alignSelectedItemsTop();
502  void alignSelectedItemsVCenter();
503  void alignSelectedItemsBottom();
504 
505  //functions to lock and unlock items
507  void lockSelectedItems();
509  void unlockAllItems();
510 
516  QgsComposerItemGroup* groupItems( QList<QgsComposerItem*> items );
517 
525  QList<QgsComposerItem*> ungroupItems( QgsComposerItemGroup* group );
526 
530  void refreshZList();
531 
533  QPointF snapPointToGrid( QPointF scenePoint ) const;
534 
536  QList< QGraphicsLineItem* >* snapLines() {return &mSnapLines;}
537 
541  QgsComposerMouseHandles* selectionHandles() {return mSelectionHandles;}
542 
544  QGraphicsLineItem* addSnapLine();
546  void removeSnapLine( QGraphicsLineItem* line );
547 
551  QGraphicsLineItem* nearestSnapLine( const bool horizontal, const double x, const double y, const double tolerance, QList< QPair< QgsComposerItem*, QgsComposerItem::ItemPositionMode > >& snappedItems ) const;
552 
558  void beginCommand( QgsComposerItem* item, const QString& commandText, const QgsComposerMergeCommand::Context c = QgsComposerMergeCommand::Unknown );
559 
561  void endCommand();
563  void cancelCommand();
564 
565  void beginMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, const QgsComposerMultiFrameMergeCommand::Context c = QgsComposerMultiFrameMergeCommand::Unknown );
566  void endMultiFrameCommand();
568  void cancelMultiFrameCommand();
569 
571  void addMultiFrame( QgsComposerMultiFrame* multiFrame );
573  void removeMultiFrame( QgsComposerMultiFrame* multiFrame );
574 
577  void addComposerArrow( QgsComposerArrow* arrow );
579  void addComposerLabel( QgsComposerLabel* label );
581  void addComposerMap( QgsComposerMap* map, const bool setDefaultPreviewStyle = true );
583  void addComposerScaleBar( QgsComposerScaleBar* scaleBar );
585  void addComposerLegend( QgsComposerLegend* legend );
587  void addComposerPicture( QgsComposerPicture* picture );
589  void addComposerShape( QgsComposerShape* shape );
591  void addComposerPolygon( QgsComposerPolygon* polygon );
593  void addComposerPolyline( QgsComposerPolyline* polyline );
595  void addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame );
597  void addComposerTableFrame( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
598 
600  void removeComposerItem( QgsComposerItem* item, const bool createCommand = true, const bool removeGroupItems = true );
601 
603  void pushAddRemoveCommand( QgsComposerItem* item, const QString& text, const QgsAddRemoveItemCommand::State state = QgsAddRemoveItemCommand::Added );
604 
608  void setPreventCursorChange( const bool preventChange ) { mPreventCursorChange = preventChange; }
609  bool preventCursorChange() const { return mPreventCursorChange; }
610 
611  //printing
612 
614  void beginPrint( QPrinter& printer, const bool evaluateDDPageSize = false );
616  void beginPrintAsPDF( QPrinter& printer, const QString& file );
617 
623  void doPrint( QPrinter& printer, QPainter& painter, bool startNewPage = false );
624 
628  bool print( QPrinter &printer, const bool evaluateDDPageSize = false );
629 
633  bool exportAsPDF( const QString& file );
634 
646  QImage printPageAsRaster( int page, QSize imageSize = QSize(), int dpi = 0 );
647 
661  QImage renderRectAsRaster( const QRectF& rect, QSize imageSize = QSize(), int dpi = 0 );
662 
669  void renderPage( QPainter* p, int page );
670 
679  void renderRect( QPainter* p, const QRectF& rect );
680 
690  void georeferenceOutput( const QString& file, QgsComposerMap* referenceMap = nullptr,
691  const QRectF& exportRegion = QRectF(), double dpi = -1 ) const;
692 
696  void computeWorldFileParameters( double& a, double& b, double& c, double& d, double& e, double& f ) const;
697 
708  void computeWorldFileParameters( const QRectF& exportRegion, double& a, double& b, double& c, double& d, double& e, double& f ) const;
709 
710  QgsAtlasComposition& atlasComposition() { return mAtlasComposition; }
711 
716  QgsComposition::AtlasMode atlasMode() const { return mAtlasMode; }
717 
723  bool setAtlasMode( const QgsComposition::AtlasMode mode );
724 
729  QList< QgsPaperItem* > pages() { return mPages; }
730 
735  QgsDataDefined* dataDefinedProperty( const QgsComposerObject::DataDefinedProperty property );
736 
745  void setDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property, bool active, bool useExpression, const QString &expression, const QString &field );
746 
751  QgsComposerModel * itemsModel() { return mItemsModel; }
752 
761  void setCustomProperty( const QString &key, const QVariant &value );
762 
772  QVariant customProperty( const QString &key, const QVariant &defaultValue = QVariant() ) const;
773 
781  void removeCustomProperty( const QString &key );
782 
789  QStringList customProperties() const;
790 
796  QRectF pageItemBounds( int pageNumber, bool visibleOnly = false ) const;
797 
802  QRectF compositionBounds( bool ignorePages = false, double margin = 0.0 ) const;
803 
804  public slots:
806  void sendItemAddedSignal( QgsComposerItem* item );
807 
810  void updateBounds();
811 
817  void refreshItems();
818 
822  void setSelectedItem( QgsComposerItem* item );
823 
828  void setAllUnselected();
829 
838  void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext* context = nullptr );
839 
845 
846  protected:
847  void init();
848 
849 
850  private:
852  const QgsMapSettings& mMapSettings;
853 
854  QgsComposition::PlotStyle mPlotStyle;
855  double mPageWidth;
856  double mPageHeight;
857  QList< QgsPaperItem* > mPages;
858  double mSpaceBetweenPages; //space in preview between pages
859 
861  QgsFillSymbol* mPageStyleSymbol;
862  void createDefaultPageStyleSymbol();
863 
865  QSet<QgsComposerMultiFrame*> mMultiFrames;
866 
868  int mPrintResolution;
869 
871  bool mPrintAsRaster;
872 
874  bool mGenerateWorldFile;
875 
877  QString mWorldFileMapId;
878 
880  bool mUseAdvancedEffects;
881 
883  bool mSnapToGrid;
884  bool mGridVisible;
885  double mSnapGridResolution;
886  double mSnapGridOffsetX;
887  double mSnapGridOffsetY;
888  QPen mGridPen;
889  GridStyle mGridStyle;
890 
892  bool mAlignmentSnap;
893  bool mGuidesVisible;
894  bool mSmartGuides;
895  int mSnapTolerance;
896 
898  QList< QGraphicsLineItem* > mSnapLines;
899 
900  double mResizeToContentsMarginTop;
901  double mResizeToContentsMarginRight;
902  double mResizeToContentsMarginBottom;
903  double mResizeToContentsMarginLeft;
904 
905  bool mBoundingBoxesVisible;
906  bool mPagesVisible;
907  QgsComposerMouseHandles* mSelectionHandles;
908 
909  QUndoStack* mUndoStack;
910 
911  QgsComposerItemCommand* mActiveItemCommand;
912  QgsComposerMultiFrameCommand* mActiveMultiFrameCommand;
913 
915  QgsAtlasComposition mAtlasComposition;
916 
917  QgsComposition::AtlasMode mAtlasMode;
918 
919  bool mPreventCursorChange;
920 
921  QgsComposerModel * mItemsModel;
922 
924  QMap< QgsComposerObject::DataDefinedProperty, QString > mDataDefinedNames;
926  QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* > mDataDefinedProperties;
927 
928  QgsObjectCustomProperties mCustomProperties;
929 
930  QgsComposition(); //default constructor is forbidden
931 
933  void updateZValues( const bool addUndoCommands = true );
934 
937  int boundingRectOfSelectedItems( QRectF& bRect );
938 
940  void loadDefaults();
941 
943  void loadSettings();
944 
946  QPointF minPointFromXml( const QDomElement& elem ) const;
947 
948  void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c );
949 
950  void updatePaperItems();
951  void addPaperItem();
952  void removePaperItems();
953  void deleteAndRemoveMultiFrames();
954 
955  static QString encodeStringForXml( const QString& str );
956 
957  //tries to return the current QGraphicsView attached to the composition
958  QGraphicsView* graphicsView() const;
959 
963  void refreshPageSize( const QgsExpressionContext* context = nullptr );
964 
974  bool dataDefinedEvaluate( QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue,
975  const QgsExpressionContext& context,
976  QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* >* dataDefinedProperties );
977 
983  bool dataDefinedActive( const QgsComposerObject::DataDefinedProperty property,
984  const QMap<QgsComposerObject::DataDefinedProperty, QgsDataDefined *> *dataDefinedProperties ) const;
985 
994  QVariant dataDefinedValue( QgsComposerObject::DataDefinedProperty property, const QgsFeature *feature, const QgsFields& fields,
995  const QgsExpressionContext& context,
996  QMap<QgsComposerObject::DataDefinedProperty, QgsDataDefined *> *dataDefinedProperties ) const;
997 
998 
1006  void prepareDataDefinedExpression( QgsDataDefined *dd, QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* >* dataDefinedProperties, const QgsExpressionContext& context ) const;
1007 
1012  bool ddPageSizeActive() const;
1013 
1022  double* computeGeoTransform( const QgsComposerMap* referenceMap = nullptr, const QRectF& exportRegion = QRectF(), double dpi = -1 ) const;
1023 
1024 
1025  private slots:
1026  /*Prepares all data defined expressions*/
1027  void prepareAllDataDefinedExpressions();
1028 
1029  signals:
1030  void paperSizeChanged();
1031  void nPagesChanged();
1032 
1034  void printResolutionChanged();
1035 
1037  void selectedItemChanged( QgsComposerItem* selected );
1039  void composerArrowAdded( QgsComposerArrow* arrow );
1041  void composerPolygonAdded( QgsComposerPolygon* polygon );
1043  void composerPolylineAdded( QgsComposerPolyline* polyline );
1045  void composerHtmlFrameAdded( QgsComposerHtml* html, QgsComposerFrame* frame );
1047  void composerItemGroupAdded( QgsComposerItemGroup* group );
1049  void composerLabelAdded( QgsComposerLabel* label );
1051  void composerMapAdded( QgsComposerMap* map );
1053  void composerScaleBarAdded( QgsComposerScaleBar* scalebar );
1055  void composerLegendAdded( QgsComposerLegend* legend );
1057  void composerPictureAdded( QgsComposerPicture* picture );
1059  void composerShapeAdded( QgsComposerShape* shape );
1061  void composerTableFrameAdded( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
1063  void itemRemoved( QgsComposerItem* );
1064 
1066  void refreshItemsTriggered();
1067 
1069  void statusMsgChanged( const QString& message );
1070 
1074  void variablesChanged();
1075 
1076  friend class QgsComposerObject; //for accessing dataDefinedEvaluate, readDataDefinedPropertyMap and writeDataDefinedPropertyMap
1077  friend class QgsComposerModel; //for accessing updateZValues (should not be public)
1078  friend class TestQgsComposition;
1079 };
1080 
1081 template<class T> void QgsComposition::composerItems( QList<T*>& itemList )
1082 {
1083  itemList.clear();
1084  QList<QGraphicsItem *> graphicsItemList = items();
1085  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1086  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1087  {
1088  T* item = dynamic_cast<T*>( *itemIt );
1089  if ( item )
1090  {
1091  itemList.push_back( item );
1092  }
1093  }
1094 }
1095 
1096 template<class T> void QgsComposition::composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const
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 && itemPageNumber( item ) == pageNumber )
1105  {
1106  itemList.push_back( item );
1107  }
1108  }
1109 }
1110 
1111 
1112 #endif
1113 
1114 
1115 
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.
const 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:36
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:135
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...
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.