QGIS API Documentation  2.14.0-Essen
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 "qgspaperitem.h"
36 #include "qgscomposerobject.h"
37 #include "qgscomposeritem.h"
39 
40 class QgisApp;
41 class QgsComposerFrame;
42 class QgsComposerMap;
43 class QGraphicsRectItem;
44 class QgsMapRenderer;
45 class QDomElement;
46 class QgsComposerArrow;
48 class QgsComposerHtml;
49 class QgsComposerTableV2;
50 class QgsComposerItem;
52 class QgsComposerLabel;
53 class QgsComposerLegend;
54 class QgsComposerMap;
55 class QgsComposerPicture;
57 class QgsComposerShape;
62 class QgsVectorLayer;
63 class QgsComposer;
64 class QgsFillSymbolV2;
65 class QgsDataDefined;
66 class QgsComposerModel;
67 
74 class CORE_EXPORT QgsComposition : public QGraphicsScene
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 
108  Q_DECL_DEPRECATED QgsComposition( QgsMapRenderer* mapRenderer );
109  explicit QgsComposition( const QgsMapSettings& mapSettings );
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 
129  void setPaperSize( double width, double height,
130  bool keepRelativeItemPosition = true );
131 
137  double paperHeight() const;
138 
144  double paperWidth() const;
145 
159  void resizePageToContents( double marginTop = 0.0, double marginRight = 0.0,
160  double marginBottom = 0.0, double marginLeft = 0.0 );
161 
172  void setResizeToContentsMargins( double marginTop, double marginRight,
173  double marginBottom, double marginLeft );
174 
185  void resizeToContentsMargins( double& marginTop, double& marginRight,
186  double& marginBottom, double& marginLeft ) const;
187 
191  double spaceBetweenPages() const { return mSpaceBetweenPages; }
192 
197  void setNumPages( const int pages );
198 
203  int numPages() const;
204 
214  bool pageIsEmpty( const int page ) const;
215 
223  bool shouldExportPage( const int page ) const;
224 
226  void setPageStyleSymbol( QgsFillSymbolV2* symbol );
228  QgsFillSymbolV2* pageStyleSymbol() { return mPageStyleSymbol; }
229 
233  QPointF positionOnPage( QPointF position ) const;
234 
238  int pageNumberForPoint( QPointF position ) const;
239 
243  void setStatusMessage( const QString & message );
244 
248  void updateSettings();
249 
250  void setSnapToGridEnabled( const bool b );
251  bool snapToGridEnabled() const {return mSnapToGrid;}
252 
253  void setGridVisible( const bool b );
254  bool gridVisible() const {return mGridVisible;}
255 
257  void setSnapLinesVisible( const bool visible );
258  bool snapLinesVisible() const {return mGuidesVisible;}
259 
260  void setAlignmentSnap( const bool s ) { mAlignmentSnap = s; }
261  bool alignmentSnap() const { return mAlignmentSnap; }
262 
263  void setSmartGuidesEnabled( const bool b ) { mSmartGuides = b; }
264  bool smartGuidesEnabled() const {return mSmartGuides;}
265 
273  void setPagesVisible( bool visible );
274 
281  bool pagesVisible() const { return mPagesVisible; }
282 
284  void clearSnapLines();
285 
286  void setSnapGridResolution( const double r );
287  double snapGridResolution() const {return mSnapGridResolution;}
288 
289  void setSnapGridOffsetX( const double offset );
290  double snapGridOffsetX() const {return mSnapGridOffsetX;}
291 
292  void setSnapGridOffsetY( const double offset );
293  double snapGridOffsetY() const {return mSnapGridOffsetY;}
294 
295  void setGridPen( const QPen& p );
296  const QPen& gridPen() const {return mGridPen;}
297 
298  void setGridStyle( const GridStyle s );
299  GridStyle gridStyle() const {return mGridStyle;}
300 
307  Q_DECL_DEPRECATED void setSnapGridTolerance( double tolerance ) { mSnapTolerance = tolerance; }
308 
315  Q_DECL_DEPRECATED double snapGridTolerance() const {return mSnapTolerance;}
316 
323  Q_DECL_DEPRECATED void setAlignmentSnapTolerance( double t ) { mSnapTolerance = t; }
324 
331  Q_DECL_DEPRECATED double alignmentSnapTolerance() const { return mSnapTolerance; }
332 
339  void setSnapTolerance( const int snapTolerance ) { mSnapTolerance = snapTolerance; }
340 
347  int snapTolerance() const { return mSnapTolerance; }
348 
354  void setBoundingBoxesVisible( const bool boundsVisible );
355 
361  bool boundingBoxesVisible() const { return mBoundingBoxesVisible; }
362 
364  QUndoStack* undoStack() { return mUndoStack; }
365 
371  QgsComposerItem* composerItemAt( QPointF position, const bool ignoreLocked = false ) const;
372 
379  QgsComposerItem* composerItemAt( QPointF position, const QgsComposerItem* belowItem, const bool ignoreLocked = false ) const;
380 
382  int pageNumberAt( QPointF position ) const;
383 
385  int itemPageNumber( const QgsComposerItem* ) const;
386 
391  QList<QgsComposerItem*> selectedComposerItems( const bool includeLockedItems = true );
392 
396  QList<const QgsComposerMap*> composerMapItems() const;
397 
402  template<class T> void composerItems( QList<T*>& itemList );
403 
410  template<class T> void composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const;
411 
415  const QgsComposerMap* getComposerMapById( const int id ) const;
416 
423  Q_DECL_DEPRECATED const QgsComposerHtml* getComposerHtmlByItem( QgsComposerItem *item ) const;
424 
430  const QgsComposerItem* getComposerItemById( const QString& theId ) const;
431 
435  const QgsComposerItem* getComposerItemByUuid( const QString& theUuid ) const;
436 
437  int printResolution() const {return mPrintResolution;}
438  void setPrintResolution( const int dpi );
439 
440  bool printAsRaster() const {return mPrintAsRaster;}
441  void setPrintAsRaster( const bool enabled ) { mPrintAsRaster = enabled; }
442 
443  bool generateWorldFile() const { return mGenerateWorldFile; }
444  void setGenerateWorldFile( const bool enabled ) { mGenerateWorldFile = enabled; }
445 
446  QgsComposerMap* worldFileMap() const { return mWorldFileMap; }
447  void setWorldFileMap( QgsComposerMap* map ) { mWorldFileMap = map; }
448 
450  bool useAdvancedEffects() const {return mUseAdvancedEffects;}
452  void setUseAdvancedEffects( const bool effectsEnabled );
453 
455  Q_DECL_DEPRECATED QgsMapRenderer* mapRenderer() { return mMapRenderer; }
457 
460  const QgsMapSettings& mapSettings() const { return mMapSettings; }
461 
462  QgsComposition::PlotStyle plotStyle() const { return mPlotStyle; }
463  void setPlotStyle( const QgsComposition::PlotStyle style ) { mPlotStyle = style; }
464 
469  Q_DECL_DEPRECATED int pixelFontSize( double pointSize ) const;
470 
474  Q_DECL_DEPRECATED double pointFontSize( int pixelSize ) const;
475 
477  bool writeXML( QDomElement& composerElem, QDomDocument& doc );
478 
480  bool readXML( const QDomElement& compositionElem, const QDomDocument& doc );
481 
490  bool loadFromTemplate( const QDomDocument& doc, QMap<QString, QString>* substitutionMap = nullptr,
491  bool addUndoCommands = false, const bool clearComposition = true );
492 
502  void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore = nullptr,
503  bool addUndoCommands = false, QPointF* pos = nullptr, bool pasteInPlace = false );
504 
506  void addItemToZList( QgsComposerItem* item );
508  void removeItemFromZList( QgsComposerItem* item );
509 
510  //functions to move selected items in hierarchy
511  void raiseSelectedItems();
512 
513  //returns true if successful
514  bool raiseItem( QgsComposerItem* item );
515  void lowerSelectedItems();
516  //returns true if successful
517  bool lowerItem( QgsComposerItem* item );
518  void moveSelectedItemsToTop();
519  //returns true if successful
520  bool moveItemToTop( QgsComposerItem* item );
521  void moveSelectedItemsToBottom();
522  //returns true if successful
523  bool moveItemToBottom( QgsComposerItem* item );
524 
525  //functions to find items by their position in the z list
526  void selectNextByZOrder( const ZValueDirection direction );
527  QgsComposerItem* getComposerItemBelow( QgsComposerItem* item ) const;
528  QgsComposerItem* getComposerItemAbove( QgsComposerItem* item ) const;
529 
530  //functions to align selected items
531  void alignSelectedItemsLeft();
532  void alignSelectedItemsHCenter();
533  void alignSelectedItemsRight();
534  void alignSelectedItemsTop();
535  void alignSelectedItemsVCenter();
536  void alignSelectedItemsBottom();
537 
538  //functions to lock and unlock items
540  void lockSelectedItems();
542  void unlockAllItems();
543 
549  QgsComposerItemGroup* groupItems( QList<QgsComposerItem*> items );
550 
558  QList<QgsComposerItem*> ungroupItems( QgsComposerItemGroup* group );
559 
564  Q_DECL_DEPRECATED void sortZList() {}
565 
569  void refreshZList();
570 
572  QPointF snapPointToGrid( QPointF scenePoint ) const;
573 
575  QList< QGraphicsLineItem* >* snapLines() {return &mSnapLines;}
576 
580  QgsComposerMouseHandles* selectionHandles() {return mSelectionHandles;}
581 
583  QGraphicsLineItem* addSnapLine();
585  void removeSnapLine( QGraphicsLineItem* line );
589  QGraphicsLineItem* nearestSnapLine( const bool horizontal, const double x, const double y, const double tolerance, QList< QPair< QgsComposerItem*, QgsComposerItem::ItemPositionMode > >& snappedItems ) const;
590 
596  void beginCommand( QgsComposerItem* item, const QString& commandText, const QgsComposerMergeCommand::Context c = QgsComposerMergeCommand::Unknown );
597 
599  void endCommand();
601  void cancelCommand();
602 
603  void beginMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, const QgsComposerMultiFrameMergeCommand::Context c = QgsComposerMultiFrameMergeCommand::Unknown );
604  void endMultiFrameCommand();
606  void cancelMultiFrameCommand();
607 
609  void addMultiFrame( QgsComposerMultiFrame* multiFrame );
611  void removeMultiFrame( QgsComposerMultiFrame* multiFrame );
614  void addComposerArrow( QgsComposerArrow* arrow );
616  void addComposerLabel( QgsComposerLabel* label );
618  void addComposerMap( QgsComposerMap* map, const bool setDefaultPreviewStyle = true );
620  void addComposerScaleBar( QgsComposerScaleBar* scaleBar );
622  void addComposerLegend( QgsComposerLegend* legend );
624  void addComposerPicture( QgsComposerPicture* picture );
626  void addComposerShape( QgsComposerShape* shape );
628  void addComposerTable( QgsComposerAttributeTable* table );
630  void addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame );
632  void addComposerTableFrame( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
633 
635  void removeComposerItem( QgsComposerItem* item, const bool createCommand = true, const bool removeGroupItems = true );
636 
638  void pushAddRemoveCommand( QgsComposerItem* item, const QString& text, const QgsAddRemoveItemCommand::State state = QgsAddRemoveItemCommand::Added );
639 
643  void setPreventCursorChange( const bool preventChange ) { mPreventCursorChange = preventChange; }
644  bool preventCursorChange() const { return mPreventCursorChange; }
645 
646  //printing
647 
649  void beginPrint( QPrinter& printer, const bool evaluateDDPageSize = false );
651  void beginPrintAsPDF( QPrinter& printer, const QString& file );
652 
658  void doPrint( QPrinter& printer, QPainter& painter, bool startNewPage = false );
659 
663  bool print( QPrinter &printer, const bool evaluateDDPageSize = false );
664 
668  bool exportAsPDF( const QString& file );
669 
681  QImage printPageAsRaster( int page, QSize imageSize = QSize(), int dpi = 0 );
682 
696  QImage renderRectAsRaster( const QRectF& rect, QSize imageSize = QSize(), int dpi = 0 );
697 
704  void renderPage( QPainter* p, int page );
705 
714  void renderRect( QPainter* p, const QRectF& rect );
715 
719  void computeWorldFileParameters( double& a, double& b, double& c, double& d, double& e, double& f ) const;
720 
731  void computeWorldFileParameters( const QRectF& exportRegion, double& a, double& b, double& c, double& d, double& e, double& f ) const;
732 
733  QgsAtlasComposition& atlasComposition() { return mAtlasComposition; }
734 
738  Q_DECL_DEPRECATED static void relativeResizeRect( QRectF& rectToResize, const QRectF& boundsBefore, const QRectF& boundsAfter );
739 
743  Q_DECL_DEPRECATED static double relativePosition( double position, double beforeMin, double beforeMax, double afterMin, double afterMax );
744 
749  QgsComposition::AtlasMode atlasMode() const { return mAtlasMode; }
750 
756  bool setAtlasMode( const QgsComposition::AtlasMode mode );
757 
762  QList< QgsPaperItem* > pages() { return mPages; }
763 
768  QgsDataDefined* dataDefinedProperty( const QgsComposerObject::DataDefinedProperty property );
769 
778  void setDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property, bool active, bool useExpression, const QString &expression, const QString &field );
779 
784  QgsComposerModel * itemsModel() { return mItemsModel; }
785 
794  void setCustomProperty( const QString &key, const QVariant &value );
795 
805  QVariant customProperty( const QString &key, const QVariant &defaultValue = QVariant() ) const;
806 
814  void removeCustomProperty( const QString &key );
815 
822  QStringList customProperties() const;
823 
829  QRectF pageItemBounds( int pageNumber, bool visibleOnly = false ) const;
830 
835  QRectF compositionBounds( bool ignorePages = false, double margin = 0.0 ) const;
836 
837  public slots:
839  void sendItemAddedSignal( QgsComposerItem* item );
840 
843  void updateBounds();
844 
850  void refreshItems();
851 
855  void setSelectedItem( QgsComposerItem* item );
856 
861  void setAllUnselected();
862 
871  void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext* context = nullptr );
872 
877  QgsExpressionContext* createExpressionContext() const;
878 
879  protected:
880  void init();
881 
882 
883  private:
885  QgsMapRenderer* mMapRenderer;
886  const QgsMapSettings& mMapSettings;
887 
888  QgsComposition::PlotStyle mPlotStyle;
889  double mPageWidth;
890  double mPageHeight;
891  QList< QgsPaperItem* > mPages;
892  double mSpaceBetweenPages; //space in preview between pages
893 
895  QgsFillSymbolV2* mPageStyleSymbol;
896  void createDefaultPageStyleSymbol();
897 
899  QSet<QgsComposerMultiFrame*> mMultiFrames;
900 
902  int mPrintResolution;
903 
905  bool mPrintAsRaster;
906 
908  bool mGenerateWorldFile;
910  QgsComposerMap* mWorldFileMap;
911 
913  bool mUseAdvancedEffects;
914 
916  bool mSnapToGrid;
917  bool mGridVisible;
918  double mSnapGridResolution;
919  double mSnapGridOffsetX;
920  double mSnapGridOffsetY;
921  QPen mGridPen;
922  GridStyle mGridStyle;
923 
925  bool mAlignmentSnap;
926  bool mGuidesVisible;
927  bool mSmartGuides;
928  int mSnapTolerance;
929 
931  QList< QGraphicsLineItem* > mSnapLines;
932 
933  double mResizeToContentsMarginTop;
934  double mResizeToContentsMarginRight;
935  double mResizeToContentsMarginBottom;
936  double mResizeToContentsMarginLeft;
937 
938  bool mBoundingBoxesVisible;
939  bool mPagesVisible;
940  QgsComposerMouseHandles* mSelectionHandles;
941 
942  QUndoStack* mUndoStack;
943 
944  QgsComposerItemCommand* mActiveItemCommand;
945  QgsComposerMultiFrameCommand* mActiveMultiFrameCommand;
946 
948  QgsAtlasComposition mAtlasComposition;
949 
950  QgsComposition::AtlasMode mAtlasMode;
951 
952  bool mPreventCursorChange;
953 
954  QgsComposerModel * mItemsModel;
955 
960 
961  QgsObjectCustomProperties mCustomProperties;
962 
963  QgsComposition(); //default constructor is forbidden
964 
966  void updateZValues( const bool addUndoCommands = true );
967 
970  int boundingRectOfSelectedItems( QRectF& bRect );
971 
973  void loadDefaults();
974 
976  void loadSettings();
977 
979  QPointF minPointFromXml( const QDomElement& elem ) const;
980 
981  void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c );
982 
983  void updatePaperItems();
984  void addPaperItem();
985  void removePaperItems();
986  void deleteAndRemoveMultiFrames();
987 
988  static QString encodeStringForXML( const QString& str );
989 
990  //tries to return the current QGraphicsView attached to the composition
991  QGraphicsView* graphicsView() const;
992 
996  void refreshPageSize( const QgsExpressionContext* context = nullptr );
997 
1007  bool dataDefinedEvaluate( QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue,
1008  const QgsExpressionContext& context,
1010 
1016  bool dataDefinedActive( const QgsComposerObject::DataDefinedProperty property,
1017  const QMap<QgsComposerObject::DataDefinedProperty, QgsDataDefined *> *dataDefinedProperties ) const;
1018 
1027  QVariant dataDefinedValue( QgsComposerObject::DataDefinedProperty property, const QgsFeature *feature, const QgsFields& fields,
1028  const QgsExpressionContext& context,
1030 
1031 
1039  void prepareDataDefinedExpression( QgsDataDefined *dd, QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* >* dataDefinedProperties, const QgsExpressionContext& context ) const;
1040 
1045  bool ddPageSizeActive() const;
1046 
1047  private slots:
1048  /*Prepares all data defined expressions*/
1049  void prepareAllDataDefinedExpressions();
1050 
1051  signals:
1052  void paperSizeChanged();
1053  void nPagesChanged();
1054 
1056  void printResolutionChanged();
1057 
1059  void selectedItemChanged( QgsComposerItem* selected );
1061  void composerArrowAdded( QgsComposerArrow* arrow );
1063  void composerHtmlFrameAdded( QgsComposerHtml* html, QgsComposerFrame* frame );
1065  void composerLabelAdded( QgsComposerLabel* label );
1067  void composerMapAdded( QgsComposerMap* map );
1069  void composerScaleBarAdded( QgsComposerScaleBar* scalebar );
1071  void composerLegendAdded( QgsComposerLegend* legend );
1073  void composerPictureAdded( QgsComposerPicture* picture );
1075  void composerShapeAdded( QgsComposerShape* shape );
1077  void composerTableAdded( QgsComposerAttributeTable* table );
1079  void composerTableFrameAdded( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
1081  void itemRemoved( QgsComposerItem* );
1082 
1084  void refreshItemsTriggered();
1085 
1087  void statusMsgChanged( const QString& message );
1088 
1089  friend class QgsComposerObject; //for accessing dataDefinedEvaluate, readDataDefinedPropertyMap and writeDataDefinedPropertyMap
1090  friend class QgsComposerModel; //for accessing updateZValues (should not be public)
1091 };
1092 
1093 template<class T> void QgsComposition::composerItems( QList<T*>& itemList )
1094 {
1095  itemList.clear();
1096  QList<QGraphicsItem *> graphicsItemList = items();
1097  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1098  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1099  {
1100  T* item = dynamic_cast<T*>( *itemIt );
1101  if ( item )
1102  {
1103  itemList.push_back( item );
1104  }
1105  }
1106 }
1107 
1108 template<class T> void QgsComposition::composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const
1109 {
1110  itemList.clear();
1111  QList<QGraphicsItem *> graphicsItemList = items();
1112  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1113  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1114  {
1115  T* item = dynamic_cast<T*>( *itemIt );
1116  if ( item && itemPageNumber( item ) == pageNumber )
1117  {
1118  itemList.push_back( item );
1119  }
1120  }
1121 }
1122 
1123 
1124 #endif
1125 
1126 
1127 
void setSnapTolerance(const int snapTolerance)
Sets the snap tolerance to use when automatically snapping items during movement and resizing to guid...
void clear()
A scale bar item that can be added to a map composition.
QUndoStack * undoStack()
Returns pointer to undo/redo command storage.
QgsComposition::AtlasMode atlasMode() const
Returns the current atlas mode of the composition.
bool snapLinesVisible() const
bool boundingBoxesVisible() const
Returns whether selection bounding boxes should be shown in the composition.
A base class for objects which belong to a map composition.
QgsFillSymbolV2 * pageStyleSymbol()
Note: added in version 2.1.
void setPrintAsRaster(const bool enabled)
A container class for data source field mapping or expression.
An item that draws an arrow between to points.
void push_back(const T &value)
QgsComposerModel * itemsModel()
Returns the items model attached to the composition.
GridStyle
Style to draw the snapping grid.
QList< QGraphicsItem * > items() const
void setPlotStyle(const QgsComposition::PlotStyle style)
const QgsMapSettings & mapSettings() const
Return setting of QGIS map canvas.
const QPen & gridPen() const
QStyle * style() const
QgsComposerMouseHandles * selectionHandles()
Returns pointer to selection handles.
bool smartGuidesEnabled() const
A item that forms part of a map composition.
Q_DECL_DEPRECATED double snapGridTolerance() const
Returns the snap tolerance to use when automatically snapping items during movement and resizing to t...
bool preventCursorChange() const
Container of fields for a vector layer.
Definition: qgsfield.h:187
A container for grouping several QgsComposerItems.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:187
A non GUI class for rendering a map layer set onto a QPainter.
double spaceBetweenPages() const
Returns the vertical space between pages in a composer view.
bool alignmentSnap() const
A table that displays attributes from a vector layer.
DataDefinedProperty
Data defined properties for different item types.
void composerItemsOnPage(QList< T * > &itemList, const int pageNumber) const
Return composer items of a specific type on a specified page.
A composer class that displays svg files or raster format (jpg, png, ...)
The QgsMapSettings class contains configuration for rendering of the map.
Q_DECL_DEPRECATED void sortZList()
Sorts the zList.
void setPreventCursorChange(const bool preventChange)
If true, prevents any mouse cursor changes by the composition or by any composer items Used by QgsCom...
int printResolution() const
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)
bool printAsRaster() const
void setWorldFileMap(QgsComposerMap *map)
QgsComposerMap * worldFileMap() const
Graphics scene for map printing.
bool snapToGridEnabled() const
Object representing map window.
Frame item for a composer multiframe item.
iterator end()
void setGenerateWorldFile(const bool enabled)
GridStyle gridStyle() const
A model for items attached to a composition.
QList< QgsPaperItem * > pages()
Return pages in the correct order.
bool useAdvancedEffects() const
Returns true if a composition should use advanced effects such as blend modes.
Q_DECL_DEPRECATED void setSnapGridTolerance(double tolerance)
Sets the snap tolerance to use when automatically snapping items during movement and resizing to the ...
A composer command class for adding / removing composer items.
double snapGridOffsetY() const
bool pagesVisible() const
Returns whether the page items are be visible in the composition.
double snapGridOffsetX() const
A table class that displays a vector attribute table.
Undo command to undo/redo all composer item related changes.
int snapTolerance() const
Returns the snap tolerance to use when automatically snapping items during movement and resizing to g...
A composer items that draws common shapes (ellipse, triangle, rectangle)
double snapGridResolution() const
AtlasMode
Composition atlas modes.
Q_DECL_DEPRECATED double alignmentSnapTolerance() const
Returns the snap tolerance to use when automatically snapping items during movement and resizing to g...
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.
bool gridVisible() const
QgsAtlasComposition & atlasComposition()
Handles drawing of selection outlines and mouse handles.
void composerItems(QList< T * > &itemList)
Return composer items of a specific type.
PlotStyle
Plot type.
bool generateWorldFile() const
QgsComposition::PlotStyle plotStyle() const
Represents a vector layer which manages a vector based data sets.
A legend that can be placed onto a map composition.
Q_DECL_DEPRECATED void setAlignmentSnapTolerance(double t)
Sets the snap tolerance to use when automatically snapping items during movement and resizing to guid...
iterator begin()
QList< QGraphicsLineItem * > * snapLines()
Returns pointer to snap lines collection.