QGIS API Documentation  2.15.0-Master (972fc9f)
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 
755  void georeferenceOutput( const QString& file, QgsComposerMap* referenceMap = nullptr,
756  const QRectF& exportRegion = QRectF(), double dpi = -1 ) const;
757 
761  void computeWorldFileParameters( double& a, double& b, double& c, double& d, double& e, double& f ) const;
762 
773  void computeWorldFileParameters( const QRectF& exportRegion, double& a, double& b, double& c, double& d, double& e, double& f ) const;
774 
775  QgsAtlasComposition& atlasComposition() { return mAtlasComposition; }
776 
780  Q_DECL_DEPRECATED static void relativeResizeRect( QRectF& rectToResize, const QRectF& boundsBefore, const QRectF& boundsAfter );
781 
785  Q_DECL_DEPRECATED static double relativePosition( double position, double beforeMin, double beforeMax, double afterMin, double afterMax );
786 
791  QgsComposition::AtlasMode atlasMode() const { return mAtlasMode; }
792 
798  bool setAtlasMode( const QgsComposition::AtlasMode mode );
799 
804  QList< QgsPaperItem* > pages() { return mPages; }
805 
810  QgsDataDefined* dataDefinedProperty( const QgsComposerObject::DataDefinedProperty property );
811 
820  void setDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property, bool active, bool useExpression, const QString &expression, const QString &field );
821 
826  QgsComposerModel * itemsModel() { return mItemsModel; }
827 
836  void setCustomProperty( const QString &key, const QVariant &value );
837 
847  QVariant customProperty( const QString &key, const QVariant &defaultValue = QVariant() ) const;
848 
856  void removeCustomProperty( const QString &key );
857 
864  QStringList customProperties() const;
865 
871  QRectF pageItemBounds( int pageNumber, bool visibleOnly = false ) const;
872 
877  QRectF compositionBounds( bool ignorePages = false, double margin = 0.0 ) const;
878 
879  public slots:
881  void sendItemAddedSignal( QgsComposerItem* item );
882 
885  void updateBounds();
886 
892  void refreshItems();
893 
897  void setSelectedItem( QgsComposerItem* item );
898 
903  void setAllUnselected();
904 
913  void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext* context = nullptr );
914 
919  QgsExpressionContext* createExpressionContext() const;
920 
921  protected:
922  void init();
923 
924 
925  private:
927  QgsMapRenderer* mMapRenderer;
928  const QgsMapSettings& mMapSettings;
929 
930  QgsComposition::PlotStyle mPlotStyle;
931  double mPageWidth;
932  double mPageHeight;
933  QList< QgsPaperItem* > mPages;
934  double mSpaceBetweenPages; //space in preview between pages
935 
937  QgsFillSymbolV2* mPageStyleSymbol;
938  void createDefaultPageStyleSymbol();
939 
941  QSet<QgsComposerMultiFrame*> mMultiFrames;
942 
944  int mPrintResolution;
945 
947  bool mPrintAsRaster;
948 
950  bool mGenerateWorldFile;
951 
953  QString mWorldFileMapId;
954 
956  bool mUseAdvancedEffects;
957 
959  bool mSnapToGrid;
960  bool mGridVisible;
961  double mSnapGridResolution;
962  double mSnapGridOffsetX;
963  double mSnapGridOffsetY;
964  QPen mGridPen;
965  GridStyle mGridStyle;
966 
968  bool mAlignmentSnap;
969  bool mGuidesVisible;
970  bool mSmartGuides;
971  int mSnapTolerance;
972 
974  QList< QGraphicsLineItem* > mSnapLines;
975 
976  double mResizeToContentsMarginTop;
977  double mResizeToContentsMarginRight;
978  double mResizeToContentsMarginBottom;
979  double mResizeToContentsMarginLeft;
980 
981  bool mBoundingBoxesVisible;
982  bool mPagesVisible;
983  QgsComposerMouseHandles* mSelectionHandles;
984 
985  QUndoStack* mUndoStack;
986 
987  QgsComposerItemCommand* mActiveItemCommand;
988  QgsComposerMultiFrameCommand* mActiveMultiFrameCommand;
989 
991  QgsAtlasComposition mAtlasComposition;
992 
993  QgsComposition::AtlasMode mAtlasMode;
994 
995  bool mPreventCursorChange;
996 
997  QgsComposerModel * mItemsModel;
998 
1003 
1004  QgsObjectCustomProperties mCustomProperties;
1005 
1006  QgsComposition(); //default constructor is forbidden
1007 
1009  void updateZValues( const bool addUndoCommands = true );
1010 
1013  int boundingRectOfSelectedItems( QRectF& bRect );
1014 
1016  void loadDefaults();
1017 
1019  void loadSettings();
1020 
1022  QPointF minPointFromXml( const QDomElement& elem ) const;
1023 
1024  void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c );
1025 
1026  void updatePaperItems();
1027  void addPaperItem();
1028  void removePaperItems();
1029  void deleteAndRemoveMultiFrames();
1030 
1031  static QString encodeStringForXML( const QString& str );
1032 
1033  //tries to return the current QGraphicsView attached to the composition
1034  QGraphicsView* graphicsView() const;
1035 
1039  void refreshPageSize( const QgsExpressionContext* context = nullptr );
1040 
1050  bool dataDefinedEvaluate( QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue,
1051  const QgsExpressionContext& context,
1053 
1059  bool dataDefinedActive( const QgsComposerObject::DataDefinedProperty property,
1060  const QMap<QgsComposerObject::DataDefinedProperty, QgsDataDefined *> *dataDefinedProperties ) const;
1061 
1070  QVariant dataDefinedValue( QgsComposerObject::DataDefinedProperty property, const QgsFeature *feature, const QgsFields& fields,
1071  const QgsExpressionContext& context,
1073 
1074 
1082  void prepareDataDefinedExpression( QgsDataDefined *dd, QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* >* dataDefinedProperties, const QgsExpressionContext& context ) const;
1083 
1088  bool ddPageSizeActive() const;
1089 
1098  double* computeGeoTransform( const QgsComposerMap* referenceMap = nullptr, const QRectF& exportRegion = QRectF(), double dpi = -1 ) const;
1099 
1100 
1101  private slots:
1102  /*Prepares all data defined expressions*/
1103  void prepareAllDataDefinedExpressions();
1104 
1105  signals:
1106  void paperSizeChanged();
1107  void nPagesChanged();
1108 
1110  void printResolutionChanged();
1111 
1113  void selectedItemChanged( QgsComposerItem* selected );
1115  void composerArrowAdded( QgsComposerArrow* arrow );
1117  void composerPolygonAdded( QgsComposerPolygon* polygon );
1119  void composerPolylineAdded( QgsComposerPolyline* polyline );
1121  void composerHtmlFrameAdded( QgsComposerHtml* html, QgsComposerFrame* frame );
1123  void composerItemGroupAdded( QgsComposerItemGroup* group );
1125  void composerLabelAdded( QgsComposerLabel* label );
1127  void composerMapAdded( QgsComposerMap* map );
1129  void composerScaleBarAdded( QgsComposerScaleBar* scalebar );
1131  void composerLegendAdded( QgsComposerLegend* legend );
1133  void composerPictureAdded( QgsComposerPicture* picture );
1135  void composerShapeAdded( QgsComposerShape* shape );
1137  void composerTableAdded( QgsComposerAttributeTable* table );
1139  void composerTableFrameAdded( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
1141  void itemRemoved( QgsComposerItem* );
1142 
1144  void refreshItemsTriggered();
1145 
1147  void statusMsgChanged( const QString& message );
1148 
1149  friend class QgsComposerObject; //for accessing dataDefinedEvaluate, readDataDefinedPropertyMap and writeDataDefinedPropertyMap
1150  friend class QgsComposerModel; //for accessing updateZValues (should not be public)
1151  friend class TestQgsComposition;
1152 };
1153 
1154 template<class T> void QgsComposition::composerItems( QList<T*>& itemList )
1155 {
1156  itemList.clear();
1157  QList<QGraphicsItem *> graphicsItemList = items();
1158  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1159  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1160  {
1161  T* item = dynamic_cast<T*>( *itemIt );
1162  if ( item )
1163  {
1164  itemList.push_back( item );
1165  }
1166  }
1167 }
1168 
1169 template<class T> void QgsComposition::composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const
1170 {
1171  itemList.clear();
1172  QList<QGraphicsItem *> graphicsItemList = items();
1173  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1174  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1175  {
1176  T* item = dynamic_cast<T*>( *itemIt );
1177  if ( item && itemPageNumber( item ) == pageNumber )
1178  {
1179  itemList.push_back( item );
1180  }
1181  }
1182 }
1183 
1184 
1185 #endif
1186 
1187 
1188 
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:193
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.