QGIS API Documentation  2.11.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 : blazek@itc.it
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 
128  void setPaperSize( const double width, const double height );
129 
135  double paperHeight() const;
136 
142  double paperWidth() const;
143 
147  double spaceBetweenPages() const { return mSpaceBetweenPages; }
148 
153  void setNumPages( const int pages );
154 
159  int numPages() const;
160 
170  bool pageIsEmpty( const int page ) const;
171 
179  bool shouldExportPage( const int page ) const;
180 
182  void setPageStyleSymbol( QgsFillSymbolV2* symbol );
184  QgsFillSymbolV2* pageStyleSymbol() { return mPageStyleSymbol; }
185 
189  QPointF positionOnPage( const QPointF & position ) const;
190 
194  int pageNumberForPoint( const QPointF & position ) const;
195 
199  void setStatusMessage( const QString & message );
200 
204  void updateSettings();
205 
206  void setSnapToGridEnabled( const bool b );
207  bool snapToGridEnabled() const {return mSnapToGrid;}
208 
209  void setGridVisible( const bool b );
210  bool gridVisible() const {return mGridVisible;}
211 
213  void setSnapLinesVisible( const bool visible );
214  bool snapLinesVisible() const {return mGuidesVisible;}
215 
216  void setAlignmentSnap( const bool s ) { mAlignmentSnap = s; }
217  bool alignmentSnap() const { return mAlignmentSnap; }
218 
219  void setSmartGuidesEnabled( const bool b ) { mSmartGuides = b; }
220  bool smartGuidesEnabled() const {return mSmartGuides;}
221 
223  void clearSnapLines();
224 
225  void setSnapGridResolution( const double r );
226  double snapGridResolution() const {return mSnapGridResolution;}
227 
228  void setSnapGridOffsetX( const double offset );
229  double snapGridOffsetX() const {return mSnapGridOffsetX;}
230 
231  void setSnapGridOffsetY( const double offset );
232  double snapGridOffsetY() const {return mSnapGridOffsetY;}
233 
234  void setGridPen( const QPen& p );
235  const QPen& gridPen() const {return mGridPen;}
236 
237  void setGridStyle( const GridStyle s );
238  GridStyle gridStyle() const {return mGridStyle;}
239 
246  Q_DECL_DEPRECATED void setSnapGridTolerance( double tolerance ) { mSnapTolerance = tolerance; }
247 
254  Q_DECL_DEPRECATED double snapGridTolerance() const {return mSnapTolerance;}
255 
262  Q_DECL_DEPRECATED void setAlignmentSnapTolerance( double t ) { mSnapTolerance = t; }
263 
270  Q_DECL_DEPRECATED double alignmentSnapTolerance() const { return mSnapTolerance; }
271 
278  void setSnapTolerance( const int snapTolerance ) { mSnapTolerance = snapTolerance; }
279 
286  int snapTolerance() const { return mSnapTolerance; }
287 
293  void setBoundingBoxesVisible( const bool boundsVisible );
294 
300  bool boundingBoxesVisible() const { return mBoundingBoxesVisible; }
301 
303  QUndoStack* undoStack() { return mUndoStack; }
304 
310  QgsComposerItem* composerItemAt( const QPointF & position, const bool ignoreLocked = false ) const;
311 
318  QgsComposerItem* composerItemAt( const QPointF & position, const QgsComposerItem* belowItem, const bool ignoreLocked = false ) const;
319 
321  int pageNumberAt( const QPointF& position ) const;
322 
324  int itemPageNumber( const QgsComposerItem* ) const;
325 
330  QList<QgsComposerItem*> selectedComposerItems( const bool includeLockedItems = true );
331 
335  QList<const QgsComposerMap*> composerMapItems() const;
336 
341  template<class T> void composerItems( QList<T*>& itemList );
342 
349  template<class T> void composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const;
350 
353  const QgsComposerMap* getComposerMapById( const int id ) const;
354 
360  Q_DECL_DEPRECATED const QgsComposerHtml* getComposerHtmlByItem( QgsComposerItem *item ) const;
361 
368  const QgsComposerItem* getComposerItemById( const QString theId ) const;
369 
373  const QgsComposerItem* getComposerItemByUuid( const QString theUuid ) const;
374 
375  int printResolution() const {return mPrintResolution;}
376  void setPrintResolution( const int dpi );
377 
378  bool printAsRaster() const {return mPrintAsRaster;}
379  void setPrintAsRaster( const bool enabled ) { mPrintAsRaster = enabled; }
380 
381  bool generateWorldFile() const { return mGenerateWorldFile; }
382  void setGenerateWorldFile( const bool enabled ) { mGenerateWorldFile = enabled; }
383 
384  QgsComposerMap* worldFileMap() const { return mWorldFileMap; }
385  void setWorldFileMap( QgsComposerMap* map ) { mWorldFileMap = map; }
386 
388  bool useAdvancedEffects() const {return mUseAdvancedEffects;}
390  void setUseAdvancedEffects( const bool effectsEnabled );
391 
393  Q_DECL_DEPRECATED QgsMapRenderer* mapRenderer() { return mMapRenderer; }
395 
398  const QgsMapSettings& mapSettings() const { return mMapSettings; }
399 
400  QgsComposition::PlotStyle plotStyle() const { return mPlotStyle; }
401  void setPlotStyle( const QgsComposition::PlotStyle style ) { mPlotStyle = style; }
402 
407  Q_DECL_DEPRECATED int pixelFontSize( double pointSize ) const;
408 
412  Q_DECL_DEPRECATED double pointFontSize( int pixelSize ) const;
413 
415  bool writeXML( QDomElement& composerElem, QDomDocument& doc );
416 
418  bool readXML( const QDomElement& compositionElem, const QDomDocument& doc );
419 
428  bool loadFromTemplate( const QDomDocument& doc, QMap<QString, QString>* substitutionMap = 0,
429  bool addUndoCommands = false, const bool clearComposition = true );
430 
440  void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore = 0,
441  bool addUndoCommands = false, QPointF* pos = 0, bool pasteInPlace = false );
442 
444  void addItemToZList( QgsComposerItem* item );
446  void removeItemFromZList( QgsComposerItem* item );
447 
448  //functions to move selected items in hierarchy
449  void raiseSelectedItems();
450 
451  //returns true if successful
452  bool raiseItem( QgsComposerItem* item );
453  void lowerSelectedItems();
454  //returns true if successful
455  bool lowerItem( QgsComposerItem* item );
456  void moveSelectedItemsToTop();
457  //returns true if successful
458  bool moveItemToTop( QgsComposerItem* item );
459  void moveSelectedItemsToBottom();
460  //returns true if successful
461  bool moveItemToBottom( QgsComposerItem* item );
462 
463  //functions to find items by their position in the z list
464  void selectNextByZOrder( const ZValueDirection direction );
465  QgsComposerItem* getComposerItemBelow( QgsComposerItem* item ) const;
466  QgsComposerItem* getComposerItemAbove( QgsComposerItem* item ) const;
467 
468  //functions to align selected items
469  void alignSelectedItemsLeft();
470  void alignSelectedItemsHCenter();
471  void alignSelectedItemsRight();
472  void alignSelectedItemsTop();
473  void alignSelectedItemsVCenter();
474  void alignSelectedItemsBottom();
475 
476  //functions to lock and unlock items
478  void lockSelectedItems();
480  void unlockAllItems();
481 
487  QgsComposerItemGroup* groupItems( QList<QgsComposerItem*> items );
488 
496  QList<QgsComposerItem*> ungroupItems( QgsComposerItemGroup* group );
497 
502  Q_DECL_DEPRECATED void sortZList() {};
503 
507  void refreshZList();
508 
510  QPointF snapPointToGrid( const QPointF& scenePoint ) const;
511 
513  QList< QGraphicsLineItem* >* snapLines() {return &mSnapLines;}
514 
518  QgsComposerMouseHandles* selectionHandles() {return mSelectionHandles;}
519 
521  QGraphicsLineItem* addSnapLine();
523  void removeSnapLine( QGraphicsLineItem* line );
527  QGraphicsLineItem* nearestSnapLine( const bool horizontal, const double x, const double y, const double tolerance, QList< QPair< QgsComposerItem*, QgsComposerItem::ItemPositionMode > >& snappedItems ) const;
528 
533  void beginCommand( QgsComposerItem* item, const QString& commandText, const QgsComposerMergeCommand::Context c = QgsComposerMergeCommand::Unknown );
534 
536  void endCommand();
538  void cancelCommand();
539 
540  void beginMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, const QgsComposerMultiFrameMergeCommand::Context c = QgsComposerMultiFrameMergeCommand::Unknown );
541  void endMultiFrameCommand();
543  void cancelMultiFrameCommand();
544 
546  void addMultiFrame( QgsComposerMultiFrame* multiFrame );
548  void removeMultiFrame( QgsComposerMultiFrame* multiFrame );
551  void addComposerArrow( QgsComposerArrow* arrow );
553  void addComposerLabel( QgsComposerLabel* label );
555  void addComposerMap( QgsComposerMap* map, const bool setDefaultPreviewStyle = true );
557  void addComposerScaleBar( QgsComposerScaleBar* scaleBar );
559  void addComposerLegend( QgsComposerLegend* legend );
561  void addComposerPicture( QgsComposerPicture* picture );
563  void addComposerShape( QgsComposerShape* shape );
565  void addComposerTable( QgsComposerAttributeTable* table );
567  void addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame );
569  void addComposerTableFrame( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
570 
572  void removeComposerItem( QgsComposerItem* item, const bool createCommand = true, const bool removeGroupItems = true );
573 
575  void pushAddRemoveCommand( QgsComposerItem* item, const QString& text, const QgsAddRemoveItemCommand::State state = QgsAddRemoveItemCommand::Added );
576 
579  void setPreventCursorChange( const bool preventChange ) { mPreventCursorChange = preventChange; }
580  bool preventCursorChange() const { return mPreventCursorChange; }
581 
582  //printing
583 
585  void beginPrint( QPrinter& printer, const bool evaluateDDPageSize = false );
587  void beginPrintAsPDF( QPrinter& printer, const QString& file );
588 
594  void doPrint( QPrinter& printer, QPainter& painter, bool startNewPage = false );
595 
599  bool print( QPrinter &printer, const bool evaluateDDPageSize = false );
600 
604  bool exportAsPDF( const QString& file );
605 
608  QImage printPageAsRaster( int page );
609 
613  void renderPage( QPainter* p, int page );
614 
616  void computeWorldFileParameters( double& a, double& b, double& c, double& d, double& e, double& f ) const;
617 
618  QgsAtlasComposition& atlasComposition() { return mAtlasComposition; }
619 
623  Q_DECL_DEPRECATED static void relativeResizeRect( QRectF& rectToResize, const QRectF& boundsBefore, const QRectF& boundsAfter );
624 
628  Q_DECL_DEPRECATED static double relativePosition( double position, double beforeMin, double beforeMax, double afterMin, double afterMax );
629 
634  QgsComposition::AtlasMode atlasMode() const { return mAtlasMode; }
635 
641  bool setAtlasMode( const QgsComposition::AtlasMode mode );
642 
646  QList< QgsPaperItem* > pages() { return mPages; }
647 
652  QgsDataDefined* dataDefinedProperty( const QgsComposerObject::DataDefinedProperty property );
653 
662  void setDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property, bool active, bool useExpression, const QString &expression, const QString &field );
663 
668  QgsComposerModel * itemsModel() { return mItemsModel; }
669 
678  void setCustomProperty( const QString &key, const QVariant &value );
679 
689  QVariant customProperty( const QString &key, const QVariant &defaultValue = QVariant() ) const;
690 
698  void removeCustomProperty( const QString &key );
699 
706  QStringList customProperties() const;
707 
708  public slots:
710  void sendItemAddedSignal( QgsComposerItem* item );
711 
714  void updateBounds();
715 
721  void refreshItems();
722 
726  void setSelectedItem( QgsComposerItem* item );
727 
732  void setAllUnselected();
733 
742  void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext* context = 0 );
743 
748  QgsExpressionContext* createExpressionContext() const;
749 
750  protected:
751  void init();
752 
753 
754  private:
756  QgsMapRenderer* mMapRenderer;
757  const QgsMapSettings& mMapSettings;
758 
759  QgsComposition::PlotStyle mPlotStyle;
760  double mPageWidth;
761  double mPageHeight;
762  QList< QgsPaperItem* > mPages;
763  double mSpaceBetweenPages; //space in preview between pages
764 
766  QgsFillSymbolV2* mPageStyleSymbol;
767  void createDefaultPageStyleSymbol();
768 
770  QSet<QgsComposerMultiFrame*> mMultiFrames;
771 
773  int mPrintResolution;
774 
776  bool mPrintAsRaster;
777 
779  bool mGenerateWorldFile;
781  QgsComposerMap* mWorldFileMap;
782 
784  bool mUseAdvancedEffects;
785 
787  bool mSnapToGrid;
788  bool mGridVisible;
789  double mSnapGridResolution;
790  double mSnapGridOffsetX;
791  double mSnapGridOffsetY;
792  QPen mGridPen;
793  GridStyle mGridStyle;
794 
796  bool mAlignmentSnap;
797  bool mGuidesVisible;
798  bool mSmartGuides;
799  int mSnapTolerance;
800 
802  QList< QGraphicsLineItem* > mSnapLines;
803 
804  bool mBoundingBoxesVisible;
805  QgsComposerMouseHandles* mSelectionHandles;
806 
807  QUndoStack* mUndoStack;
808 
809  QgsComposerItemCommand* mActiveItemCommand;
810  QgsComposerMultiFrameCommand* mActiveMultiFrameCommand;
811 
813  QgsAtlasComposition mAtlasComposition;
814 
815  QgsComposition::AtlasMode mAtlasMode;
816 
817  bool mPreventCursorChange;
818 
819  QgsComposerModel * mItemsModel;
820 
825 
826  QgsObjectCustomProperties mCustomProperties;
827 
828  QgsComposition(); //default constructor is forbidden
829 
831  QRectF compositionBounds() const;
832 
834  void updateZValues( const bool addUndoCommands = true );
835 
838  int boundingRectOfSelectedItems( QRectF& bRect );
839 
841  void loadDefaults();
842 
844  void loadSettings();
845 
847  QPointF minPointFromXml( const QDomElement& elem ) const;
848 
849  void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c );
850 
851  void updatePaperItems();
852  void addPaperItem();
853  void removePaperItems();
854  void deleteAndRemoveMultiFrames();
855 
856  static QString encodeStringForXML( const QString& str );
857 
858  //tries to return the current QGraphicsView attached to the composition
859  QGraphicsView* graphicsView() const;
860 
864  void refreshPageSize( const QgsExpressionContext* context = 0 );
865 
875  bool dataDefinedEvaluate( QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue,
876  const QgsExpressionContext& context,
878 
884  bool dataDefinedActive( const QgsComposerObject::DataDefinedProperty property,
885  const QMap<QgsComposerObject::DataDefinedProperty, QgsDataDefined *> *dataDefinedProperties ) const;
886 
895  QVariant dataDefinedValue( QgsComposerObject::DataDefinedProperty property, const QgsFeature *feature, const QgsFields& fields,
896  const QgsExpressionContext& context,
898 
899 
907  void prepareDataDefinedExpression( QgsDataDefined *dd, QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* >* dataDefinedProperties, const QgsExpressionContext& context ) const;
908 
913  bool ddPageSizeActive() const;
914 
915  private slots:
916  /*Prepares all data defined expressions*/
917  void prepareAllDataDefinedExpressions();
918 
919  signals:
920  void paperSizeChanged();
921  void nPagesChanged();
922 
924  void printResolutionChanged();
925 
927  void selectedItemChanged( QgsComposerItem* selected );
929  void composerArrowAdded( QgsComposerArrow* arrow );
931  void composerHtmlFrameAdded( QgsComposerHtml* html, QgsComposerFrame* frame );
933  void composerLabelAdded( QgsComposerLabel* label );
935  void composerMapAdded( QgsComposerMap* map );
937  void composerScaleBarAdded( QgsComposerScaleBar* scalebar );
939  void composerLegendAdded( QgsComposerLegend* legend );
941  void composerPictureAdded( QgsComposerPicture* picture );
943  void composerShapeAdded( QgsComposerShape* shape );
945  void composerTableAdded( QgsComposerAttributeTable* table );
947  void composerTableFrameAdded( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
949  void itemRemoved( QgsComposerItem* );
950 
952  void refreshItemsTriggered();
953 
955  void statusMsgChanged( QString message );
956 
957  friend class QgsComposerObject; //for accessing dataDefinedEvaluate, readDataDefinedPropertyMap and writeDataDefinedPropertyMap
958  friend class QgsComposerModel; //for accessing updateZValues (should not be public)
959 };
960 
961 template<class T> void QgsComposition::composerItems( QList<T*>& itemList )
962 {
963  itemList.clear();
964  QList<QGraphicsItem *> graphicsItemList = items();
965  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
966  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
967  {
968  T* item = dynamic_cast<T*>( *itemIt );
969  if ( item )
970  {
971  itemList.push_back( item );
972  }
973  }
974 }
975 
976 template<class T> void QgsComposition::composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const
977 {
978  itemList.clear();
979  QList<QGraphicsItem *> graphicsItemList = items();
980  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
981  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
982  {
983  T* item = dynamic_cast<T*>( *itemIt );
984  if ( item && itemPageNumber( item ) == pageNumber )
985  {
986  itemList.push_back( item );
987  }
988  }
989 }
990 
991 
992 #endif
993 
994 
995 
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:177
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:162
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
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.