QGIS API Documentation  2.12.0-Lyon
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 
129  void setPaperSize( double width, double height,
130  bool keepRelativeItemPosition = true );
131 
137  double paperHeight() const;
138 
144  double paperWidth() const;
145 
159  void resizePageToContents( double marginTop = 0.0, double marginRight = 0.0,
160  double marginBottom = 0.0, double marginLeft = 0.0 );
161 
172  void setResizeToContentsMargins( double marginTop, double marginRight,
173  double marginBottom, double marginLeft );
174 
185  void resizeToContentsMargins( double& marginTop, double& marginRight,
186  double& marginBottom, double& marginLeft ) const;
187 
191  double spaceBetweenPages() const { return mSpaceBetweenPages; }
192 
197  void setNumPages( const int pages );
198 
203  int numPages() const;
204 
214  bool pageIsEmpty( const int page ) const;
215 
223  bool shouldExportPage( const int page ) const;
224 
226  void setPageStyleSymbol( QgsFillSymbolV2* symbol );
228  QgsFillSymbolV2* pageStyleSymbol() { return mPageStyleSymbol; }
229 
233  QPointF positionOnPage( const QPointF & position ) const;
234 
238  int pageNumberForPoint( const QPointF & position ) const;
239 
243  void setStatusMessage( const QString & message );
244 
248  void updateSettings();
249 
250  void setSnapToGridEnabled( const bool b );
251  bool snapToGridEnabled() const {return mSnapToGrid;}
252 
253  void setGridVisible( const bool b );
254  bool gridVisible() const {return mGridVisible;}
255 
257  void setSnapLinesVisible( const bool visible );
258  bool snapLinesVisible() const {return mGuidesVisible;}
259 
260  void setAlignmentSnap( const bool s ) { mAlignmentSnap = s; }
261  bool alignmentSnap() const { return mAlignmentSnap; }
262 
263  void setSmartGuidesEnabled( const bool b ) { mSmartGuides = b; }
264  bool smartGuidesEnabled() const {return mSmartGuides;}
265 
273  void setPagesVisible( bool visible );
274 
281  bool pagesVisible() const { return mPagesVisible; }
282 
284  void clearSnapLines();
285 
286  void setSnapGridResolution( const double r );
287  double snapGridResolution() const {return mSnapGridResolution;}
288 
289  void setSnapGridOffsetX( const double offset );
290  double snapGridOffsetX() const {return mSnapGridOffsetX;}
291 
292  void setSnapGridOffsetY( const double offset );
293  double snapGridOffsetY() const {return mSnapGridOffsetY;}
294 
295  void setGridPen( const QPen& p );
296  const QPen& gridPen() const {return mGridPen;}
297 
298  void setGridStyle( const GridStyle s );
299  GridStyle gridStyle() const {return mGridStyle;}
300 
307  Q_DECL_DEPRECATED void setSnapGridTolerance( double tolerance ) { mSnapTolerance = tolerance; }
308 
315  Q_DECL_DEPRECATED double snapGridTolerance() const {return mSnapTolerance;}
316 
323  Q_DECL_DEPRECATED void setAlignmentSnapTolerance( double t ) { mSnapTolerance = t; }
324 
331  Q_DECL_DEPRECATED double alignmentSnapTolerance() const { return mSnapTolerance; }
332 
339  void setSnapTolerance( const int snapTolerance ) { mSnapTolerance = snapTolerance; }
340 
347  int snapTolerance() const { return mSnapTolerance; }
348 
354  void setBoundingBoxesVisible( const bool boundsVisible );
355 
361  bool boundingBoxesVisible() const { return mBoundingBoxesVisible; }
362 
364  QUndoStack* undoStack() { return mUndoStack; }
365 
371  QgsComposerItem* composerItemAt( const QPointF & position, const bool ignoreLocked = false ) const;
372 
379  QgsComposerItem* composerItemAt( const QPointF & position, const QgsComposerItem* belowItem, const bool ignoreLocked = false ) const;
380 
382  int pageNumberAt( const QPointF& position ) const;
383 
385  int itemPageNumber( const QgsComposerItem* ) const;
386 
391  QList<QgsComposerItem*> selectedComposerItems( const bool includeLockedItems = true );
392 
396  QList<const QgsComposerMap*> composerMapItems() const;
397 
402  template<class T> void composerItems( QList<T*>& itemList );
403 
410  template<class T> void composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const;
411 
414  const QgsComposerMap* getComposerMapById( const int id ) const;
415 
421  Q_DECL_DEPRECATED const QgsComposerHtml* getComposerHtmlByItem( QgsComposerItem *item ) const;
422 
429  const QgsComposerItem* getComposerItemById( const QString& theId ) const;
430 
434  const QgsComposerItem* getComposerItemByUuid( const QString& theUuid ) const;
435 
436  int printResolution() const {return mPrintResolution;}
437  void setPrintResolution( const int dpi );
438 
439  bool printAsRaster() const {return mPrintAsRaster;}
440  void setPrintAsRaster( const bool enabled ) { mPrintAsRaster = enabled; }
441 
442  bool generateWorldFile() const { return mGenerateWorldFile; }
443  void setGenerateWorldFile( const bool enabled ) { mGenerateWorldFile = enabled; }
444 
445  QgsComposerMap* worldFileMap() const { return mWorldFileMap; }
446  void setWorldFileMap( QgsComposerMap* map ) { mWorldFileMap = map; }
447 
449  bool useAdvancedEffects() const {return mUseAdvancedEffects;}
451  void setUseAdvancedEffects( const bool effectsEnabled );
452 
454  Q_DECL_DEPRECATED QgsMapRenderer* mapRenderer() { return mMapRenderer; }
456 
459  const QgsMapSettings& mapSettings() const { return mMapSettings; }
460 
461  QgsComposition::PlotStyle plotStyle() const { return mPlotStyle; }
462  void setPlotStyle( const QgsComposition::PlotStyle style ) { mPlotStyle = style; }
463 
468  Q_DECL_DEPRECATED int pixelFontSize( double pointSize ) const;
469 
473  Q_DECL_DEPRECATED double pointFontSize( int pixelSize ) const;
474 
476  bool writeXML( QDomElement& composerElem, QDomDocument& doc );
477 
479  bool readXML( const QDomElement& compositionElem, const QDomDocument& doc );
480 
489  bool loadFromTemplate( const QDomDocument& doc, QMap<QString, QString>* substitutionMap = 0,
490  bool addUndoCommands = false, const bool clearComposition = true );
491 
501  void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore = 0,
502  bool addUndoCommands = false, QPointF* pos = 0, bool pasteInPlace = false );
503 
505  void addItemToZList( QgsComposerItem* item );
507  void removeItemFromZList( QgsComposerItem* item );
508 
509  //functions to move selected items in hierarchy
510  void raiseSelectedItems();
511 
512  //returns true if successful
513  bool raiseItem( QgsComposerItem* item );
514  void lowerSelectedItems();
515  //returns true if successful
516  bool lowerItem( QgsComposerItem* item );
517  void moveSelectedItemsToTop();
518  //returns true if successful
519  bool moveItemToTop( QgsComposerItem* item );
520  void moveSelectedItemsToBottom();
521  //returns true if successful
522  bool moveItemToBottom( QgsComposerItem* item );
523 
524  //functions to find items by their position in the z list
525  void selectNextByZOrder( const ZValueDirection direction );
526  QgsComposerItem* getComposerItemBelow( QgsComposerItem* item ) const;
527  QgsComposerItem* getComposerItemAbove( QgsComposerItem* item ) const;
528 
529  //functions to align selected items
530  void alignSelectedItemsLeft();
531  void alignSelectedItemsHCenter();
532  void alignSelectedItemsRight();
533  void alignSelectedItemsTop();
534  void alignSelectedItemsVCenter();
535  void alignSelectedItemsBottom();
536 
537  //functions to lock and unlock items
539  void lockSelectedItems();
541  void unlockAllItems();
542 
548  QgsComposerItemGroup* groupItems( QList<QgsComposerItem*> items );
549 
557  QList<QgsComposerItem*> ungroupItems( QgsComposerItemGroup* group );
558 
563  Q_DECL_DEPRECATED void sortZList() {};
564 
568  void refreshZList();
569 
571  QPointF snapPointToGrid( const QPointF& scenePoint ) const;
572 
574  QList< QGraphicsLineItem* >* snapLines() {return &mSnapLines;}
575 
579  QgsComposerMouseHandles* selectionHandles() {return mSelectionHandles;}
580 
582  QGraphicsLineItem* addSnapLine();
584  void removeSnapLine( QGraphicsLineItem* line );
588  QGraphicsLineItem* nearestSnapLine( const bool horizontal, const double x, const double y, const double tolerance, QList< QPair< QgsComposerItem*, QgsComposerItem::ItemPositionMode > >& snappedItems ) const;
589 
594  void beginCommand( QgsComposerItem* item, const QString& commandText, const QgsComposerMergeCommand::Context c = QgsComposerMergeCommand::Unknown );
595 
597  void endCommand();
599  void cancelCommand();
600 
601  void beginMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, const QgsComposerMultiFrameMergeCommand::Context c = QgsComposerMultiFrameMergeCommand::Unknown );
602  void endMultiFrameCommand();
604  void cancelMultiFrameCommand();
605 
607  void addMultiFrame( QgsComposerMultiFrame* multiFrame );
609  void removeMultiFrame( QgsComposerMultiFrame* multiFrame );
612  void addComposerArrow( QgsComposerArrow* arrow );
614  void addComposerLabel( QgsComposerLabel* label );
616  void addComposerMap( QgsComposerMap* map, const bool setDefaultPreviewStyle = true );
618  void addComposerScaleBar( QgsComposerScaleBar* scaleBar );
620  void addComposerLegend( QgsComposerLegend* legend );
622  void addComposerPicture( QgsComposerPicture* picture );
624  void addComposerShape( QgsComposerShape* shape );
626  void addComposerTable( QgsComposerAttributeTable* table );
628  void addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame );
630  void addComposerTableFrame( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
631 
633  void removeComposerItem( QgsComposerItem* item, const bool createCommand = true, const bool removeGroupItems = true );
634 
636  void pushAddRemoveCommand( QgsComposerItem* item, const QString& text, const QgsAddRemoveItemCommand::State state = QgsAddRemoveItemCommand::Added );
637 
640  void setPreventCursorChange( const bool preventChange ) { mPreventCursorChange = preventChange; }
641  bool preventCursorChange() const { return mPreventCursorChange; }
642 
643  //printing
644 
646  void beginPrint( QPrinter& printer, const bool evaluateDDPageSize = false );
648  void beginPrintAsPDF( QPrinter& printer, const QString& file );
649 
655  void doPrint( QPrinter& printer, QPainter& painter, bool startNewPage = false );
656 
660  bool print( QPrinter &printer, const bool evaluateDDPageSize = false );
661 
665  bool exportAsPDF( const QString& file );
666 
678  QImage printPageAsRaster( int page, const QSize& imageSize = QSize(), int dpi = 0 );
679 
693  QImage renderRectAsRaster( const QRectF& rect, const QSize& imageSize = QSize(), int dpi = 0 );
694 
701  void renderPage( QPainter* p, int page );
702 
711  void renderRect( QPainter* p, const QRectF& rect );
712 
716  void computeWorldFileParameters( double& a, double& b, double& c, double& d, double& e, double& f ) const;
717 
728  void computeWorldFileParameters( const QRectF& exportRegion, double& a, double& b, double& c, double& d, double& e, double& f ) const;
729 
730  QgsAtlasComposition& atlasComposition() { return mAtlasComposition; }
731 
735  Q_DECL_DEPRECATED static void relativeResizeRect( QRectF& rectToResize, const QRectF& boundsBefore, const QRectF& boundsAfter );
736 
740  Q_DECL_DEPRECATED static double relativePosition( double position, double beforeMin, double beforeMax, double afterMin, double afterMax );
741 
746  QgsComposition::AtlasMode atlasMode() const { return mAtlasMode; }
747 
753  bool setAtlasMode( const QgsComposition::AtlasMode mode );
754 
758  QList< QgsPaperItem* > pages() { return mPages; }
759 
764  QgsDataDefined* dataDefinedProperty( const QgsComposerObject::DataDefinedProperty property );
765 
774  void setDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property, bool active, bool useExpression, const QString &expression, const QString &field );
775 
780  QgsComposerModel * itemsModel() { return mItemsModel; }
781 
790  void setCustomProperty( const QString &key, const QVariant &value );
791 
801  QVariant customProperty( const QString &key, const QVariant &defaultValue = QVariant() ) const;
802 
810  void removeCustomProperty( const QString &key );
811 
818  QStringList customProperties() const;
819 
825  QRectF pageItemBounds( int pageNumber, bool visibleOnly = false ) const;
826 
831  QRectF compositionBounds( bool ignorePages = false, double margin = 0.0 ) const;
832 
833  public slots:
835  void sendItemAddedSignal( QgsComposerItem* item );
836 
839  void updateBounds();
840 
846  void refreshItems();
847 
851  void setSelectedItem( QgsComposerItem* item );
852 
857  void setAllUnselected();
858 
867  void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext* context = 0 );
868 
873  QgsExpressionContext* createExpressionContext() const;
874 
875  protected:
876  void init();
877 
878 
879  private:
881  QgsMapRenderer* mMapRenderer;
882  const QgsMapSettings& mMapSettings;
883 
884  QgsComposition::PlotStyle mPlotStyle;
885  double mPageWidth;
886  double mPageHeight;
887  QList< QgsPaperItem* > mPages;
888  double mSpaceBetweenPages; //space in preview between pages
889 
891  QgsFillSymbolV2* mPageStyleSymbol;
892  void createDefaultPageStyleSymbol();
893 
895  QSet<QgsComposerMultiFrame*> mMultiFrames;
896 
898  int mPrintResolution;
899 
901  bool mPrintAsRaster;
902 
904  bool mGenerateWorldFile;
906  QgsComposerMap* mWorldFileMap;
907 
909  bool mUseAdvancedEffects;
910 
912  bool mSnapToGrid;
913  bool mGridVisible;
914  double mSnapGridResolution;
915  double mSnapGridOffsetX;
916  double mSnapGridOffsetY;
917  QPen mGridPen;
918  GridStyle mGridStyle;
919 
921  bool mAlignmentSnap;
922  bool mGuidesVisible;
923  bool mSmartGuides;
924  int mSnapTolerance;
925 
927  QList< QGraphicsLineItem* > mSnapLines;
928 
929  double mResizeToContentsMarginTop;
930  double mResizeToContentsMarginRight;
931  double mResizeToContentsMarginBottom;
932  double mResizeToContentsMarginLeft;
933 
934  bool mBoundingBoxesVisible;
935  bool mPagesVisible;
936  QgsComposerMouseHandles* mSelectionHandles;
937 
938  QUndoStack* mUndoStack;
939 
940  QgsComposerItemCommand* mActiveItemCommand;
941  QgsComposerMultiFrameCommand* mActiveMultiFrameCommand;
942 
944  QgsAtlasComposition mAtlasComposition;
945 
946  QgsComposition::AtlasMode mAtlasMode;
947 
948  bool mPreventCursorChange;
949 
950  QgsComposerModel * mItemsModel;
951 
956 
957  QgsObjectCustomProperties mCustomProperties;
958 
959  QgsComposition(); //default constructor is forbidden
960 
962  void updateZValues( const bool addUndoCommands = true );
963 
966  int boundingRectOfSelectedItems( QRectF& bRect );
967 
969  void loadDefaults();
970 
972  void loadSettings();
973 
975  QPointF minPointFromXml( const QDomElement& elem ) const;
976 
977  void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c );
978 
979  void updatePaperItems();
980  void addPaperItem();
981  void removePaperItems();
982  void deleteAndRemoveMultiFrames();
983 
984  static QString encodeStringForXML( const QString& str );
985 
986  //tries to return the current QGraphicsView attached to the composition
987  QGraphicsView* graphicsView() const;
988 
992  void refreshPageSize( const QgsExpressionContext* context = 0 );
993 
1003  bool dataDefinedEvaluate( QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue,
1004  const QgsExpressionContext& context,
1006 
1012  bool dataDefinedActive( const QgsComposerObject::DataDefinedProperty property,
1013  const QMap<QgsComposerObject::DataDefinedProperty, QgsDataDefined *> *dataDefinedProperties ) const;
1014 
1023  QVariant dataDefinedValue( QgsComposerObject::DataDefinedProperty property, const QgsFeature *feature, const QgsFields& fields,
1024  const QgsExpressionContext& context,
1026 
1027 
1035  void prepareDataDefinedExpression( QgsDataDefined *dd, QMap< QgsComposerObject::DataDefinedProperty, QgsDataDefined* >* dataDefinedProperties, const QgsExpressionContext& context ) const;
1036 
1041  bool ddPageSizeActive() const;
1042 
1043  private slots:
1044  /*Prepares all data defined expressions*/
1045  void prepareAllDataDefinedExpressions();
1046 
1047  signals:
1048  void paperSizeChanged();
1049  void nPagesChanged();
1050 
1052  void printResolutionChanged();
1053 
1055  void selectedItemChanged( QgsComposerItem* selected );
1057  void composerArrowAdded( QgsComposerArrow* arrow );
1059  void composerHtmlFrameAdded( QgsComposerHtml* html, QgsComposerFrame* frame );
1061  void composerLabelAdded( QgsComposerLabel* label );
1063  void composerMapAdded( QgsComposerMap* map );
1065  void composerScaleBarAdded( QgsComposerScaleBar* scalebar );
1067  void composerLegendAdded( QgsComposerLegend* legend );
1069  void composerPictureAdded( QgsComposerPicture* picture );
1071  void composerShapeAdded( QgsComposerShape* shape );
1073  void composerTableAdded( QgsComposerAttributeTable* table );
1075  void composerTableFrameAdded( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );
1077  void itemRemoved( QgsComposerItem* );
1078 
1080  void refreshItemsTriggered();
1081 
1083  void statusMsgChanged( QString message );
1084 
1085  friend class QgsComposerObject; //for accessing dataDefinedEvaluate, readDataDefinedPropertyMap and writeDataDefinedPropertyMap
1086  friend class QgsComposerModel; //for accessing updateZValues (should not be public)
1087 };
1088 
1089 template<class T> void QgsComposition::composerItems( QList<T*>& itemList )
1090 {
1091  itemList.clear();
1092  QList<QGraphicsItem *> graphicsItemList = items();
1093  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1094  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1095  {
1096  T* item = dynamic_cast<T*>( *itemIt );
1097  if ( item )
1098  {
1099  itemList.push_back( item );
1100  }
1101  }
1102 }
1103 
1104 template<class T> void QgsComposition::composerItemsOnPage( QList<T*>& itemList, const int pageNumber ) const
1105 {
1106  itemList.clear();
1107  QList<QGraphicsItem *> graphicsItemList = items();
1108  QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin();
1109  for ( ; itemIt != graphicsItemList.end(); ++itemIt )
1110  {
1111  T* item = dynamic_cast<T*>( *itemIt );
1112  if ( item && itemPageNumber( item ) == pageNumber )
1113  {
1114  itemList.push_back( item );
1115  }
1116  }
1117 }
1118 
1119 
1120 #endif
1121 
1122 
1123 
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:176
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
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)
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.