QGIS API Documentation
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;
47 class QgsComposerPolygon;
50 class QgsComposerHtml;
51 class QgsComposerTableV2;
52 class QgsComposerItem;
54 class QgsComposerLabel;
55 class QgsComposerLegend;
56 class QgsComposerMap;
57 class QgsComposerPicture;
59 class QgsComposerShape;
64 class QgsVectorLayer;
65 class QgsComposer;
66 class QgsFillSymbolV2;
67 class QgsDataDefined;
68 class QgsComposerModel;
69 
76 class CORE_EXPORT QgsComposition : public QGraphicsScene
77 {
78  Q_OBJECT
79  public:
80 
82  enum PlotStyle
83  {
84  Preview = 0, // Use cache etc
85  Print, // Render well
86  Postscript // Fonts need different scaling!
87  };
88 
90  enum GridStyle
91  {
94  Crosses
95  };
96 
98  {
100  ZValueAbove
101  };
102 
104  {
106  Landscape
107  };
108 
110  Q_DECL_DEPRECATED QgsComposition( QgsMapRenderer* mapRenderer );
111  explicit QgsComposition( const QgsMapSettings& mapSettings );
112 
115  {
116  AtlasOff, // Composition is not being controlled by an atlas
117  PreviewAtlas, // An atlas composition is being previewed in the app
118  ExportAtlas // The composition is being exported as an atlas
119  };
120 
121  ~QgsComposition();
122 
131  void setPaperSize( double width, double height,
132  bool keepRelativeItemPosition = true );
133 
139  double paperHeight() const;
140 
146  double paperWidth() const;
147 
161  void resizePageToContents( double marginTop = 0.0, double marginRight = 0.0,
162  double marginBottom = 0.0, double marginLeft = 0.0 );
163 
174  void setResizeToContentsMargins( double marginTop, double marginRight,
175  double marginBottom, double marginLeft );
176 
187  void resizeToContentsMargins( double& marginTop, double& marginRight,
188  double& marginBottom, double& marginLeft ) const;
189 
193  double spaceBetweenPages() const { return mSpaceBetweenPages; }
194 
199  void setNumPages( const int pages );
200 
205  int numPages() const;
206 
216  bool pageIsEmpty( const int page ) const;
217 
225  bool shouldExportPage( const int page ) const;
226 
228  void setPageStyleSymbol( QgsFillSymbolV2* symbol );
230  QgsFillSymbolV2* pageStyleSymbol() { return mPageStyleSymbol; }
231 
235  QPointF positionOnPage( QPointF position ) const;
236 
240  int pageNumberForPoint( QPointF position ) const;
241 
245  void setStatusMessage( const QString & message );
246 
250  void updateSettings();
251 
252  void setSnapToGridEnabled( const bool b );
253  bool snapToGridEnabled() const {return mSnapToGrid;}
254 
255  void setGridVisible( const bool b );
256  bool gridVisible() const {return mGridVisible;}
257 
259  void setSnapLinesVisible( const bool visible );
260  bool snapLinesVisible() const {return mGuidesVisible;}
261 
262  void setAlignmentSnap( const bool s ) { mAlignmentSnap = s; }
263  bool alignmentSnap() const { return mAlignmentSnap; }
264 
265  void setSmartGuidesEnabled( const bool b ) { mSmartGuides = b; }
266  bool smartGuidesEnabled() const {return mSmartGuides;}
267 
275  void setPagesVisible( bool visible );
276 
283  bool pagesVisible() const { return mPagesVisible; }
284 
286  void clearSnapLines();
287 
288  void setSnapGridResolution( const double r );
289  double snapGridResolution() const {return mSnapGridResolution;}
290 
291  void setSnapGridOffsetX( const double offset );
292  double snapGridOffsetX() const {return mSnapGridOffsetX;}
293 
294  void setSnapGridOffsetY( const double offset );
295  double snapGridOffsetY() const {return mSnapGridOffsetY;}
296 
297  void setGridPen( const QPen& p );
298  const QPen& gridPen() const {return mGridPen;}
299 
300  void setGridStyle( const GridStyle s );
301  GridStyle gridStyle() const {return mGridStyle;}
302 
309  Q_DECL_DEPRECATED void setSnapGridTolerance( double tolerance ) { mSnapTolerance = tolerance; }
310 
317  Q_DECL_DEPRECATED double snapGridTolerance() const {return mSnapTolerance;}
318 
325  Q_DECL_DEPRECATED void setAlignmentSnapTolerance( double t ) { mSnapTolerance = t; }
326 
333  Q_DECL_DEPRECATED double alignmentSnapTolerance() const { return mSnapTolerance; }
334 
341  void setSnapTolerance( const int snapTolerance ) { mSnapTolerance = snapTolerance; }
342 
349  int snapTolerance() const { return mSnapTolerance; }
350 
356  void setBoundingBoxesVisible( const bool boundsVisible );
357 
363  bool boundingBoxesVisible() const { return mBoundingBoxesVisible; }
364 
366  QUndoStack* undoStack() { return mUndoStack; }
367 
373  QgsComposerItem* composerItemAt( QPointF position, const bool ignoreLocked = false ) const;
374 
381  QgsComposerItem* composerItemAt( QPointF position, const QgsComposerItem* belowItem, const bool ignoreLocked = false ) const;
382 
384  int pageNumberAt( QPointF position ) const;
385 
387  int itemPageNumber( const QgsComposerItem* ) const;
388 
393  QList<QgsComposerItem*> selectedComposerItems( const bool includeLockedItems = true );
394 
398  QList<const QgsComposerMap*> composerMapItems() const;
399 
404  template<class T> void composerItems( QList<T*>& itemList );
405 
412  template<class T> void composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const;
413 
417  const QgsComposerMap* getComposerMapById( const int id ) const;
418 
425  Q_DECL_DEPRECATED const QgsComposerHtml* getComposerHtmlByItem( QgsComposerItem *item ) const;
426 
432  const QgsComposerItem* getComposerItemById( const QString& theId ) const;
433 
437  const QgsComposerItem* getComposerItemByUuid( const QString& theUuid ) const;
438 
439  int printResolution() const {return mPrintResolution;}
440  void setPrintResolution( const int dpi );
441 
442  bool printAsRaster() const {return mPrintAsRaster;}
443  void setPrintAsRaster( const bool enabled ) { mPrintAsRaster = enabled; }
444 
450  bool generateWorldFile() const { return mGenerateWorldFile; }
451 
458  void setGenerateWorldFile( bool enabled ) { mGenerateWorldFile = enabled; }
459 
465  QgsComposerMap* worldFileMap() const;
466 
473  void setWorldFileMap( QgsComposerMap* map );
474 
476  bool useAdvancedEffects() const {return mUseAdvancedEffects;}
478  void setUseAdvancedEffects( const bool effectsEnabled );
479 
481  Q_DECL_DEPRECATED QgsMapRenderer* mapRenderer() { return mMapRenderer; }
483 
486  const QgsMapSettings& mapSettings() const { return mMapSettings; }
487 
488  QgsComposition::PlotStyle plotStyle() const { return mPlotStyle; }
489  void setPlotStyle( const QgsComposition::PlotStyle style ) { mPlotStyle = style; }
490 
495  Q_DECL_DEPRECATED int pixelFontSize( double pointSize ) const;
496 
500  Q_DECL_DEPRECATED double pointFontSize( int pixelSize ) const;
501 
503  bool writeXML( QDomElement& composerElem, QDomDocument& doc );
504 
506  bool readXML( const QDomElement& compositionElem, const QDomDocument& doc );
507 
516  bool loadFromTemplate( const QDomDocument& doc, QMap<QString, QString>* substitutionMap = nullptr,
517  bool addUndoCommands = false, const bool clearComposition = true );
518 
528  void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore = nullptr,
529  bool addUndoCommands = false, QPointF* pos = nullptr, bool pasteInPlace = false );
530 
532  void addItemToZList( QgsComposerItem* item );
534  void removeItemFromZList( QgsComposerItem* item );
535 
536  //functions to move selected items in hierarchy
537  void raiseSelectedItems();
538 
539  //returns true if successful
540  bool raiseItem( QgsComposerItem* item );
541  void lowerSelectedItems();
542  //returns true if successful
543  bool lowerItem( QgsComposerItem* item );
544  void moveSelectedItemsToTop();
545  //returns true if successful
546  bool moveItemToTop( QgsComposerItem* item );
547  void moveSelectedItemsToBottom();
548  //returns true if successful
549  bool moveItemToBottom( QgsComposerItem* item );
550 
551  //functions to find items by their position in the z list
552  void selectNextByZOrder( const ZValueDirection direction );
553  QgsComposerItem* getComposerItemBelow( QgsComposerItem* item ) const;
554  QgsComposerItem* getComposerItemAbove( QgsComposerItem* item ) const;
555 
556  //functions to align selected items
557  void alignSelectedItemsLeft();
558  void alignSelectedItemsHCenter();
559  void alignSelectedItemsRight();
560  void alignSelectedItemsTop();
561  void alignSelectedItemsVCenter();
562  void alignSelectedItemsBottom();
563 
564  //functions to lock and unlock items
566  void lockSelectedItems();
568  void unlockAllItems();
569 
575  QgsComposerItemGroup* groupItems( QList<QgsComposerItem*> items );
576 
584  QList<QgsComposerItem*> ungroupItems( QgsComposerItemGroup* group );
585 
590  Q_DECL_DEPRECATED void sortZList() {}
591 
595  void refreshZList();
596 
598  QPointF snapPointToGrid( QPointF scenePoint ) const;
599 
601  QList< QGraphicsLineItem* >* snapLines() {return &mSnapLines;}
602 
606  QgsComposerMouseHandles* selectionHandles() {return mSelectionHandles;}
607 
609  QGraphicsLineItem* addSnapLine();
611  void removeSnapLine( QGraphicsLineItem* line );
615  QGraphicsLineItem* nearestSnapLine( const bool horizontal, const double x, const double y, const double tolerance, QList< QPair< QgsComposerItem*, QgsComposerItem::ItemPositionMode > >& snappedItems ) const;
616 
622  void beginCommand( QgsComposerItem* item, const QString& commandText, const QgsComposerMergeCommand::Context c = QgsComposerMergeCommand::Unknown );
623 
625  void endCommand();
627  void cancelCommand();
628 
629  void beginMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, const QgsComposerMultiFrameMergeCommand::Context c = QgsComposerMultiFrameMergeCommand::Unknown );
630  void endMultiFrameCommand();
632  void cancelMultiFrameCommand();
633 
635  void addMultiFrame( QgsComposerMultiFrame* multiFrame );
637  void removeMultiFrame( QgsComposerMultiFrame* multiFrame );
640  void addComposerArrow( QgsComposerArrow* arrow );
642  void addComposerLabel( QgsComposerLabel* label );
644  void addComposerMap( QgsComposerMap* map, const bool setDefaultPreviewStyle = true );
646  void addComposerScaleBar( QgsComposerScaleBar* scaleBar );
648  void addComposerLegend( QgsComposerLegend* legend );
650  void addComposerPicture( QgsComposerPicture* picture );
652  void addComposerShape( QgsComposerShape* shape );
654  void addComposerPolygon( QgsComposerPolygon* polygon );
656  void addComposerPolyline( QgsComposerPolyline* polyline );
658  void addComposerTable( QgsComposerAttributeTable* table );
660  void addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame );
662  void addComposerTableFrame( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
663 
665  void removeComposerItem( QgsComposerItem* item, const bool createCommand = true, const bool removeGroupItems = true );
666 
668  void pushAddRemoveCommand( QgsComposerItem* item, const QString& text, const QgsAddRemoveItemCommand::State state = QgsAddRemoveItemCommand::Added );
669 
673  void setPreventCursorChange( const bool preventChange ) { mPreventCursorChange = preventChange; }
674  bool preventCursorChange() const { return mPreventCursorChange; }
675 
676  //printing
677 
679  void beginPrint( QPrinter& printer, const bool evaluateDDPageSize = false );
681  void beginPrintAsPDF( QPrinter& printer, const QString& file );
682 
688  void doPrint( QPrinter& printer, QPainter& painter, bool startNewPage = false );
689 
693  bool print( QPrinter &printer, const bool evaluateDDPageSize = false );
694 
698  bool exportAsPDF( const QString& file );
699 
711  QImage printPageAsRaster( int page, QSize imageSize = QSize(), int dpi = 0 );
712 
726  QImage renderRectAsRaster( const QRectF& rect, QSize imageSize = QSize(), int dpi = 0 );
727 
734  void renderPage( QPainter* p, int page );
735 
744  void renderRect( QPainter* p, const QRectF& rect );
745 
749  void computeWorldFileParameters( double& a, double& b, double& c, double& d, double& e, double& f ) const;
750 
761  void computeWorldFileParameters( const QRectF& exportRegion, double& a, double& b, double& c, double& d, double& e, double& f ) const;
762 
763  QgsAtlasComposition& atlasComposition() { return mAtlasComposition; }
764 
768  Q_DECL_DEPRECATED static void relativeResizeRect( QRectF& rectToResize, const QRectF& boundsBefore, const QRectF& boundsAfter );
769 
773  Q_DECL_DEPRECATED static double relativePosition( double position, double beforeMin, double beforeMax, double afterMin, double afterMax );
774 
779  QgsComposition::AtlasMode atlasMode() const { return mAtlasMode; }
780 
786  bool setAtlasMode( const QgsComposition::AtlasMode mode );
787 
792  QList< QgsPaperItem* > pages() { return mPages; }
793 
798  QgsDataDefined* dataDefinedProperty( const QgsComposerObject::DataDefinedProperty property );
799 
808  void setDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property, bool active, bool useExpression, const QString &expression, const QString &field );
809 
814  QgsComposerModel * itemsModel() { return mItemsModel; }
815 
824  void setCustomProperty( const QString &key, const QVariant &value );
825 
835  QVariant customProperty( const QString &key, const QVariant &defaultValue = QVariant() ) const;
836 
844  void removeCustomProperty( const QString &key );
845 
852  QStringList customProperties() const;
853 
859  QRectF pageItemBounds( int pageNumber, bool visibleOnly = false ) const;
860 
865  QRectF compositionBounds( bool ignorePages = false, double margin = 0.0 ) const;
866 
867  public slots:
869  void sendItemAddedSignal( QgsComposerItem* item );
870 
873  void updateBounds();
874 
880  void refreshItems();
881 
885  void setSelectedItem( QgsComposerItem* item );
886 
891  void setAllUnselected();
892 
901  void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext* context = nullptr );
902 
907  QgsExpressionContext* createExpressionContext() const;
908 
909  protected:
910  void init();
911 
912 
913  private:
915  QgsMapRenderer* mMapRenderer;
916  const QgsMapSettings& mMapSettings;
917 
918  QgsComposition::PlotStyle mPlotStyle;
919  double mPageWidth;
920  double mPageHeight;
921  QList< QgsPaperItem* > mPages;
922  double mSpaceBetweenPages; //space in preview between pages
923 
925  QgsFillSymbolV2* mPageStyleSymbol;
926  void createDefaultPageStyleSymbol();
927 
929  QSet<QgsComposerMultiFrame*> mMultiFrames;
930 
932  int mPrintResolution;
933 
935  bool mPrintAsRaster;
936 
938  bool mGenerateWorldFile;
939 
941  QString mWorldFileMapId;
942 
944  bool mUseAdvancedEffects;
945 
947  bool mSnapToGrid;
948  bool mGridVisible;
949  double mSnapGridResolution;
950  double mSnapGridOffsetX;
951  double mSnapGridOffsetY;
952  QPen mGridPen;
953  GridStyle mGridStyle;
954 
956  bool mAlignmentSnap;
957  bool mGuidesVisible;
958  bool mSmartGuides;
959  int mSnapTolerance;
960 
962  QList< QGraphicsLineItem* > mSnapLines;
963 
964  double mResizeToContentsMarginTop;
965  double mResizeToContentsMarginRight;
966  double mResizeToContentsMarginBottom;
967  double mResizeToContentsMarginLeft;
968 
969  bool mBoundingBoxesVisible;
970  bool mPagesVisible;
971  QgsComposerMouseHandles* mSelectionHandles;
972 
973  QUndoStack* mUndoStack;
974 
975  QgsComposerItemCommand* mActiveItemCommand;
976  QgsComposerMultiFrameCommand* mActiveMultiFrameCommand;
977 
979  QgsAtlasComposition mAtlasComposition;
980 
981  QgsComposition::AtlasMode mAtlasMode;
982 
983  bool mPreventCursorChange;
984 
985  QgsComposerModel * mItemsModel;
986 
991 
992  QgsObjectCustomProperties mCustomProperties;
993 
994  QgsComposition(); //default constructor is forbidden
995 
997  void updateZValues( const bool addUndoCommands = true );
998 
1001  int boundingRectOfSelectedItems( QRectF& bRect );
1002 
1004  void loadDefaults();
1005 
1007  void loadSettings();
1008 
1010  QPointF minPointFromXml( const QDomElement& elem ) const;
1011 
1012  void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c );
1013 
1014  void updatePaperItems();
1015  void addPaperItem();
1016  void removePaperItems();
1017  void deleteAndRemoveMultiFrames();
1018 
1019  static QString encodeStringForXML( const QString& str );
1020 
1021  //tries to return the current QGraphicsView attached to the composition
1022  QGraphicsView* graphicsView() const;
1023 
1027  void refreshPageSize( const QgsExpressionContext* context = nullptr );
1028 
1038  bool dataDefinedEvaluate( QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue,
1039  const QgsExpressionContext& context,
1041 
1047  bool dataDefinedActive( const QgsComposerObject::DataDefinedProperty property,
1048  const QMap<QgsComposerObject::DataDefinedProperty, QgsDataDefined *> *dataDefinedProperties ) const;
1049 
1058  QVariant dataDefinedValue( QgsComposerObject::DataDefinedProperty property, const QgsFeature *feature, const QgsFields& fields,
1059  const QgsExpressionContext& context,
1061 
1062 
1070  void prepareDataDefinedExpression( QgsDataDefined *dd, QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* >* dataDefinedProperties, const QgsExpressionContext& context ) const;
1071 
1076  bool ddPageSizeActive() const;
1077 
1078  private slots:
1079  /*Prepares all data defined expressions*/
1080  void prepareAllDataDefinedExpressions();
1081 
1082  signals:
1083  void paperSizeChanged();
1084  void nPagesChanged();
1085 
1087  void printResolutionChanged();
1088 
1090  void selectedItemChanged( QgsComposerItem* selected );
1092  void composerArrowAdded( QgsComposerArrow* arrow );
1094  void composerPolygonAdded( QgsComposerPolygon* polygon );
1096  void composerPolylineAdded( QgsComposerPolyline* polyline );
1098  void composerHtmlFrameAdded( QgsComposerHtml* html, QgsComposerFrame* frame );
1100  void composerLabelAdded( QgsComposerLabel* label );
1102  void composerMapAdded( QgsComposerMap* map );
1104  void composerScaleBarAdded( QgsComposerScaleBar* scalebar );
1106  void composerLegendAdded( QgsComposerLegend* legend );
1108  void composerPictureAdded( QgsComposerPicture* picture );
1110  void composerShapeAdded( QgsComposerShape* shape );
1112  void composerTableAdded( QgsComposerAttributeTable* table );
1114  void composerTableFrameAdded( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
1116  void itemRemoved( QgsComposerItem* );
1117 
1119  void refreshItemsTriggered();
1120 
1122  void statusMsgChanged( const QString& message );
1123 
1124  friend class QgsComposerObject; //for accessing dataDefinedEvaluate, readDataDefinedPropertyMap and writeDataDefinedPropertyMap
1125  friend class QgsComposerModel; //for accessing updateZValues (should not be public)
1126 };
1127 
1128 template<class T> void QgsComposition::composerItems( QList<T*>& itemList )
1129 {
1130  itemList.clear();
1131  QList<QGraphicsItem *> graphicsItemList = items();
1132  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1133  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1134  {
1135  T* item = dynamic_cast<T*>( *itemIt );
1136  if ( item )
1137  {
1138  itemList.push_back( item );
1139  }
1140  }
1141 }
1142 
1143 template<class T> void QgsComposition::composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const
1144 {
1145  itemList.clear();
1146  QList<QGraphicsItem *> graphicsItemList = items();
1147  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1148  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1149  {
1150  T* item = dynamic_cast<T*>( *itemIt );
1151  if ( item && itemPageNumber( item ) == pageNumber )
1152  {
1153  itemList.push_back( item );
1154  }
1155  }
1156 }
1157 
1158 
1159 #endif
1160 
1161 
1162 
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.
Composer item for polylines.
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)
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.
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
Graphics scene for map printing.
bool snapToGridEnabled() const
Object representing map window.
Frame item for a composer multiframe item.
iterator end()
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)
Composer item for polygons.
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
Returns true if the composition will generate corresponding world files when pages are exported...
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.