QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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"
38 
39 class QgisApp;
40 class QgsComposerFrame;
41 class QgsComposerMap;
42 class QGraphicsRectItem;
43 class QgsMapRenderer;
44 class QDomElement;
45 class QgsComposerArrow;
47 class QgsComposerHtml;
48 class QgsComposerTableV2;
49 class QgsComposerItem;
51 class QgsComposerLabel;
52 class QgsComposerLegend;
53 class QgsComposerMap;
54 class QgsComposerPicture;
56 class QgsComposerShape;
61 class QgsVectorLayer;
62 class QgsComposer;
63 class QgsFillSymbolV2;
64 class QgsDataDefined;
65 class QgsComposerModel;
66 
73 class CORE_EXPORT QgsComposition : public QGraphicsScene
74 {
75  Q_OBJECT
76  public:
77 
79  enum PlotStyle
80  {
81  Preview = 0, // Use cache etc
82  Print, // Render well
83  Postscript // Fonts need different scaling!
84  };
85 
87  enum GridStyle
88  {
91  Crosses
92  };
93 
95  {
97  ZValueAbove
98  };
99 
101  {
103  Landscape
104  };
105 
107  Q_DECL_DEPRECATED QgsComposition( QgsMapRenderer* mapRenderer );
108  explicit QgsComposition( const QgsMapSettings& mapSettings );
109 
112  {
113  AtlasOff, // Composition is not being controlled by an atlas
114  PreviewAtlas, // An atlas composition is being previewed in the app
115  ExportAtlas // The composition is being exported as an atlas
116  };
117 
118  ~QgsComposition();
119 
127  void setPaperSize( const double width, const double height );
128 
134  double paperHeight() const;
135 
141  double paperWidth() const;
142 
146  double spaceBetweenPages() const { return mSpaceBetweenPages; }
147 
152  void setNumPages( const int pages );
153 
158  int numPages() const;
159 
169  bool pageIsEmpty( const int page ) const;
170 
178  bool shouldExportPage( const int page ) const;
179 
181  void setPageStyleSymbol( QgsFillSymbolV2* symbol );
183  QgsFillSymbolV2* pageStyleSymbol() { return mPageStyleSymbol; }
184 
188  QPointF positionOnPage( const QPointF & position ) const;
189 
193  int pageNumberForPoint( const QPointF & position ) const;
194 
198  void setStatusMessage( const QString & message );
199 
203  void updateSettings();
204 
205  void setSnapToGridEnabled( const bool b );
206  bool snapToGridEnabled() const {return mSnapToGrid;}
207 
208  void setGridVisible( const bool b );
209  bool gridVisible() const {return mGridVisible;}
210 
212  void setSnapLinesVisible( const bool visible );
213  bool snapLinesVisible() const {return mGuidesVisible;}
214 
215  void setAlignmentSnap( const bool s ) { mAlignmentSnap = s; }
216  bool alignmentSnap() const { return mAlignmentSnap; }
217 
218  void setSmartGuidesEnabled( const bool b ) { mSmartGuides = b; }
219  bool smartGuidesEnabled() const {return mSmartGuides;}
220 
222  void clearSnapLines();
223 
224  void setSnapGridResolution( const double r );
225  double snapGridResolution() const {return mSnapGridResolution;}
226 
227  void setSnapGridOffsetX( const double offset );
228  double snapGridOffsetX() const {return mSnapGridOffsetX;}
229 
230  void setSnapGridOffsetY( const double offset );
231  double snapGridOffsetY() const {return mSnapGridOffsetY;}
232 
233  void setGridPen( const QPen& p );
234  const QPen& gridPen() const {return mGridPen;}
235 
236  void setGridStyle( const GridStyle s );
237  GridStyle gridStyle() const {return mGridStyle;}
238 
245  Q_DECL_DEPRECATED void setSnapGridTolerance( double tolerance ) { mSnapTolerance = tolerance; }
246 
253  Q_DECL_DEPRECATED double snapGridTolerance() const {return mSnapTolerance;}
254 
261  Q_DECL_DEPRECATED void setAlignmentSnapTolerance( double t ) { mSnapTolerance = t; }
262 
269  Q_DECL_DEPRECATED double alignmentSnapTolerance() const { return mSnapTolerance; }
270 
277  void setSnapTolerance( const int snapTolerance ) { mSnapTolerance = snapTolerance; }
278 
285  int snapTolerance() const { return mSnapTolerance; }
286 
292  void setBoundingBoxesVisible( const bool boundsVisible );
293 
299  bool boundingBoxesVisible() const { return mBoundingBoxesVisible; }
300 
302  QUndoStack* undoStack() { return mUndoStack; }
303 
309  QgsComposerItem* composerItemAt( const QPointF & position, const bool ignoreLocked = false ) const;
310 
317  QgsComposerItem* composerItemAt( const QPointF & position, const QgsComposerItem* belowItem, const bool ignoreLocked = false ) const;
318 
320  int pageNumberAt( const QPointF& position ) const;
321 
323  int itemPageNumber( const QgsComposerItem* ) const;
324 
329  QList<QgsComposerItem*> selectedComposerItems( const bool includeLockedItems = true );
330 
334  QList<const QgsComposerMap*> composerMapItems() const;
335 
340  template<class T> void composerItems( QList<T*>& itemList );
341 
348  template<class T> void composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const;
349 
352  const QgsComposerMap* getComposerMapById( const int id ) const;
353 
359  Q_DECL_DEPRECATED const QgsComposerHtml* getComposerHtmlByItem( QgsComposerItem *item ) const;
360 
367  const QgsComposerItem* getComposerItemById( const QString theId ) const;
368 
372  const QgsComposerItem* getComposerItemByUuid( const QString theUuid ) const;
373 
374  int printResolution() const {return mPrintResolution;}
375  void setPrintResolution( const int dpi );
376 
377  bool printAsRaster() const {return mPrintAsRaster;}
378  void setPrintAsRaster( const bool enabled ) { mPrintAsRaster = enabled; }
379 
380  bool generateWorldFile() const { return mGenerateWorldFile; }
381  void setGenerateWorldFile( const bool enabled ) { mGenerateWorldFile = enabled; }
382 
383  QgsComposerMap* worldFileMap() const { return mWorldFileMap; }
384  void setWorldFileMap( QgsComposerMap* map ) { mWorldFileMap = map; }
385 
387  bool useAdvancedEffects() const {return mUseAdvancedEffects;}
389  void setUseAdvancedEffects( const bool effectsEnabled );
390 
392  Q_DECL_DEPRECATED QgsMapRenderer* mapRenderer() {return mMapRenderer;}
394 
397  const QgsMapSettings& mapSettings() const { return mMapSettings; }
398 
399  QgsComposition::PlotStyle plotStyle() const {return mPlotStyle;}
400  void setPlotStyle( const QgsComposition::PlotStyle style ) {mPlotStyle = style;}
401 
406  Q_DECL_DEPRECATED int pixelFontSize( double pointSize ) const;
407 
411  Q_DECL_DEPRECATED double pointFontSize( int pixelSize ) const;
412 
414  bool writeXML( QDomElement& composerElem, QDomDocument& doc );
415 
417  bool readXML( const QDomElement& compositionElem, const QDomDocument& doc );
418 
427  bool loadFromTemplate( const QDomDocument& doc, QMap<QString, QString>* substitutionMap = 0,
428  bool addUndoCommands = false, const bool clearComposition = true );
429 
439  void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore = 0,
440  bool addUndoCommands = false, QPointF* pos = 0, bool pasteInPlace = false );
441 
443  void addItemToZList( QgsComposerItem* item );
445  void removeItemFromZList( QgsComposerItem* item );
446 
447  //functions to move selected items in hierarchy
448  void raiseSelectedItems();
449 
450  //returns true if successful
451  bool raiseItem( QgsComposerItem* item );
452  void lowerSelectedItems();
453  //returns true if successful
454  bool lowerItem( QgsComposerItem* item );
455  void moveSelectedItemsToTop();
456  //returns true if successful
457  bool moveItemToTop( QgsComposerItem* item );
458  void moveSelectedItemsToBottom();
459  //returns true if successful
460  bool moveItemToBottom( QgsComposerItem* item );
461 
462  //functions to find items by their position in the z list
463  void selectNextByZOrder( const ZValueDirection direction );
464  QgsComposerItem* getComposerItemBelow( QgsComposerItem* item ) const;
465  QgsComposerItem* getComposerItemAbove( QgsComposerItem* item ) const;
466 
467  //functions to align selected items
468  void alignSelectedItemsLeft();
469  void alignSelectedItemsHCenter();
470  void alignSelectedItemsRight();
471  void alignSelectedItemsTop();
472  void alignSelectedItemsVCenter();
473  void alignSelectedItemsBottom();
474 
475  //functions to lock and unlock items
477  void lockSelectedItems();
479  void unlockAllItems();
480 
486  QgsComposerItemGroup* groupItems( QList<QgsComposerItem*> items );
487 
495  QList<QgsComposerItem*> ungroupItems( QgsComposerItemGroup* group );
496 
501  Q_DECL_DEPRECATED void sortZList() {};
502 
506  void refreshZList();
507 
509  QPointF snapPointToGrid( const QPointF& scenePoint ) const;
510 
512  QList< QGraphicsLineItem* >* snapLines() {return &mSnapLines;}
513 
517  QgsComposerMouseHandles* selectionHandles() {return mSelectionHandles;}
518 
520  QGraphicsLineItem* addSnapLine();
522  void removeSnapLine( QGraphicsLineItem* line );
526  QGraphicsLineItem* nearestSnapLine( const bool horizontal, const double x, const double y, const double tolerance, QList< QPair< QgsComposerItem*, QgsComposerItem::ItemPositionMode > >& snappedItems ) const;
527 
532  void beginCommand( QgsComposerItem* item, const QString& commandText, const QgsComposerMergeCommand::Context c = QgsComposerMergeCommand::Unknown );
533 
535  void endCommand();
537  void cancelCommand();
538 
539  void beginMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, const QgsComposerMultiFrameMergeCommand::Context c = QgsComposerMultiFrameMergeCommand::Unknown );
540  void endMultiFrameCommand();
542  void cancelMultiFrameCommand();
543 
545  void addMultiFrame( QgsComposerMultiFrame* multiFrame );
547  void removeMultiFrame( QgsComposerMultiFrame* multiFrame );
550  void addComposerArrow( QgsComposerArrow* arrow );
552  void addComposerLabel( QgsComposerLabel* label );
554  void addComposerMap( QgsComposerMap* map, const bool setDefaultPreviewStyle = true );
556  void addComposerScaleBar( QgsComposerScaleBar* scaleBar );
558  void addComposerLegend( QgsComposerLegend* legend );
560  void addComposerPicture( QgsComposerPicture* picture );
562  void addComposerShape( QgsComposerShape* shape );
564  void addComposerTable( QgsComposerAttributeTable* table );
566  void addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame );
568  void addComposerTableFrame( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
569 
571  void removeComposerItem( QgsComposerItem* item, const bool createCommand = true, const bool removeGroupItems = true );
572 
574  void pushAddRemoveCommand( QgsComposerItem* item, const QString& text, const QgsAddRemoveItemCommand::State state = QgsAddRemoveItemCommand::Added );
575 
578  void setPreventCursorChange( const bool preventChange ) { mPreventCursorChange = preventChange; }
579  bool preventCursorChange() const { return mPreventCursorChange; }
580 
581  //printing
582 
584  void beginPrint( QPrinter& printer, const bool evaluateDDPageSize = false );
586  void beginPrintAsPDF( QPrinter& printer, const QString& file );
587 
593  void doPrint( QPrinter& printer, QPainter& painter, bool startNewPage = false );
594 
598  bool print( QPrinter &printer, const bool evaluateDDPageSize = false );
599 
603  bool exportAsPDF( const QString& file );
604 
607  QImage printPageAsRaster( int page );
608 
612  void renderPage( QPainter* p, int page );
613 
615  void computeWorldFileParameters( double& a, double& b, double& c, double& d, double& e, double& f ) const;
616 
617  QgsAtlasComposition& atlasComposition() { return mAtlasComposition; }
618 
622  Q_DECL_DEPRECATED static void relativeResizeRect( QRectF& rectToResize, const QRectF& boundsBefore, const QRectF& boundsAfter );
623 
627  Q_DECL_DEPRECATED static double relativePosition( double position, double beforeMin, double beforeMax, double afterMin, double afterMax );
628 
633  QgsComposition::AtlasMode atlasMode() const { return mAtlasMode; }
634 
640  bool setAtlasMode( const QgsComposition::AtlasMode mode );
641 
645  QList< QgsPaperItem* > pages() { return mPages; }
646 
651  QgsDataDefined* dataDefinedProperty( const QgsComposerObject::DataDefinedProperty property );
652 
661  void setDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property, bool active, bool useExpression, const QString &expression, const QString &field );
662 
667  QgsComposerModel * itemsModel() { return mItemsModel; }
668 
669  public slots:
671  void sendItemAddedSignal( QgsComposerItem* item );
672 
675  void updateBounds();
676 
682  void refreshItems();
683 
687  void setSelectedItem( QgsComposerItem* item );
688 
693  void setAllUnselected();
694 
702  void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties );
703 
704  protected:
705  void init();
706 
707 
708  private:
710  QgsMapRenderer* mMapRenderer;
711  const QgsMapSettings& mMapSettings;
712 
713  QgsComposition::PlotStyle mPlotStyle;
714  double mPageWidth;
715  double mPageHeight;
716  QList< QgsPaperItem* > mPages;
717  double mSpaceBetweenPages; //space in preview between pages
718 
720  QgsFillSymbolV2* mPageStyleSymbol;
721  void createDefaultPageStyleSymbol();
722 
724  QSet<QgsComposerMultiFrame*> mMultiFrames;
725 
727  int mPrintResolution;
728 
730  bool mPrintAsRaster;
731 
733  bool mGenerateWorldFile;
735  QgsComposerMap* mWorldFileMap;
736 
738  bool mUseAdvancedEffects;
739 
741  bool mSnapToGrid;
742  bool mGridVisible;
743  double mSnapGridResolution;
744  double mSnapGridOffsetX;
745  double mSnapGridOffsetY;
746  QPen mGridPen;
747  GridStyle mGridStyle;
748 
750  bool mAlignmentSnap;
751  bool mGuidesVisible;
752  bool mSmartGuides;
753  int mSnapTolerance;
754 
756  QList< QGraphicsLineItem* > mSnapLines;
757 
758  bool mBoundingBoxesVisible;
759  QgsComposerMouseHandles* mSelectionHandles;
760 
761  QUndoStack* mUndoStack;
762 
763  QgsComposerItemCommand* mActiveItemCommand;
764  QgsComposerMultiFrameCommand* mActiveMultiFrameCommand;
765 
767  QgsAtlasComposition mAtlasComposition;
768 
769  QgsComposition::AtlasMode mAtlasMode;
770 
771  bool mPreventCursorChange;
772 
773  QgsComposerModel * mItemsModel;
774 
776  QMap< QgsComposerObject::DataDefinedProperty, QString > mDataDefinedNames;
778  QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* > mDataDefinedProperties;
779 
780  QgsComposition(); //default constructor is forbidden
781 
783  QRectF compositionBounds() const;
784 
786  void updateZValues( const bool addUndoCommands = true );
787 
790  int boundingRectOfSelectedItems( QRectF& bRect );
791 
793  void loadDefaults();
794 
796  void loadSettings();
797 
799  QPointF minPointFromXml( const QDomElement& elem ) const;
800 
801  void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c );
802 
803  void updatePaperItems();
804  void addPaperItem();
805  void removePaperItems();
806  void deleteAndRemoveMultiFrames();
807 
808  static QString encodeStringForXML( const QString& str );
809 
810  //tries to return the current QGraphicsView attached to the composition
811  QGraphicsView* graphicsView() const;
812 
813  /*Recalculates the page size using data defined page settings*/
814  void refreshPageSize();
815 
823  bool dataDefinedEvaluate( QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue,
824  QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* >* dataDefinedProperties );
825 
831  bool dataDefinedActive( const QgsComposerObject::DataDefinedProperty property,
832  const QMap<QgsComposerObject::DataDefinedProperty, QgsDataDefined *> *dataDefinedProperties ) const;
833 
841  QVariant dataDefinedValue( QgsComposerObject::DataDefinedProperty property, const QgsFeature *feature, const QgsFields *fields,
842  QMap<QgsComposerObject::DataDefinedProperty, QgsDataDefined *> *dataDefinedProperties ) const;
843 
844 
850  void prepareDataDefinedExpression( QgsDataDefined *dd, QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* >* dataDefinedProperties ) const;
851 
856  bool ddPageSizeActive() const;
857 
858  private slots:
859  /*Prepares all data defined expressions*/
860  void prepareAllDataDefinedExpressions();
861 
862  signals:
863  void paperSizeChanged();
864  void nPagesChanged();
865 
867  void printResolutionChanged();
868 
870  void selectedItemChanged( QgsComposerItem* selected );
872  void composerArrowAdded( QgsComposerArrow* arrow );
874  void composerHtmlFrameAdded( QgsComposerHtml* html, QgsComposerFrame* frame );
876  void composerLabelAdded( QgsComposerLabel* label );
878  void composerMapAdded( QgsComposerMap* map );
880  void composerScaleBarAdded( QgsComposerScaleBar* scalebar );
882  void composerLegendAdded( QgsComposerLegend* legend );
884  void composerPictureAdded( QgsComposerPicture* picture );
886  void composerShapeAdded( QgsComposerShape* shape );
888  void composerTableAdded( QgsComposerAttributeTable* table );
890  void composerTableFrameAdded( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
892  void itemRemoved( QgsComposerItem* );
893 
895  void refreshItemsTriggered();
896 
898  void statusMsgChanged( QString message );
899 
900  friend class QgsComposerObject; //for accessing dataDefinedEvaluate, readDataDefinedPropertyMap and writeDataDefinedPropertyMap
901  friend class QgsComposerModel; //for accessing updateZValues (should not be public)
902 };
903 
904 template<class T> void QgsComposition::composerItems( QList<T*>& itemList )
905 {
906  itemList.clear();
907  QList<QGraphicsItem *> graphicsItemList = items();
908  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
909  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
910  {
911  T* item = dynamic_cast<T*>( *itemIt );
912  if ( item )
913  {
914  itemList.push_back( item );
915  }
916  }
917 }
918 
919 template<class T> void QgsComposition::composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const
920 {
921  itemList.clear();
922  QList<QGraphicsItem *> graphicsItemList = items();
923  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
924  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
925  {
926  T* item = dynamic_cast<T*>( *itemIt );
927  if ( item && itemPageNumber( item ) == pageNumber )
928  {
929  itemList.push_back( item );
930  }
931  }
932 }
933 
934 
935 #endif
936 
937 
938 
void setSnapTolerance(const int snapTolerance)
Sets the snap tolerance to use when automatically snapping items during movement and resizing to guid...
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.
QgsComposerModel * itemsModel()
Returns the items model attached to the composition.
void setPlotStyle(const QgsComposition::PlotStyle style)
const QgsMapSettings & mapSettings() const
Return setting of QGIS map canvas.
const QPen & gridPen() 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:172
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:113
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.
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.
void setGenerateWorldFile(const bool enabled)
GridStyle gridStyle() const
A model for items attached to a composition.
AtlasMode
Composition atlas modes.
QString file
Definition: qgssvgcache.cpp:76
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...
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...
QList< QGraphicsLineItem * > * snapLines()
Returns pointer to snap lines collection.