QGIS API Documentation  2.5.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 
153  void setNumPages( const int pages );
154 
160  int numPages() const;
161 
171  bool pageIsEmpty( const int page ) const;
172 
180  bool shouldExportPage( const int page ) const;
181 
183  void setPageStyleSymbol( QgsFillSymbolV2* symbol );
185  QgsFillSymbolV2* pageStyleSymbol() { return mPageStyleSymbol; }
186 
190  QPointF positionOnPage( const QPointF & position ) const;
191 
195  int pageNumberForPoint( const QPointF & position ) const;
196 
200  void setStatusMessage( const QString & message );
201 
205  void updateSettings();
206 
207  void setSnapToGridEnabled( const bool b );
208  bool snapToGridEnabled() const {return mSnapToGrid;}
209 
210  void setGridVisible( const bool b );
211  bool gridVisible() const {return mGridVisible;}
212 
214  void setSnapLinesVisible( const bool visible );
215  bool snapLinesVisible() const {return mGuidesVisible;}
216 
217  void setAlignmentSnap( const bool s ) { mAlignmentSnap = s; }
218  bool alignmentSnap() const { return mAlignmentSnap; }
219 
220  void setSmartGuidesEnabled( const bool b ) { mSmartGuides = b; }
221  bool smartGuidesEnabled() const {return mSmartGuides;}
222 
224  void clearSnapLines();
225 
226  void setSnapGridResolution( const double r );
227  double snapGridResolution() const {return mSnapGridResolution;}
228 
229  void setSnapGridOffsetX( const double offset );
230  double snapGridOffsetX() const {return mSnapGridOffsetX;}
231 
232  void setSnapGridOffsetY( const double offset );
233  double snapGridOffsetY() const {return mSnapGridOffsetY;}
234 
235  void setGridPen( const QPen& p );
236  const QPen& gridPen() const {return mGridPen;}
237 
238  void setGridStyle( const GridStyle s );
239  GridStyle gridStyle() const {return mGridStyle;}
240 
247  Q_DECL_DEPRECATED void setSnapGridTolerance( double tolerance ) { mSnapTolerance = tolerance; }
248 
255  Q_DECL_DEPRECATED double snapGridTolerance() const {return mSnapTolerance;}
256 
263  Q_DECL_DEPRECATED void setAlignmentSnapTolerance( double t ) { mSnapTolerance = t; }
264 
271  Q_DECL_DEPRECATED double alignmentSnapTolerance() const { return mSnapTolerance; }
272 
279  void setSnapTolerance( const int snapTolerance ) { mSnapTolerance = snapTolerance; }
280 
287  int snapTolerance() const { return mSnapTolerance; }
288 
290  QUndoStack* undoStack() { return mUndoStack; }
291 
297  QgsComposerItem* composerItemAt( const QPointF & position, const bool ignoreLocked = false ) const;
298 
305  QgsComposerItem* composerItemAt( const QPointF & position, const QgsComposerItem* belowItem, const bool ignoreLocked = false ) const;
306 
308  int pageNumberAt( const QPointF& position ) const;
309 
311  int itemPageNumber( const QgsComposerItem* ) const;
312 
317  QList<QgsComposerItem*> selectedComposerItems( const bool includeLockedItems = true );
318 
322  QList<const QgsComposerMap*> composerMapItems() const;
323 
328  template<class T> void composerItems( QList<T*>& itemList );
329 
336  template<class T> void composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const;
337 
340  const QgsComposerMap* getComposerMapById( const int id ) const;
341 
348  Q_DECL_DEPRECATED const QgsComposerHtml* getComposerHtmlByItem( QgsComposerItem *item ) const;
349 
357  const QgsComposerItem* getComposerItemById( const QString theId ) const;
358 
363  const QgsComposerItem* getComposerItemByUuid( const QString theUuid ) const;
364 
365  int printResolution() const {return mPrintResolution;}
366  void setPrintResolution( const int dpi );
367 
368  bool printAsRaster() const {return mPrintAsRaster;}
369  void setPrintAsRaster( const bool enabled ) { mPrintAsRaster = enabled; }
370 
371  bool generateWorldFile() const { return mGenerateWorldFile; }
372  void setGenerateWorldFile( const bool enabled ) { mGenerateWorldFile = enabled; }
373 
374  QgsComposerMap* worldFileMap() const { return mWorldFileMap; }
375  void setWorldFileMap( QgsComposerMap* map ) { mWorldFileMap = map; }
376 
379  bool useAdvancedEffects() const {return mUseAdvancedEffects;}
382  void setUseAdvancedEffects( const bool effectsEnabled );
383 
385  Q_DECL_DEPRECATED QgsMapRenderer* mapRenderer() {return mMapRenderer;}
387 
390  const QgsMapSettings& mapSettings() const { return mMapSettings; }
391 
392  QgsComposition::PlotStyle plotStyle() const {return mPlotStyle;}
393  void setPlotStyle( const QgsComposition::PlotStyle style ) {mPlotStyle = style;}
394 
399  Q_DECL_DEPRECATED int pixelFontSize( double pointSize ) const;
400 
404  Q_DECL_DEPRECATED double pointFontSize( int pixelSize ) const;
405 
407  bool writeXML( QDomElement& composerElem, QDomDocument& doc );
408 
410  bool readXML( const QDomElement& compositionElem, const QDomDocument& doc );
411 
420  bool loadFromTemplate( const QDomDocument& doc, QMap<QString, QString>* substitutionMap = 0,
421  bool addUndoCommands = false, const bool clearComposition = true );
422 
432  void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore = 0,
433  bool addUndoCommands = false, QPointF* pos = 0, bool pasteInPlace = false );
434 
436  void addItemToZList( QgsComposerItem* item );
438  void removeItemFromZList( QgsComposerItem* item );
439 
440  //functions to move selected items in hierarchy
441  void raiseSelectedItems();
442 
443  //returns true if successful
444  bool raiseItem( QgsComposerItem* item );
445  void lowerSelectedItems();
446  //returns true if successful
447  bool lowerItem( QgsComposerItem* item );
448  void moveSelectedItemsToTop();
449  //returns true if successful
450  bool moveItemToTop( QgsComposerItem* item );
451  void moveSelectedItemsToBottom();
452  //returns true if successful
453  bool moveItemToBottom( QgsComposerItem* item );
454 
455  //functions to find items by their position in the z list
456  void selectNextByZOrder( const ZValueDirection direction );
457  QgsComposerItem* getComposerItemBelow( QgsComposerItem* item ) const;
458  QgsComposerItem* getComposerItemAbove( QgsComposerItem* item ) const;
459 
460  //functions to align selected items
461  void alignSelectedItemsLeft();
462  void alignSelectedItemsHCenter();
463  void alignSelectedItemsRight();
464  void alignSelectedItemsTop();
465  void alignSelectedItemsVCenter();
466  void alignSelectedItemsBottom();
467 
468  //functions to lock and unlock items
470  void lockSelectedItems();
472  void unlockAllItems();
473 
479  QgsComposerItemGroup* groupItems( QList<QgsComposerItem*> items );
480 
488  QList<QgsComposerItem*> ungroupItems( QgsComposerItemGroup* group );
489 
494  Q_DECL_DEPRECATED void sortZList() {};
495 
499  void refreshZList();
500 
502  QPointF snapPointToGrid( const QPointF& scenePoint ) const;
503 
505  QList< QGraphicsLineItem* >* snapLines() {return &mSnapLines;}
506 
510  QgsComposerMouseHandles* selectionHandles() {return mSelectionHandles;}
511 
513  QGraphicsLineItem* addSnapLine();
515  void removeSnapLine( QGraphicsLineItem* line );
519  QGraphicsLineItem* nearestSnapLine( const bool horizontal, const double x, const double y, const double tolerance, QList< QPair< QgsComposerItem*, QgsComposerItem::ItemPositionMode > >& snappedItems ) const;
520 
525  void beginCommand( QgsComposerItem* item, const QString& commandText, const QgsComposerMergeCommand::Context c = QgsComposerMergeCommand::Unknown );
526 
528  void endCommand();
530  void cancelCommand();
531 
532  void beginMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, const QgsComposerMultiFrameMergeCommand::Context c = QgsComposerMultiFrameMergeCommand::Unknown );
533  void endMultiFrameCommand();
535  void cancelMultiFrameCommand();
536 
538  void addMultiFrame( QgsComposerMultiFrame* multiFrame );
540  void removeMultiFrame( QgsComposerMultiFrame* multiFrame );
543  void addComposerArrow( QgsComposerArrow* arrow );
545  void addComposerLabel( QgsComposerLabel* label );
547  void addComposerMap( QgsComposerMap* map, const bool setDefaultPreviewStyle = true );
549  void addComposerScaleBar( QgsComposerScaleBar* scaleBar );
551  void addComposerLegend( QgsComposerLegend* legend );
553  void addComposerPicture( QgsComposerPicture* picture );
555  void addComposerShape( QgsComposerShape* shape );
557  void addComposerTable( QgsComposerAttributeTable* table );
559  void addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame );
561  void addComposerTableFrame( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
562 
564  void removeComposerItem( QgsComposerItem* item, const bool createCommand = true, const bool removeGroupItems = true );
565 
567  void pushAddRemoveCommand( QgsComposerItem* item, const QString& text, const QgsAddRemoveItemCommand::State state = QgsAddRemoveItemCommand::Added );
568 
571  void setPreventCursorChange( const bool preventChange ) { mPreventCursorChange = preventChange; }
572  bool preventCursorChange() const { return mPreventCursorChange; }
573 
574  //printing
575 
577  void beginPrint( QPrinter& printer, const bool evaluateDDPageSize = false );
579  void beginPrintAsPDF( QPrinter& printer, const QString& file );
580 
586  void doPrint( QPrinter& printer, QPainter& painter, bool startNewPage = false );
587 
591  bool print( QPrinter &printer, const bool evaluateDDPageSize = false );
592 
596  bool exportAsPDF( const QString& file );
597 
600  QImage printPageAsRaster( int page );
601 
606  void renderPage( QPainter* p, int page );
607 
609  void computeWorldFileParameters( double& a, double& b, double& c, double& d, double& e, double& f ) const;
610 
611  QgsAtlasComposition& atlasComposition() { return mAtlasComposition; }
612 
616  Q_DECL_DEPRECATED static void relativeResizeRect( QRectF& rectToResize, const QRectF& boundsBefore, const QRectF& boundsAfter );
617 
621  Q_DECL_DEPRECATED static double relativePosition( double position, double beforeMin, double beforeMax, double afterMin, double afterMax );
622 
627  QgsComposition::AtlasMode atlasMode() const { return mAtlasMode; }
628 
634  bool setAtlasMode( const QgsComposition::AtlasMode mode );
635 
639  QList< QgsPaperItem* > pages() { return mPages; }
640 
645  QgsDataDefined* dataDefinedProperty( const QgsComposerObject::DataDefinedProperty property );
646 
655  void setDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property, bool active, bool useExpression, const QString &expression, const QString &field );
656 
661  QgsComposerModel * itemsModel() { return mItemsModel; }
662 
663  public slots:
665  void sendItemAddedSignal( QgsComposerItem* item );
666 
669  void updateBounds();
670 
676  void refreshItems();
677 
681  void setSelectedItem( QgsComposerItem* item );
682 
687  void setAllUnselected();
688 
696  void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties );
697 
698  protected:
699  void init();
700 
701 
702  private:
704  QgsMapRenderer* mMapRenderer;
705  const QgsMapSettings& mMapSettings;
706 
707  QgsComposition::PlotStyle mPlotStyle;
708  double mPageWidth;
709  double mPageHeight;
710  QList< QgsPaperItem* > mPages;
711  double mSpaceBetweenPages; //space in preview between pages
712 
714  QgsFillSymbolV2* mPageStyleSymbol;
715  void createDefaultPageStyleSymbol();
716 
718  QSet<QgsComposerMultiFrame*> mMultiFrames;
719 
721  int mPrintResolution;
722 
724  bool mPrintAsRaster;
725 
727  bool mGenerateWorldFile;
729  QgsComposerMap* mWorldFileMap;
730 
732  bool mUseAdvancedEffects;
733 
735  bool mSnapToGrid;
736  bool mGridVisible;
737  double mSnapGridResolution;
738  double mSnapGridOffsetX;
739  double mSnapGridOffsetY;
740  QPen mGridPen;
741  GridStyle mGridStyle;
742 
744  bool mAlignmentSnap;
745  bool mGuidesVisible;
746  bool mSmartGuides;
747  int mSnapTolerance;
748 
750  QList< QGraphicsLineItem* > mSnapLines;
751 
752  QgsComposerMouseHandles* mSelectionHandles;
753 
754  QUndoStack* mUndoStack;
755 
756  QgsComposerItemCommand* mActiveItemCommand;
757  QgsComposerMultiFrameCommand* mActiveMultiFrameCommand;
758 
760  QgsAtlasComposition mAtlasComposition;
761 
762  QgsComposition::AtlasMode mAtlasMode;
763 
764  bool mPreventCursorChange;
765 
766  QgsComposerModel * mItemsModel;
767 
769  QMap< QgsComposerObject::DataDefinedProperty, QString > mDataDefinedNames;
771  QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* > mDataDefinedProperties;
772 
773  QgsComposition(); //default constructor is forbidden
774 
776  QRectF compositionBounds() const;
777 
779  void updateZValues( const bool addUndoCommands = true );
780 
783  int boundingRectOfSelectedItems( QRectF& bRect );
784 
786  void loadDefaults();
787 
789  void loadSettings();
790 
792  QPointF minPointFromXml( const QDomElement& elem ) const;
793 
794  void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c );
795 
796  void updatePaperItems();
797  void addPaperItem();
798  void removePaperItems();
799  void deleteAndRemoveMultiFrames();
800 
801  static QString encodeStringForXML( const QString& str );
802 
803  //tries to return the current QGraphicsView attached to the composition
804  QGraphicsView* graphicsView() const;
805 
806  /*Recalculates the page size using data defined page settings*/
807  void refreshPageSize();
808 
816  bool dataDefinedEvaluate( QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue,
817  QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* >* dataDefinedProperties );
818 
824  bool dataDefinedActive( const QgsComposerObject::DataDefinedProperty property,
825  const QMap<QgsComposerObject::DataDefinedProperty, QgsDataDefined *> *dataDefinedProperties ) const;
826 
834  QVariant dataDefinedValue( QgsComposerObject::DataDefinedProperty property, const QgsFeature *feature, const QgsFields *fields,
835  QMap<QgsComposerObject::DataDefinedProperty, QgsDataDefined *> *dataDefinedProperties ) const;
836 
837 
843  void prepareDataDefinedExpression( QgsDataDefined *dd, QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* >* dataDefinedProperties ) const;
844 
849  bool ddPageSizeActive() const;
850 
851  private slots:
852  /*Prepares all data defined expressions*/
853  void prepareAllDataDefinedExpressions();
854 
855  signals:
856  void paperSizeChanged();
857  void nPagesChanged();
858 
860  void printResolutionChanged();
861 
863  void selectedItemChanged( QgsComposerItem* selected );
865  void composerArrowAdded( QgsComposerArrow* arrow );
867  void composerHtmlFrameAdded( QgsComposerHtml* html, QgsComposerFrame* frame );
869  void composerLabelAdded( QgsComposerLabel* label );
871  void composerMapAdded( QgsComposerMap* map );
873  void composerScaleBarAdded( QgsComposerScaleBar* scalebar );
875  void composerLegendAdded( QgsComposerLegend* legend );
877  void composerPictureAdded( QgsComposerPicture* picture );
879  void composerShapeAdded( QgsComposerShape* shape );
881  void composerTableAdded( QgsComposerAttributeTable* table );
883  void composerTableFrameAdded( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
885  void itemRemoved( QgsComposerItem* );
886 
888  void refreshItemsTriggered();
889 
891  void statusMsgChanged( QString message );
892 
893  friend class QgsComposerObject; //for accessing dataDefinedEvaluate, readDataDefinedPropertyMap and writeDataDefinedPropertyMap
894  friend class QgsComposerModel; //for accessing updateZValues (should not be public)
895 };
896 
897 template<class T> void QgsComposition::composerItems( QList<T*>& itemList )
898 {
899  itemList.clear();
900  QList<QGraphicsItem *> graphicsItemList = items();
901  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
902  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
903  {
904  T* item = dynamic_cast<T*>( *itemIt );
905  if ( item )
906  {
907  itemList.push_back( item );
908  }
909  }
910 }
911 
912 template<class T> void QgsComposition::composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const
913 {
914  itemList.clear();
915  QList<QGraphicsItem *> graphicsItemList = items();
916  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
917  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
918  {
919  T* item = dynamic_cast<T*>( *itemIt );
920  if ( item && itemPageNumber( item ) == pageNumber )
921  {
922  itemList.push_back( item );
923  }
924  }
925 }
926 
927 
928 #endif
929 
930 
931 
void setSnapTolerance(const int snapTolerance)
Sets the snap tolerance to use when automatically snapping items during movement and resizing to guid...
Definition: qgscomposition.h:279
A scale bar item that can be added to a map composition.
Definition: qgscomposerscalebar.h:30
QUndoStack * undoStack()
Returns pointer to undo/redo command storage.
Definition: qgscomposition.h:290
QgsComposition::AtlasMode atlasMode() const
Returns the current atlas mode of the composition.
Definition: qgscomposition.h:627
bool snapLinesVisible() const
Definition: qgscomposition.h:215
Definition: qgscomposition.h:90
A base class for objects which belong to a map composition.
Definition: qgscomposerobject.h:33
QgsFillSymbolV2 * pageStyleSymbol()
Note: added in version 2.1.
Definition: qgscomposition.h:185
void setPrintAsRaster(const bool enabled)
Definition: qgscomposition.h:369
State
Definition: qgsaddremoveitemcommand.h:32
A container class for data source field mapping or expression.
Definition: qgsdatadefined.h:32
An item that draws an arrow between to points.
Definition: qgscomposerarrow.h:28
QgsComposerModel * itemsModel()
Returns the items model attached to the composition.
Definition: qgscomposition.h:661
void setPlotStyle(const QgsComposition::PlotStyle style)
Definition: qgscomposition.h:393
const QgsMapSettings & mapSettings() const
Return setting of QGIS map canvas.
Definition: qgscomposition.h:390
const QPen & gridPen() const
Definition: qgscomposition.h:236
QgsComposerMouseHandles * selectionHandles()
Returns pointer to selection handles.
Definition: qgscomposition.h:510
bool smartGuidesEnabled() const
Definition: qgscomposition.h:221
A item that forms part of a map composition.
Definition: qgscomposeritem.h:38
Q_DECL_DEPRECATED double snapGridTolerance() const
Returns the snap tolerance to use when automatically snapping items during movement and resizing to t...
Definition: qgscomposition.h:255
bool preventCursorChange() const
Definition: qgscomposition.h:572
Container of fields for a vector layer.
Definition: qgsfield.h:172
A container for grouping several QgsComposerItems.
Definition: qgscomposeritemgroup.h:26
Definition: qgscomposeritemcommand.h:82
DataDefinedProperty
Data defined properties for different item types.
Definition: qgscomposerobject.h:40
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.
Definition: qgsmaprenderer.h:133
Definition: qgssymbolv2.h:277
double spaceBetweenPages() const
Returns the vertical space between pages in a composer view.
Definition: qgscomposition.h:146
bool alignmentSnap() const
Definition: qgscomposition.h:218
Definition: qgscomposerobject.h:43
Context
Definition: qgscomposeritemcommand.h:80
Definition: qgscomposition.h:113
A table that displays attributes from a vector layer.
Definition: qgscomposerattributetablev2.h:51
void composerItemsOnPage(QList< T * > &itemList, const int pageNumber) const
Return composer items of a specific type on a specified page.
Definition: qgscomposition.h:912
Definition: qgscomposition.h:96
A composer class that displays svg files or raster format (jpg, png, ...)
Definition: qgscomposerpicture.h:31
The QgsMapSettings class contains configuration for rendering of the map.
Definition: qgsmapsettings.h:52
Q_DECL_DEPRECATED void sortZList()
Sorts the zList.
Definition: qgscomposition.h:494
Context
Definition: qgscomposermultiframecommand.h:66
int itemPageNumber(const QgsComposerItem *) const
Returns on which page number (0-based) is displayed an item.
Definition: qgscomposition.cpp:571
Definition: qgscomposermultiframecommand.h:68
void setPreventCursorChange(const bool preventChange)
If true, prevents any mouse cursor changes by the composition or by any composer items Used by QgsCom...
Definition: qgscomposition.h:571
PlotStyle
Plot type.
Definition: qgscomposition.h:79
int printResolution() const
Definition: qgscomposition.h:365
GridStyle
Style to draw the snapping grid.
Definition: qgscomposition.h:87
Abstract base class for composer items with the ability to distribute the content to several frames (...
Definition: qgscomposermultiframe.h:39
Definition: qgscomposerhtml.h:29
A class to display a table in the print composer, and allow the table to span over multiple frames...
Definition: qgscomposertablev2.h:49
Definition: qgscomposition.h:82
void setAlignmentSnap(const bool s)
Definition: qgscomposition.h:217
Definition: qgscomposermultiframecommand.h:26
bool printAsRaster() const
Definition: qgscomposition.h:368
void setWorldFileMap(QgsComposerMap *map)
Definition: qgscomposition.h:375
QgsComposerMap * worldFileMap() const
Definition: qgscomposition.h:374
Graphics scene for map printing.
Definition: qgscomposition.h:73
bool snapToGridEnabled() const
Definition: qgscomposition.h:208
Definition: qgsaddremoveitemcommand.h:34
Object representing map window.
Definition: qgscomposermap.h:47
Frame item for a composer multiframe item.
Definition: qgscomposerframe.h:25
void setGenerateWorldFile(const bool enabled)
Definition: qgscomposition.h:372
GridStyle gridStyle() const
Definition: qgscomposition.h:239
A model for items attached to a composition.
Definition: qgscomposermodel.h:47
AtlasMode
Composition atlas modes.
Definition: qgscomposition.h:111
QString file
Definition: qgssvgcache.cpp:76
QList< QgsPaperItem * > pages()
Return pages in the correct order.
Definition: qgscomposition.h:639
bool useAdvancedEffects() const
Returns true if a composition should use advanced effects such as blend modes.
Definition: qgscomposition.h:379
Q_DECL_DEPRECATED void setSnapGridTolerance(double tolerance)
Sets the snap tolerance to use when automatically snapping items during movement and resizing to the ...
Definition: qgscomposition.h:247
A composer command class for adding / removing composer items.
Definition: qgsaddremoveitemcommand.h:26
double snapGridOffsetY() const
Definition: qgscomposition.h:233
double snapGridOffsetX() const
Definition: qgscomposition.h:230
A table class that displays a vector attribute table.
Definition: qgscomposerattributetable.h:49
Undo command to undo/redo all composer item related changes.
Definition: qgscomposeritemcommand.h:28
int snapTolerance() const
Returns the snap tolerance to use when automatically snapping items during movement and resizing to g...
Definition: qgscomposition.h:287
A composer items that draws common shapes (ellipse, triangle, rectangle)
Definition: qgscomposershape.h:28
double snapGridResolution() const
Definition: qgscomposition.h:227
Definition: qgscomposition.h:89
Definition: qgscomposition.h:102
Q_DECL_DEPRECATED double alignmentSnapTolerance() const
Returns the snap tolerance to use when automatically snapping items during movement and resizing to g...
Definition: qgscomposition.h:271
void setSmartGuidesEnabled(const bool b)
Definition: qgscomposition.h:220
Definition: qgscomposition.h:114
A label that can be placed onto a map composition.
Definition: qgscomposerlabel.h:30
Class used to render an Atlas, iterating over geometry features.
Definition: qgsatlascomposition.h:41
bool gridVisible() const
Definition: qgscomposition.h:211
QgsAtlasComposition & atlasComposition()
Definition: qgscomposition.h:611
Handles drawing of selection outlines and mouse handles.
Definition: qgscomposermousehandles.h:31
void composerItems(QList< T * > &itemList)
Return composer items of a specific type.
Definition: qgscomposition.h:897
bool generateWorldFile() const
Definition: qgscomposition.h:371
QgsComposition::PlotStyle plotStyle() const
Definition: qgscomposition.h:392
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:470
A legend that can be placed onto a map composition.
Definition: qgscomposerlegend.h:56
Q_DECL_DEPRECATED void setAlignmentSnapTolerance(double t)
Sets the snap tolerance to use when automatically snapping items during movement and resizing to guid...
Definition: qgscomposition.h:263
PaperOrientation
Definition: qgscomposition.h:100
QList< QGraphicsLineItem * > * snapLines()
Returns pointer to snap lines collection.
Definition: qgscomposition.h:505
ZValueDirection
Definition: qgscomposition.h:94