QGIS API Documentation  2.13.0-Master
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 
414  const QgsComposerMap* getComposerMapById( const int id ) const;
415 
422  Q_DECL_DEPRECATED const QgsComposerHtml* getComposerHtmlByItem( QgsComposerItem *item ) const;
423 
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 
595  void beginCommand( QgsComposerItem* item, const QString& commandText, const QgsComposerMergeCommand::Context c = QgsComposerMergeCommand::Unknown );
596 
598  void endCommand();
600  void cancelCommand();
601 
602  void beginMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, const QgsComposerMultiFrameMergeCommand::Context c = QgsComposerMultiFrameMergeCommand::Unknown );
603  void endMultiFrameCommand();
605  void cancelMultiFrameCommand();
606 
608  void addMultiFrame( QgsComposerMultiFrame* multiFrame );
610  void removeMultiFrame( QgsComposerMultiFrame* multiFrame );
613  void addComposerArrow( QgsComposerArrow* arrow );
615  void addComposerLabel( QgsComposerLabel* label );
617  void addComposerMap( QgsComposerMap* map, const bool setDefaultPreviewStyle = true );
619  void addComposerScaleBar( QgsComposerScaleBar* scaleBar );
621  void addComposerLegend( QgsComposerLegend* legend );
623  void addComposerPicture( QgsComposerPicture* picture );
625  void addComposerShape( QgsComposerShape* shape );
627  void addComposerTable( QgsComposerAttributeTable* table );
629  void addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame );
631  void addComposerTableFrame( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
632 
634  void removeComposerItem( QgsComposerItem* item, const bool createCommand = true, const bool removeGroupItems = true );
635 
637  void pushAddRemoveCommand( QgsComposerItem* item, const QString& text, const QgsAddRemoveItemCommand::State state = QgsAddRemoveItemCommand::Added );
638 
641  void setPreventCursorChange( const bool preventChange ) { mPreventCursorChange = preventChange; }
642  bool preventCursorChange() const { return mPreventCursorChange; }
643 
644  //printing
645 
647  void beginPrint( QPrinter& printer, const bool evaluateDDPageSize = false );
649  void beginPrintAsPDF( QPrinter& printer, const QString& file );
650 
656  void doPrint( QPrinter& printer, QPainter& painter, bool startNewPage = false );
657 
661  bool print( QPrinter &printer, const bool evaluateDDPageSize = false );
662 
666  bool exportAsPDF( const QString& file );
667 
679  QImage printPageAsRaster( int page, QSize imageSize = QSize(), int dpi = 0 );
680 
694  QImage renderRectAsRaster( const QRectF& rect, QSize imageSize = QSize(), int dpi = 0 );
695 
702  void renderPage( QPainter* p, int page );
703 
712  void renderRect( QPainter* p, const QRectF& rect );
713 
717  void computeWorldFileParameters( double& a, double& b, double& c, double& d, double& e, double& f ) const;
718 
729  void computeWorldFileParameters( const QRectF& exportRegion, double& a, double& b, double& c, double& d, double& e, double& f ) const;
730 
731  QgsAtlasComposition& atlasComposition() { return mAtlasComposition; }
732 
736  Q_DECL_DEPRECATED static void relativeResizeRect( QRectF& rectToResize, const QRectF& boundsBefore, const QRectF& boundsAfter );
737 
741  Q_DECL_DEPRECATED static double relativePosition( double position, double beforeMin, double beforeMax, double afterMin, double afterMax );
742 
747  QgsComposition::AtlasMode atlasMode() const { return mAtlasMode; }
748 
754  bool setAtlasMode( const QgsComposition::AtlasMode mode );
755 
759  QList< QgsPaperItem* > pages() { return mPages; }
760 
765  QgsDataDefined* dataDefinedProperty( const QgsComposerObject::DataDefinedProperty property );
766 
775  void setDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property, bool active, bool useExpression, const QString &expression, const QString &field );
776 
781  QgsComposerModel * itemsModel() { return mItemsModel; }
782 
791  void setCustomProperty( const QString &key, const QVariant &value );
792 
802  QVariant customProperty( const QString &key, const QVariant &defaultValue = QVariant() ) const;
803 
811  void removeCustomProperty( const QString &key );
812 
819  QStringList customProperties() const;
820 
826  QRectF pageItemBounds( int pageNumber, bool visibleOnly = false ) const;
827 
832  QRectF compositionBounds( bool ignorePages = false, double margin = 0.0 ) const;
833 
834  public slots:
836  void sendItemAddedSignal( QgsComposerItem* item );
837 
840  void updateBounds();
841 
847  void refreshItems();
848 
852  void setSelectedItem( QgsComposerItem* item );
853 
858  void setAllUnselected();
859 
868  void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext* context = nullptr );
869 
874  QgsExpressionContext* createExpressionContext() const;
875 
876  protected:
877  void init();
878 
879 
880  private:
882  QgsMapRenderer* mMapRenderer;
883  const QgsMapSettings& mMapSettings;
884 
885  QgsComposition::PlotStyle mPlotStyle;
886  double mPageWidth;
887  double mPageHeight;
888  QList< QgsPaperItem* > mPages;
889  double mSpaceBetweenPages; //space in preview between pages
890 
892  QgsFillSymbolV2* mPageStyleSymbol;
893  void createDefaultPageStyleSymbol();
894 
896  QSet<QgsComposerMultiFrame*> mMultiFrames;
897 
899  int mPrintResolution;
900 
902  bool mPrintAsRaster;
903 
905  bool mGenerateWorldFile;
907  QgsComposerMap* mWorldFileMap;
908 
910  bool mUseAdvancedEffects;
911 
913  bool mSnapToGrid;
914  bool mGridVisible;
915  double mSnapGridResolution;
916  double mSnapGridOffsetX;
917  double mSnapGridOffsetY;
918  QPen mGridPen;
919  GridStyle mGridStyle;
920 
922  bool mAlignmentSnap;
923  bool mGuidesVisible;
924  bool mSmartGuides;
925  int mSnapTolerance;
926 
928  QList< QGraphicsLineItem* > mSnapLines;
929 
930  double mResizeToContentsMarginTop;
931  double mResizeToContentsMarginRight;
932  double mResizeToContentsMarginBottom;
933  double mResizeToContentsMarginLeft;
934 
935  bool mBoundingBoxesVisible;
936  bool mPagesVisible;
937  QgsComposerMouseHandles* mSelectionHandles;
938 
939  QUndoStack* mUndoStack;
940 
941  QgsComposerItemCommand* mActiveItemCommand;
942  QgsComposerMultiFrameCommand* mActiveMultiFrameCommand;
943 
945  QgsAtlasComposition mAtlasComposition;
946 
947  QgsComposition::AtlasMode mAtlasMode;
948 
949  bool mPreventCursorChange;
950 
951  QgsComposerModel * mItemsModel;
952 
957 
958  QgsObjectCustomProperties mCustomProperties;
959 
960  QgsComposition(); //default constructor is forbidden
961 
963  void updateZValues( const bool addUndoCommands = true );
964 
967  int boundingRectOfSelectedItems( QRectF& bRect );
968 
970  void loadDefaults();
971 
973  void loadSettings();
974 
976  QPointF minPointFromXml( const QDomElement& elem ) const;
977 
978  void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c );
979 
980  void updatePaperItems();
981  void addPaperItem();
982  void removePaperItems();
983  void deleteAndRemoveMultiFrames();
984 
985  static QString encodeStringForXML( const QString& str );
986 
987  //tries to return the current QGraphicsView attached to the composition
988  QGraphicsView* graphicsView() const;
989 
993  void refreshPageSize( const QgsExpressionContext* context = nullptr );
994 
1004  bool dataDefinedEvaluate( QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue,
1005  const QgsExpressionContext& context,
1007 
1013  bool dataDefinedActive( const QgsComposerObject::DataDefinedProperty property,
1014  const QMap<QgsComposerObject::DataDefinedProperty, QgsDataDefined *> *dataDefinedProperties ) const;
1015 
1024  QVariant dataDefinedValue( QgsComposerObject::DataDefinedProperty property, const QgsFeature *feature, const QgsFields& fields,
1025  const QgsExpressionContext& context,
1027 
1028 
1036  void prepareDataDefinedExpression( QgsDataDefined *dd, QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* >* dataDefinedProperties, const QgsExpressionContext& context ) const;
1037 
1042  bool ddPageSizeActive() const;
1043 
1044  private slots:
1045  /*Prepares all data defined expressions*/
1046  void prepareAllDataDefinedExpressions();
1047 
1048  signals:
1049  void paperSizeChanged();
1050  void nPagesChanged();
1051 
1053  void printResolutionChanged();
1054 
1056  void selectedItemChanged( QgsComposerItem* selected );
1058  void composerArrowAdded( QgsComposerArrow* arrow );
1060  void composerHtmlFrameAdded( QgsComposerHtml* html, QgsComposerFrame* frame );
1062  void composerLabelAdded( QgsComposerLabel* label );
1064  void composerMapAdded( QgsComposerMap* map );
1066  void composerScaleBarAdded( QgsComposerScaleBar* scalebar );
1068  void composerLegendAdded( QgsComposerLegend* legend );
1070  void composerPictureAdded( QgsComposerPicture* picture );
1072  void composerShapeAdded( QgsComposerShape* shape );
1074  void composerTableAdded( QgsComposerAttributeTable* table );
1076  void composerTableFrameAdded( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
1078  void itemRemoved( QgsComposerItem* );
1079 
1081  void refreshItemsTriggered();
1082 
1084  void statusMsgChanged( const QString& message );
1085 
1086  friend class QgsComposerObject; //for accessing dataDefinedEvaluate, readDataDefinedPropertyMap and writeDataDefinedPropertyMap
1087  friend class QgsComposerModel; //for accessing updateZValues (should not be public)
1088 };
1089 
1090 template<class T> void QgsComposition::composerItems( QList<T*>& itemList )
1091 {
1092  itemList.clear();
1093  QList<QGraphicsItem *> graphicsItemList = items();
1094  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1095  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1096  {
1097  T* item = dynamic_cast<T*>( *itemIt );
1098  if ( item )
1099  {
1100  itemList.push_back( item );
1101  }
1102  }
1103 }
1104 
1105 template<class T> void QgsComposition::composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const
1106 {
1107  itemList.clear();
1108  QList<QGraphicsItem *> graphicsItemList = items();
1109  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1110  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1111  {
1112  T* item = dynamic_cast<T*>( *itemIt );
1113  if ( item && itemPageNumber( item ) == pageNumber )
1114  {
1115  itemList.push_back( item );
1116  }
1117  }
1118 }
1119 
1120 
1121 #endif
1122 
1123 
1124 
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.
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:189
A container for grouping several QgsComposerItems.
DataDefinedProperty
Data defined properties for different item types.
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.
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.
int itemPageNumber(const QgsComposerItem *) const
Returns on which page number (0-based) is displayed an item.
void setPreventCursorChange(const bool preventChange)
If true, prevents any mouse cursor changes by the composition or by any composer items Used by QgsCom...
PlotStyle
Plot type.
int printResolution() const
GridStyle
Style to draw the snapping grid.
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.
AtlasMode
Composition atlas modes.
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
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.
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.