QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
QgsComposition Class Reference

Graphics scene for map printing. More...

#include <qgscomposition.h>

Collaboration diagram for QgsComposition:
Collaboration graph
[legend]

Public Types

enum  PlotStyle { Preview = 0, Print, Postscript }
 Plot type. More...
enum  GridStyle { Solid, Dots, Crosses }
 Style to draw the snapping grid. More...
enum  ZValueDirection { ZValueBelow, ZValueAbove }
enum  AtlasMode { AtlasOff, PreviewAtlas, ExportAtlas }
 Composition atlas modes. More...

Public Slots

void sendItemAddedSignal (QgsComposerItem *item)
 Casts object to the proper subclass type and calls corresponding itemAdded signal.
void updateBounds ()
 Updates the scene bounds of the composition.

Signals

void paperSizeChanged ()
void nPagesChanged ()
void selectedItemChanged (QgsComposerItem *selected)
 Is emitted when selected item changed.
void composerArrowAdded (QgsComposerArrow *arrow)
 Is emitted when new composer arrow has been added to the view.
void composerHtmlFrameAdded (QgsComposerHtml *html, QgsComposerFrame *frame)
 Is emitted when a new composer html has been added to the view.
void composerLabelAdded (QgsComposerLabel *label)
 Is emitted when new composer label has been added to the view.
void composerMapAdded (QgsComposerMap *map)
 Is emitted when new composer map has been added to the view.
void composerScaleBarAdded (QgsComposerScaleBar *scalebar)
 Is emitted when new composer scale bar has been added.
void composerLegendAdded (QgsComposerLegend *legend)
 Is emitted when a new composer legend has been added.
void composerPictureAdded (QgsComposerPicture *picture)
 Is emitted when a new composer picture has been added.
void composerShapeAdded (QgsComposerShape *shape)
 Is emitted when a new composer shape has been added.
void composerTableAdded (QgsComposerAttributeTable *table)
 Is emitted when a new composer table has been added.
void itemRemoved (QgsComposerItem *)
 Is emitted when a composer item has been removed from the scene.
void statusMsgChanged (QString message)
 Is emitted when the composition has an updated status bar message for the composer window.

Public Member Functions

 QgsComposition (QgsMapRenderer *mapRenderer)
 ~QgsComposition ()
void setPaperSize (double width, double height)
 Changes size of paper item.
double paperHeight () const
 Returns height of paper item.
double paperWidth () const
 Returns width of paper item.
double spaceBetweenPages () const
void setNumPages (int pages)
 Note: added in version 1.9.
int numPages () const
 Note: added in version 1.9.
void setPageStyleSymbol (QgsFillSymbolV2 *symbol)
 Note: added in version 2.1.
QgsFillSymbolV2pageStyleSymbol ()
 Note: added in version 2.1.
QPointF positionOnPage (const QPointF &position) const
 Returns the position within a page of a point in the composition.
int pageNumberForPoint (const QPointF &position) const
 Returns the page number corresponding to a point in the composition.
void setStatusMessage (const QString &message)
 Sets the status bar message for the composer window.
void updateSettings ()
 Refreshes the composition when composer related options change *Note: added in version 2.1.
void setSnapToGridEnabled (bool b)
bool snapToGridEnabled () const
void setGridVisible (bool b)
bool gridVisible () const
void setSnapLinesVisible (bool visible)
 Hides / shows custom snap lines.
bool snapLinesVisible () const
void setAlignmentSnap (bool s)
bool alignmentSnap () const
void setSmartGuidesEnabled (bool b)
bool smartGuidesEnabled () const
void clearSnapLines ()
 Removes all snap lines.
void setSnapGridResolution (double r)
double snapGridResolution () const
void setSnapGridTolerance (double tolerance)
double snapGridTolerance () const
void setSnapGridOffsetX (double offset)
double snapGridOffsetX () const
void setSnapGridOffsetY (double offset)
double snapGridOffsetY () const
void setGridPen (const QPen &p)
const QPen & gridPen () const
void setGridStyle (GridStyle s)
GridStyle gridStyle () const
void setAlignmentSnapTolerance (double t)
double alignmentSnapTolerance () const
QUndoStack * undoStack ()
 Returns pointer to undo/redo command storage.
QgsComposerItemcomposerItemAt (const QPointF &position)
 Returns the topmost composer item.
QgsComposerItemcomposerItemAt (const QPointF &position, const QgsComposerItem *belowItem)
 Returns the highest composer item at a specified position which is below a specified item.
int pageNumberAt (const QPointF &position) const
 Returns the page number (0-bsaed) given a coordinate.
int itemPageNumber (const QgsComposerItem *) const
 Returns on which page number (0-based) is displayed an item.
QList< QgsComposerItem * > selectedComposerItems ()
QList< const QgsComposerMap * > composerMapItems () const
 Returns pointers to all composer maps in the scene.
template<class T >
void composerItems (QList< T * > &itemList)
 Return composer items of a specific type.
const QgsComposerMapgetComposerMapById (int id) const
 Returns the composer map with specified id.
const QgsComposerHtmlgetComposerHtmlByItem (QgsComposerItem *item) const
const QgsComposerItemgetComposerItemById (QString theId) const
 Returns a composer item given its text identifier.
const QgsComposerItemgetComposerItemByUuid (QString theUuid) const
 Returns a composer item given its unique identifier.
int printResolution () const
void setPrintResolution (int dpi)
bool printAsRaster () const
void setPrintAsRaster (bool enabled)
bool generateWorldFile () const
void setGenerateWorldFile (bool enabled)
QgsComposerMapworldFileMap () const
void setWorldFileMap (QgsComposerMap *map)
bool useAdvancedEffects () const
 Returns true if a composition should use advanced effects such as blend modes.
void setUseAdvancedEffects (bool effectsEnabled)
 Used to enable or disable advanced effects such as blend modes in a composition.
QgsMapRenderermapRenderer ()
 Returns pointer to map renderer of qgis map canvas.
QgsComposition::PlotStyle plotStyle () const
void setPlotStyle (QgsComposition::PlotStyle style)
int pixelFontSize (double pointSize) const
 Returns the pixel font size for a font that has point size set.
double pointFontSize (int pixelSize) const
 Does the inverse calculation and returns points for pixels (equals to mm in QgsComposition)
bool writeXML (QDomElement &composerElem, QDomDocument &doc)
 Writes settings to xml (paper dimension)
bool readXML (const QDomElement &compositionElem, const QDomDocument &doc)
 Reads settings from xml file.
bool loadFromTemplate (const QDomDocument &doc, QMap< QString, QString > *substitutionMap=0, bool addUndoCommands=false)
 Load a template document.
void addItemsFromXML (const QDomElement &elem, const QDomDocument &doc, QMap< QgsComposerMap *, int > *mapsToRestore=0, bool addUndoCommands=false, QPointF *pos=0, bool pasteInPlace=false)
 Add items from XML representation to the graphics scene (for project file reading, pasting items from clipboard)
void addItemToZList (QgsComposerItem *item)
 Adds item to z list.
void removeItemFromZList (QgsComposerItem *item)
 Removes item from z list.
void raiseSelectedItems ()
void raiseItem (QgsComposerItem *item)
void lowerSelectedItems ()
void lowerItem (QgsComposerItem *item)
void moveSelectedItemsToTop ()
void moveItemToTop (QgsComposerItem *item)
void moveSelectedItemsToBottom ()
void moveItemToBottom (QgsComposerItem *item)
void selectNextByZOrder (ZValueDirection direction)
QgsComposerItemgetComposerItemBelow (QgsComposerItem *item)
QgsComposerItemgetComposerItemAbove (QgsComposerItem *item)
void alignSelectedItemsLeft ()
void alignSelectedItemsHCenter ()
void alignSelectedItemsRight ()
void alignSelectedItemsTop ()
void alignSelectedItemsVCenter ()
void alignSelectedItemsBottom ()
void lockSelectedItems ()
 Lock the selected items.
void unlockAllItems ()
 Unlock all items.
void sortZList ()
 Sorts the zList.
void refreshZList ()
 Rebuilds the z order list based on current order of items in scene.
QPointF snapPointToGrid (const QPointF &scenePoint) const
 Snaps a scene coordinate point to grid.
QList< QGraphicsLineItem * > * snapLines ()
 Returns pointer to snap lines collection.
QgsComposerMouseHandlesselectionHandles ()
 Returns pointer to selection handles.
QGraphicsLineItem * addSnapLine ()
 Add a custom snap line (can be horizontal or vertical)
void removeSnapLine (QGraphicsLineItem *line)
 Remove custom snap line (and delete the object)
QGraphicsLineItem * nearestSnapLine (bool horizontal, double x, double y, double tolerance, QList< QPair< QgsComposerItem *, QgsComposerItem::ItemPositionMode > > &snappedItems)
 Get nearest snap line.
void beginCommand (QgsComposerItem *item, const QString &commandText, QgsComposerMergeCommand::Context c=QgsComposerMergeCommand::Unknown)
 Allocates new item command and saves initial state in it.
void endCommand ()
 Saves end state of item and pushes command to the undo history.
void cancelCommand ()
 Deletes current command.
void beginMultiFrameCommand (QgsComposerMultiFrame *multiFrame, const QString &text)
void endMultiFrameCommand ()
void addMultiFrame (QgsComposerMultiFrame *multiFrame)
 Adds multiframe.
void removeMultiFrame (QgsComposerMultiFrame *multiFrame)
 Removes multi frame (but does not delete it)
void addComposerArrow (QgsComposerArrow *arrow)
 Adds an arrow item to the graphics scene and advices composer to create a widget for it (through signal)
void addComposerLabel (QgsComposerLabel *label)
 Adds label to the graphics scene and advices composer to create a widget for it (through signal)
void addComposerMap (QgsComposerMap *map, bool setDefaultPreviewStyle=true)
 Adds map to the graphics scene and advices composer to create a widget for it (through signal)
void addComposerScaleBar (QgsComposerScaleBar *scaleBar)
 Adds scale bar to the graphics scene and advices composer to create a widget for it (through signal)
void addComposerLegend (QgsComposerLegend *legend)
 Adds legend to the graphics scene and advices composer to create a widget for it (through signal)
void addComposerPicture (QgsComposerPicture *picture)
 Adds picture to the graphics scene and advices composer to create a widget for it (through signal)
void addComposerShape (QgsComposerShape *shape)
 Adds a composer shape to the graphics scene and advices composer to create a widget for it (through signal)
void addComposerTable (QgsComposerAttributeTable *table)
 Adds a composer table to the graphics scene and advices composer to create a widget for it (through signal)
void addComposerHtmlFrame (QgsComposerHtml *html, QgsComposerFrame *frame)
 Adds composer html frame and advices composer to create a widget for it (through signal)
void removeComposerItem (QgsComposerItem *item, bool createCommand=true)
 Remove item from the graphics scene.
void pushAddRemoveCommand (QgsComposerItem *item, const QString &text, QgsAddRemoveItemCommand::State state=QgsAddRemoveItemCommand::Added)
 Convenience function to create a QgsAddRemoveItemCommand, connect its signals and push it to the undo stack.
void setPreventCursorChange (bool preventChange)
 If true, prevents any mouse cursor changes by the composition or by any composer items Used by QgsComposer and QgsComposerView to prevent unwanted cursor changes.
bool preventCursorChange ()
void beginPrint (QPrinter &printer)
 Prepare the printer for printing.
void beginPrintAsPDF (QPrinter &printer, const QString &file)
 Prepare the printer for printing in a PDF.
void doPrint (QPrinter &printer, QPainter &painter)
 Print on a preconfigured printer.
void print (QPrinter &printer)
 Convenience function that prepares the printer and prints.
void exportAsPDF (const QString &file)
 Convenience function that prepares the printer for printing in PDF and prints.
QImage printPageAsRaster (int page)
 print composer page to image If the image does not fit into memory, a null image is returned
void renderPage (QPainter *p, int page)
 Render a page to a paint device.
void computeWorldFileParameters (double &a, double &b, double &c, double &d, double &e, double &f) const
 Compute world file parameters.
QgsAtlasCompositionatlasComposition ()
QgsComposition::AtlasMode atlasMode () const
 Returns the current atlas mode of the composition.
bool setAtlasMode (QgsComposition::AtlasMode mode)
 Sets the current atlas mode of the composition.

Static Public Member Functions

static void relativeResizeRect (QRectF &rectToResize, const QRectF &boundsBefore, const QRectF &boundsAfter)
 Resizes a QRectF relative to the change from boundsBefore to boundsAfter.
static double relativePosition (double position, double beforeMin, double beforeMax, double afterMin, double afterMax)
 Returns a scaled position given a before and after range.

Private Member Functions

void createDefaultPageStyleSymbol ()
 QgsComposition ()
QRectF compositionBounds () const
 Calculates the bounds of all non-gui items in the composition.
void updateZValues (bool addUndoCommands=true)
 Reset z-values of items based on position in z list.
int boundingRectOfSelectedItems (QRectF &bRect)
 Returns the bounding rectangle of the selected items in scene coordinates.
void loadDefaults ()
 Loads default composer settings.
void loadSettings ()
 Loads composer settings which may change, eg grid color.
QPointF minPointFromXml (const QDomElement &elem) const
 Calculates the item minimum position from an xml string.
void connectAddRemoveCommandSignals (QgsAddRemoveItemCommand *c)
void updatePaperItems ()
void addPaperItem ()
void removePaperItems ()
void deleteAndRemoveMultiFrames ()

Static Private Member Functions

static QString encodeStringForXML (const QString &str)

Private Attributes

QgsMapRenderermMapRenderer
 Pointer to map renderer of QGIS main map.
QgsComposition::PlotStyle mPlotStyle
double mPageWidth
double mPageHeight
QList< QgsPaperItem * > mPages
double mSpaceBetweenPages
QgsFillSymbolV2mPageStyleSymbol
 Drawing style for page.
QLinkedList< QgsComposerItem * > mItemZList
 Maintains z-Order of items.
QSet< QgsComposerMultiFrame * > mMultiFrames
 List multiframe objects.
int mPrintResolution
 Dpi for printout.
bool mPrintAsRaster
 Flag if map should be printed as a raster (via QImage).
bool mGenerateWorldFile
 Flag if a world file should be generated on raster export.
QgsComposerMapmWorldFileMap
 Composer map to use for the world file generation.
bool mUseAdvancedEffects
 Flag if advanced visual effects such as blend modes should be used.
bool mSnapToGrid
 Parameters for snap to grid function.
bool mGridVisible
double mSnapGridResolution
double mSnapGridTolerance
double mSnapGridOffsetX
double mSnapGridOffsetY
QPen mGridPen
GridStyle mGridStyle
bool mAlignmentSnap
 Parameters for alignment snap.
bool mGuidesVisible
bool mSmartGuides
double mAlignmentSnapTolerance
QList< QGraphicsLineItem * > mSnapLines
 Arbitraty snap lines (horizontal and vertical)
QgsComposerMouseHandlesmSelectionHandles
QUndoStack mUndoStack
QgsComposerItemCommandmActiveItemCommand
QgsComposerMultiFrameCommandmActiveMultiFrameCommand
QgsAtlasComposition mAtlasComposition
 The atlas composition object.
QgsComposition::AtlasMode mAtlasMode
bool mPreventCursorChange

Detailed Description

Graphics scene for map printing.

The class manages the paper item which always is the item in the back (z-value 0). It maintains the z-Values of the items and stores them in a list in ascending z-Order. This list can be changed to lower/raise items one position or to bring them to front/back.

Definition at line 66 of file qgscomposition.h.

Member Enumeration Documentation

Composition atlas modes.

Enumerator:
AtlasOff 
PreviewAtlas 
ExportAtlas 

Definition at line 94 of file qgscomposition.h.

Style to draw the snapping grid.

Enumerator:
Solid 
Dots 
Crosses 

Definition at line 80 of file qgscomposition.h.

Plot type.

Enumerator:
Preview 
Print 
Postscript 

Definition at line 72 of file qgscomposition.h.

Enumerator:
ZValueBelow 
ZValueAbove 

Definition at line 87 of file qgscomposition.h.

Constructor & Destructor Documentation

QgsComposition::QgsComposition ( QgsMapRenderer mapRenderer)
QgsComposition::~QgsComposition ( )
QgsComposition::QgsComposition ( )
private

Definition at line 101 of file qgscomposition.cpp.

References loadDefaults(), and loadSettings().

Member Function Documentation

void QgsComposition::addComposerArrow ( QgsComposerArrow arrow)

Adds an arrow item to the graphics scene and advices composer to create a widget for it (through signal)

Note
not available in python bindings

Definition at line 1999 of file qgscomposition.cpp.

References composerArrowAdded(), and updateBounds().

Referenced by addItemsFromXML(), and QgsComposerView::mouseReleaseEvent().

void QgsComposition::addComposerHtmlFrame ( QgsComposerHtml html,
QgsComposerFrame frame 
)

Adds composer html frame and advices composer to create a widget for it (through signal)

Definition at line 2089 of file qgscomposition.cpp.

References composerHtmlFrameAdded(), and updateBounds().

Referenced by QgsComposerHtml::addFrame().

void QgsComposition::addComposerLabel ( QgsComposerLabel label)

Adds label to the graphics scene and advices composer to create a widget for it (through signal)

Definition at line 2009 of file qgscomposition.cpp.

References composerLabelAdded(), and updateBounds().

Referenced by addItemsFromXML(), and QgsComposerView::mousePressEvent().

void QgsComposition::addComposerLegend ( QgsComposerLegend legend)

Adds legend to the graphics scene and advices composer to create a widget for it (through signal)

Definition at line 2049 of file qgscomposition.cpp.

References composerLegendAdded(), and updateBounds().

Referenced by addItemsFromXML(), and QgsComposerView::mousePressEvent().

void QgsComposition::addComposerMap ( QgsComposerMap map,
bool  setDefaultPreviewStyle = true 
)

Adds map to the graphics scene and advices composer to create a widget for it (through signal)

Definition at line 2019 of file qgscomposition.cpp.

References QgsComposerMap::Cache, QgsComposerMap::cache(), composerMapAdded(), QgsComposerMap::previewMode(), QgsComposerMap::Rectangle, QgsComposerMap::setPreviewMode(), and updateBounds().

Referenced by addItemsFromXML(), and QgsComposerView::mouseReleaseEvent().

void QgsComposition::addComposerPicture ( QgsComposerPicture picture)

Adds picture to the graphics scene and advices composer to create a widget for it (through signal)

Definition at line 2059 of file qgscomposition.cpp.

References composerPictureAdded(), and updateBounds().

Referenced by addItemsFromXML(), and QgsComposerView::mousePressEvent().

void QgsComposition::addComposerScaleBar ( QgsComposerScaleBar scaleBar)

Adds scale bar to the graphics scene and advices composer to create a widget for it (through signal)

Definition at line 2039 of file qgscomposition.cpp.

References composerScaleBarAdded(), and updateBounds().

Referenced by addItemsFromXML(), and QgsComposerView::mousePressEvent().

void QgsComposition::addComposerShape ( QgsComposerShape shape)

Adds a composer shape to the graphics scene and advices composer to create a widget for it (through signal)

Definition at line 2069 of file qgscomposition.cpp.

References composerShapeAdded(), and updateBounds().

Referenced by addItemsFromXML(), and QgsComposerView::addShape().

void QgsComposition::addComposerTable ( QgsComposerAttributeTable table)

Adds a composer table to the graphics scene and advices composer to create a widget for it (through signal)

Definition at line 2079 of file qgscomposition.cpp.

References composerTableAdded(), and updateBounds().

Referenced by addItemsFromXML(), and QgsComposerView::mousePressEvent().

void QgsComposition::addItemsFromXML ( const QDomElement &  elem,
const QDomDocument &  doc,
QMap< QgsComposerMap *, int > *  mapsToRestore = 0,
bool  addUndoCommands = false,
QPointF *  pos = 0,
bool  pasteInPlace = false 
)

Add items from XML representation to the graphics scene (for project file reading, pasting items from clipboard)

Parameters
elemitems parent element, e.g.
<Composer> 
or
<ComposerItemClipboard> 
docxml document
mapsToRestorefor reading from project file: set preview move 'rectangle' to all maps and save the preview states to show composer maps on demand
addUndoCommandsinsert AddItem commands if true (e.g. for copy/paste)
positem position. Optional, take position from xml if 0
pasteInPlacewhether the position should be kept but mapped to the page origin. (the page is the page under to the mouse cursor)
Note
not available in python bindings

Definition at line 787 of file qgscomposition.cpp.

References addComposerArrow(), addComposerLabel(), addComposerLegend(), addComposerMap(), addComposerPicture(), addComposerScaleBar(), addComposerShape(), addComposerTable(), addMultiFrame(), QgsComposerMap::assignFreeId(), composerItems(), getComposerMapById(), minPointFromXml(), mItemZList, QgsComposerItem::move(), mPageHeight, mSpaceBetweenPages, pageNumberAt(), paperHeight(), QgsComposerMap::previewMode(), pushAddRemoveCommand(), QgsComposerHtml::readXML(), QgsComposerAttributeTable::readXML(), QgsComposerItemGroup::readXML(), QgsComposerShape::readXML(), QgsComposerPicture::readXML(), QgsComposerArrow::readXML(), QgsComposerLabel::readXML(), QgsComposerLegend::readXML(), QgsComposerScaleBar::readXML(), QgsComposerMap::readXML(), QgsComposerMap::Rectangle, refreshZList(), selectedItemChanged(), QgsComposerMultiFrame::setCreateUndoCommands(), QgsComposerItem::setItemPosition(), QgsComposerMap::setPreviewMode(), QgsComposerItem::setSelected(), QgsComposerShape::setUseSymbolV2(), spaceBetweenPages(), and tr.

Referenced by loadFromTemplate(), and QgsComposerView::pasteItems().

void QgsComposition::addItemToZList ( QgsComposerItem item)

Adds item to z list.

Usually called from constructor of QgsComposerItem

Definition at line 1112 of file qgscomposition.cpp.

References mItemZList.

Referenced by QgsComposerItem::init().

void QgsComposition::addMultiFrame ( QgsComposerMultiFrame multiFrame)

Adds multiframe.

The object is owned by QgsComposition until removeMultiFrame is called

Definition at line 1985 of file qgscomposition.cpp.

References mMultiFrames, and updateBounds().

Referenced by addItemsFromXML(), QgsComposerMultiFrame::QgsComposerMultiFrame(), and QgsAddRemoveMultiFrameCommand::switchState().

void QgsComposition::addPaperItem ( )
private
QGraphicsLineItem * QgsComposition::addSnapLine ( )

Add a custom snap line (can be horizontal or vertical)

Definition at line 1648 of file qgscomposition.cpp.

References mGuidesVisible, and mSnapLines.

Referenced by QgsComposerRuler::mousePressEvent(), and readXML().

bool QgsComposition::alignmentSnap ( ) const
inline
double QgsComposition::alignmentSnapTolerance ( ) const
inline

Definition at line 182 of file qgscomposition.h.

Referenced by QgsComposerMouseHandles::alignPos().

void QgsComposition::alignSelectedItemsBottom ( )
void QgsComposition::alignSelectedItemsHCenter ( )
void QgsComposition::alignSelectedItemsLeft ( )
void QgsComposition::alignSelectedItemsRight ( )
void QgsComposition::alignSelectedItemsTop ( )
void QgsComposition::alignSelectedItemsVCenter ( )
QgsAtlasComposition& QgsComposition::atlasComposition ( )
inline
QgsComposition::AtlasMode QgsComposition::atlasMode ( ) const
inline
void QgsComposition::beginCommand ( QgsComposerItem item,
const QString &  commandText,
QgsComposerMergeCommand::Context  c = QgsComposerMergeCommand::Unknown 
)

Allocates new item command and saves initial state in it.

Parameters
itemtarget item
commandTextdescriptive command text
ccontext for merge commands (unknown for non-mergeable commands)

Definition at line 1916 of file qgscomposition.cpp.

References mActiveItemCommand, QgsComposerItemCommand::savePreviousState(), and QgsComposerMergeCommand::Unknown.

Referenced by QgsComposerItem::beginCommand(), and QgsComposerView::mouseReleaseEvent().

void QgsComposition::beginMultiFrameCommand ( QgsComposerMultiFrame multiFrame,
const QString &  text 
)
void QgsComposition::beginPrint ( QPrinter &  printer)

Prepare the printer for printing.

Definition at line 2363 of file qgscomposition.cpp.

References printResolution().

Referenced by print().

void QgsComposition::beginPrintAsPDF ( QPrinter &  printer,
const QString &  file 
)

Prepare the printer for printing in a PDF.

Definition at line 2310 of file qgscomposition.cpp.

References QgsPaintEngineHack::fixEngineFlags(), paperHeight(), and paperWidth().

Referenced by exportAsPDF().

int QgsComposition::boundingRectOfSelectedItems ( QRectF &  bRect)
private

Returns the bounding rectangle of the selected items in scene coordinates.

Returns
0 in case of success

Definition at line 1787 of file qgscomposition.cpp.

References selectedComposerItems().

Referenced by alignSelectedItemsBottom(), alignSelectedItemsHCenter(), alignSelectedItemsLeft(), alignSelectedItemsRight(), alignSelectedItemsTop(), and alignSelectedItemsVCenter().

void QgsComposition::cancelCommand ( )

Deletes current command.

Definition at line 1954 of file qgscomposition.cpp.

References mActiveItemCommand.

Referenced by QgsComposerItem::cancelCommand().

void QgsComposition::clearSnapLines ( )

Removes all snap lines.

Definition at line 1671 of file qgscomposition.cpp.

References mSnapLines.

void QgsComposition::composerArrowAdded ( QgsComposerArrow arrow)
signal

Is emitted when new composer arrow has been added to the view.

Referenced by addComposerArrow(), and sendItemAddedSignal().

void QgsComposition::composerHtmlFrameAdded ( QgsComposerHtml html,
QgsComposerFrame frame 
)
signal

Is emitted when a new composer html has been added to the view.

Referenced by addComposerHtmlFrame(), and sendItemAddedSignal().

QgsComposerItem * QgsComposition::composerItemAt ( const QPointF &  position)

Returns the topmost composer item.

Ignores mPaperItem

Definition at line 293 of file qgscomposition.cpp.

Referenced by QgsComposerView::mousePressEvent(), and QgsComposerView::wheelEvent().

QgsComposerItem * QgsComposition::composerItemAt ( const QPointF &  position,
const QgsComposerItem belowItem 
)

Returns the highest composer item at a specified position which is below a specified item.

Ignores mPaperItem

Note
Added in QGIS 2.1

Definition at line 298 of file qgscomposition.cpp.

template<class T >
void QgsComposition::composerItems ( QList< T * > &  itemList)
void QgsComposition::composerLabelAdded ( QgsComposerLabel label)
signal

Is emitted when new composer label has been added to the view.

Referenced by addComposerLabel(), and sendItemAddedSignal().

void QgsComposition::composerLegendAdded ( QgsComposerLegend legend)
signal

Is emitted when a new composer legend has been added.

Referenced by addComposerLegend(), and sendItemAddedSignal().

void QgsComposition::composerMapAdded ( QgsComposerMap map)
signal

Is emitted when new composer map has been added to the view.

Referenced by addComposerMap(), and sendItemAddedSignal().

QList< const QgsComposerMap * > QgsComposition::composerMapItems ( ) const

Returns pointers to all composer maps in the scene.

Note
available in python bindings only with PyQt >= 4.8.4

Definition at line 360 of file qgscomposition.cpp.

Referenced by QgsComposerMap::assignFreeId(), QgsComposerView::mousePressEvent(), and QgsComposerMap::QgsComposerMap().

void QgsComposition::composerPictureAdded ( QgsComposerPicture picture)
signal

Is emitted when a new composer picture has been added.

Referenced by addComposerPicture(), and sendItemAddedSignal().

void QgsComposition::composerScaleBarAdded ( QgsComposerScaleBar scalebar)
signal

Is emitted when new composer scale bar has been added.

Referenced by addComposerScaleBar(), and sendItemAddedSignal().

void QgsComposition::composerShapeAdded ( QgsComposerShape shape)
signal

Is emitted when a new composer shape has been added.

Referenced by addComposerShape(), and sendItemAddedSignal().

void QgsComposition::composerTableAdded ( QgsComposerAttributeTable table)
signal

Is emitted when a new composer table has been added.

Referenced by addComposerTable(), and sendItemAddedSignal().

QRectF QgsComposition::compositionBounds ( ) const
private

Calculates the bounds of all non-gui items in the composition.

Ignores snap lines and mouse handles

Definition at line 164 of file qgscomposition.cpp.

References mPageWidth.

Referenced by updateBounds().

void QgsComposition::computeWorldFileParameters ( double &  a,
double &  b,
double &  c,
double &  d,
double &  e,
double &  f 
) const
void QgsComposition::connectAddRemoveCommandSignals ( QgsAddRemoveItemCommand c)
private

Definition at line 2181 of file qgscomposition.cpp.

References itemRemoved(), and sendItemAddedSignal().

Referenced by pushAddRemoveCommand(), and removeComposerItem().

void QgsComposition::createDefaultPageStyleSymbol ( )
private

Definition at line 253 of file qgscomposition.cpp.

References QgsFillSymbolV2::createSimple(), and mPageStyleSymbol.

Referenced by QgsComposition().

void QgsComposition::deleteAndRemoveMultiFrames ( )
private

Definition at line 2300 of file qgscomposition.cpp.

References mMultiFrames.

Referenced by loadFromTemplate(), and ~QgsComposition().

void QgsComposition::doPrint ( QPrinter &  printer,
QPainter &  painter 
)

Print on a preconfigured printer.

Definition at line 2326 of file qgscomposition.cpp.

References mPrintAsRaster, numPages(), printPageAsRaster(), and renderPage().

Referenced by print().

QString QgsComposition::encodeStringForXML ( const QString &  str)
staticprivate

Definition at line 2433 of file qgscomposition.cpp.

Referenced by loadFromTemplate().

void QgsComposition::endCommand ( )
void QgsComposition::endMultiFrameCommand ( )
void QgsComposition::exportAsPDF ( const QString &  file)

Convenience function that prepares the printer for printing in PDF and prints.

Definition at line 2319 of file qgscomposition.cpp.

References beginPrintAsPDF(), and print().

bool QgsComposition::generateWorldFile ( ) const
inline

Definition at line 246 of file qgscomposition.h.

const QgsComposerHtml * QgsComposition::getComposerHtmlByItem ( QgsComposerItem item) const

Definition at line 396 of file qgscomposition.cpp.

References QgsComposerFrame::multiFrame().

QgsComposerItem * QgsComposition::getComposerItemAbove ( QgsComposerItem item)

Definition at line 1160 of file qgscomposition.cpp.

References mItemZList.

Referenced by selectNextByZOrder().

QgsComposerItem * QgsComposition::getComposerItemBelow ( QgsComposerItem item)

Definition at line 1175 of file qgscomposition.cpp.

References mItemZList.

Referenced by selectNextByZOrder().

const QgsComposerItem * QgsComposition::getComposerItemById ( QString  theId) const

Returns a composer item given its text identifier.

Ids are not necessarely unique, but this function returns only one element.

Note
added in 2.0
Parameters
theId- A QString representing the identifier of the item to retrieve.
Returns
QgsComposerItem pointer or 0 pointer if no such item exists.

Definition at line 415 of file qgscomposition.cpp.

References QgsComposerItem::id().

const QgsComposerItem * QgsComposition::getComposerItemByUuid ( QString  theUuid) const

Returns a composer item given its unique identifier.

Note
added in 2.0
Parameters
theUuidA QString representing the UUID of the item to

Definition at line 470 of file qgscomposition.cpp.

References QgsComposerItem::uuid().

const QgsComposerMap * QgsComposition::getComposerMapById ( int  id) const
const QPen& QgsComposition::gridPen ( ) const
inline

Definition at line 176 of file qgscomposition.h.

Referenced by QgsPaperGrid::paint().

GridStyle QgsComposition::gridStyle ( ) const
inline

Definition at line 179 of file qgscomposition.h.

Referenced by QgsPaperGrid::paint().

bool QgsComposition::gridVisible ( ) const
inline

Definition at line 148 of file qgscomposition.h.

Referenced by QgsPaperGrid::paint().

int QgsComposition::itemPageNumber ( const QgsComposerItem item) const

Returns on which page number (0-based) is displayed an item.

Definition at line 336 of file qgscomposition.cpp.

References pageNumberAt().

Referenced by QgsComposerLabel::displayText().

void QgsComposition::itemRemoved ( QgsComposerItem )
signal

Is emitted when a composer item has been removed from the scene.

Referenced by connectAddRemoveCommandSignals(), loadFromTemplate(), and removeComposerItem().

void QgsComposition::loadDefaults ( )
private

Loads default composer settings.

Definition at line 149 of file qgscomposition.cpp.

References mAlignmentSnapTolerance, mSnapGridOffsetX, mSnapGridOffsetY, mSnapGridResolution, and mSnapGridTolerance.

Referenced by QgsComposition().

bool QgsComposition::loadFromTemplate ( const QDomDocument &  doc,
QMap< QString, QString > *  substitutionMap = 0,
bool  addUndoCommands = false 
)

Load a template document.

Parameters
doctemplate document
substitutionMapmap with text to replace. Text needs to be enclosed by brackets (e.g. '[text]' )
addUndoCommandswhether or not to add undo commands

Definition at line 680 of file qgscomposition.cpp.

References addItemsFromXML(), atlasComposition(), deleteAndRemoveMultiFrames(), encodeStringForXML(), itemRemoved(), mItemZList, mPages, mUndoStack, QgsAtlasComposition::readXML(), and readXML().

void QgsComposition::loadSettings ( )
private

Loads composer settings which may change, eg grid color.

Definition at line 1884 of file qgscomposition.cpp.

References Crosses, Dots, mGridPen, mGridStyle, and Solid.

Referenced by QgsComposition(), and updateSettings().

void QgsComposition::lockSelectedItems ( )
void QgsComposition::lowerItem ( QgsComposerItem item)

Definition at line 1243 of file qgscomposition.cpp.

References mItemZList.

Referenced by lowerSelectedItems().

void QgsComposition::lowerSelectedItems ( )

Definition at line 1229 of file qgscomposition.cpp.

References lowerItem(), selectedComposerItems(), and updateZValues().

QgsMapRenderer* QgsComposition::mapRenderer ( )
inline

Returns pointer to map renderer of qgis map canvas.

Definition at line 260 of file qgscomposition.h.

Referenced by QgsComposerLegend::layerIdList(), and QgsComposerMap::QgsComposerMap().

QPointF QgsComposition::minPointFromXml ( const QDomElement &  elem) const
private

Calculates the item minimum position from an xml string.

Definition at line 758 of file qgscomposition.cpp.

References MathUtils::max().

Referenced by addItemsFromXML().

void QgsComposition::moveItemToBottom ( QgsComposerItem item)

Definition at line 1299 of file qgscomposition.cpp.

References mItemZList.

Referenced by moveSelectedItemsToBottom().

void QgsComposition::moveItemToTop ( QgsComposerItem item)

Definition at line 1274 of file qgscomposition.cpp.

References mItemZList.

Referenced by moveSelectedItemsToTop().

void QgsComposition::moveSelectedItemsToBottom ( )

Definition at line 1285 of file qgscomposition.cpp.

References moveItemToBottom(), selectedComposerItems(), and updateZValues().

void QgsComposition::moveSelectedItemsToTop ( )

Definition at line 1259 of file qgscomposition.cpp.

References moveItemToTop(), selectedComposerItems(), and updateZValues().

QGraphicsLineItem * QgsComposition::nearestSnapLine ( bool  horizontal,
double  x,
double  y,
double  tolerance,
QList< QPair< QgsComposerItem *, QgsComposerItem::ItemPositionMode > > &  snappedItems 
)
void QgsComposition::nPagesChanged ( )
signal

Referenced by setNumPages().

int QgsComposition::numPages ( ) const
int QgsComposition::pageNumberAt ( const QPointF &  position) const

Returns the page number (0-bsaed) given a coordinate.

Definition at line 331 of file qgscomposition.cpp.

References paperHeight(), and spaceBetweenPages().

Referenced by addItemsFromXML(), and itemPageNumber().

int QgsComposition::pageNumberForPoint ( const QPointF &  position) const

Returns the page number corresponding to a point in the composition.

Note
Added in QGIS 2.1

Definition at line 280 of file qgscomposition.cpp.

References mPages, paperHeight(), and spaceBetweenPages().

QgsFillSymbolV2* QgsComposition::pageStyleSymbol ( )
inline

Note: added in version 2.1.

Definition at line 123 of file qgscomposition.h.

Referenced by QgsPaperItem::calculatePageMargin(), and QgsPaperItem::paint().

double QgsComposition::paperHeight ( ) const
void QgsComposition::paperSizeChanged ( )
signal

Referenced by readXML(), and setPaperSize().

double QgsComposition::paperWidth ( ) const
int QgsComposition::pixelFontSize ( double  pointSize) const

Returns the pixel font size for a font that has point size set.

The result depends on the resolution (dpi) and of the preview mode. Each item that sets a font should call this function before drawing text

Definition at line 507 of file qgscomposition.cpp.

QgsComposition::PlotStyle QgsComposition::plotStyle ( ) const
inline
double QgsComposition::pointFontSize ( int  pixelSize) const

Does the inverse calculation and returns points for pixels (equals to mm in QgsComposition)

Definition at line 514 of file qgscomposition.cpp.

QPointF QgsComposition::positionOnPage ( const QPointF &  position) const

Returns the position within a page of a point in the composition.

Note
Added in QGIS 2.1

Definition at line 263 of file qgscomposition.cpp.

References mPages, paperHeight(), and spaceBetweenPages().

bool QgsComposition::preventCursorChange ( )
inline

Definition at line 406 of file qgscomposition.h.

Referenced by QgsComposerMouseHandles::setViewportCursor().

void QgsComposition::print ( QPrinter &  printer)

Convenience function that prepares the printer and prints.

Definition at line 2373 of file qgscomposition.cpp.

References beginPrint(), and doPrint().

Referenced by exportAsPDF().

bool QgsComposition::printAsRaster ( ) const
inline

Definition at line 243 of file qgscomposition.h.

QImage QgsComposition::printPageAsRaster ( int  page)

print composer page to image If the image does not fit into memory, a null image is returned

Definition at line 2380 of file qgscomposition.cpp.

References paperHeight(), paperWidth(), printResolution(), and renderPage().

Referenced by doPrint().

int QgsComposition::printResolution ( ) const
inline
void QgsComposition::pushAddRemoveCommand ( QgsComposerItem item,
const QString &  text,
QgsAddRemoveItemCommand::State  state = QgsAddRemoveItemCommand::Added 
)
void QgsComposition::raiseItem ( QgsComposerItem item)

Definition at line 1145 of file qgscomposition.cpp.

References mItemZList.

Referenced by raiseSelectedItems().

void QgsComposition::raiseSelectedItems ( )

Definition at line 1131 of file qgscomposition.cpp.

References raiseItem(), selectedComposerItems(), and updateZValues().

bool QgsComposition::readXML ( const QDomElement &  compositionElem,
const QDomDocument &  doc 
)
void QgsComposition::refreshZList ( )

Rebuilds the z order list based on current order of items in scene.

Definition at line 1586 of file qgscomposition.cpp.

References QgsComposerItem::ComposerFrame, QgsComposerItem::ComposerPaper, mItemZList, QgsComposerItem::type(), and updateZValues().

Referenced by addItemsFromXML().

double QgsComposition::relativePosition ( double  position,
double  beforeMin,
double  beforeMax,
double  afterMin,
double  afterMax 
)
static

Returns a scaled position given a before and after range.

Definition at line 2551 of file qgscomposition.cpp.

Referenced by relativeResizeRect().

void QgsComposition::relativeResizeRect ( QRectF &  rectToResize,
const QRectF &  boundsBefore,
const QRectF &  boundsAfter 
)
static

Resizes a QRectF relative to the change from boundsBefore to boundsAfter.

Definition at line 2540 of file qgscomposition.cpp.

References relativePosition().

Referenced by QgsComposerMouseHandles::drawSelectedItemBounds(), QgsComposerMouseHandles::mouseReleaseEvent(), and QgsComposerItemGroup::setSceneRect().

void QgsComposition::removeComposerItem ( QgsComposerItem item,
bool  createCommand = true 
)
void QgsComposition::removeItemFromZList ( QgsComposerItem item)

Removes item from z list.

Usually called from destructor of QgsComposerItem

Definition at line 1122 of file qgscomposition.cpp.

References mItemZList.

Referenced by QgsComposerItem::~QgsComposerItem().

void QgsComposition::removeMultiFrame ( QgsComposerMultiFrame multiFrame)

Removes multi frame (but does not delete it)

Definition at line 1992 of file qgscomposition.cpp.

References mMultiFrames, and updateBounds().

Referenced by removeComposerItem(), and QgsAddRemoveMultiFrameCommand::switchState().

void QgsComposition::removePaperItems ( )
private

Definition at line 2290 of file qgscomposition.cpp.

References mPages, and QgsExpression::setSpecialColumn().

Referenced by readXML(), and ~QgsComposition().

void QgsComposition::removeSnapLine ( QGraphicsLineItem *  line)

Remove custom snap line (and delete the object)

Definition at line 1664 of file qgscomposition.cpp.

References mSnapLines.

Referenced by QgsComposerRuler::mouseReleaseEvent().

void QgsComposition::renderPage ( QPainter *  p,
int  page 
)

Render a page to a paint device.

Note
added in version 1.9

Definition at line 2398 of file qgscomposition.cpp.

References mPages, mPlotStyle, Print, and setSnapLinesVisible().

Referenced by doPrint(), and printPageAsRaster().

QList< QgsComposerItem * > QgsComposition::selectedComposerItems ( )
void QgsComposition::selectedItemChanged ( QgsComposerItem selected)
signal

Is emitted when selected item changed.

If 0, no item is selected

Referenced by addItemsFromXML(), selectNextByZOrder(), sendItemAddedSignal(), and unlockAllItems().

QgsComposerMouseHandles* QgsComposition::selectionHandles ( )
inline

Returns pointer to selection handles.

Note
not available in python bindings

Definition at line 348 of file qgscomposition.h.

Referenced by QgsComposerView::mousePressEvent(), and QgsComposerView::mouseReleaseEvent().

void QgsComposition::selectNextByZOrder ( ZValueDirection  direction)
void QgsComposition::sendItemAddedSignal ( QgsComposerItem item)
slot
void QgsComposition::setAlignmentSnap ( bool  s)
inline

Definition at line 154 of file qgscomposition.h.

void QgsComposition::setAlignmentSnapTolerance ( double  t)
inline

Definition at line 181 of file qgscomposition.h.

bool QgsComposition::setAtlasMode ( QgsComposition::AtlasMode  mode)

Sets the current atlas mode of the composition.

Returns false if the mode could not be changed.

Definition at line 2506 of file qgscomposition.cpp.

References QgsComposerMap::atlasDriven(), AtlasOff, QgsAtlasComposition::beginRender(), composerItems(), QgsAtlasComposition::endRender(), mAtlasComposition, mAtlasMode, and QgsComposerMap::toggleAtlasPreview().

Referenced by QgsAtlasComposition::setEnabled().

void QgsComposition::setGenerateWorldFile ( bool  enabled)
inline

Definition at line 247 of file qgscomposition.h.

void QgsComposition::setGridPen ( const QPen &  p)

Definition at line 1862 of file qgscomposition.cpp.

References mGridPen, and updatePaperItems().

void QgsComposition::setGridStyle ( GridStyle  s)

Definition at line 1870 of file qgscomposition.cpp.

References mGridStyle, and updatePaperItems().

void QgsComposition::setGridVisible ( bool  b)

Definition at line 1833 of file qgscomposition.cpp.

References mGridVisible, and updatePaperItems().

void QgsComposition::setNumPages ( int  pages)
void QgsComposition::setPageStyleSymbol ( QgsFillSymbolV2 symbol)

Note: added in version 2.1.

Definition at line 247 of file qgscomposition.cpp.

References mPageStyleSymbol.

void QgsComposition::setPaperSize ( double  width,
double  height 
)

Changes size of paper item.

Definition at line 189 of file qgscomposition.cpp.

References mPageHeight, mPages, mPageWidth, mSpaceBetweenPages, paperSizeChanged(), and updateBounds().

void QgsComposition::setPlotStyle ( QgsComposition::PlotStyle  style)
inline

Definition at line 263 of file qgscomposition.h.

void QgsComposition::setPreventCursorChange ( bool  preventChange)
inline

If true, prevents any mouse cursor changes by the composition or by any composer items Used by QgsComposer and QgsComposerView to prevent unwanted cursor changes.

Definition at line 405 of file qgscomposition.h.

Referenced by QgsComposerView::keyPressEvent(), QgsComposerView::keyReleaseEvent(), QgsComposerView::mousePressEvent(), QgsComposerView::mouseReleaseEvent(), and QgsComposerView::setCurrentTool().

void QgsComposition::setPrintAsRaster ( bool  enabled)
inline

Definition at line 244 of file qgscomposition.h.

void QgsComposition::setPrintResolution ( int  dpi)
inline

Definition at line 241 of file qgscomposition.h.

void QgsComposition::setSmartGuidesEnabled ( bool  b)
inline

Definition at line 157 of file qgscomposition.h.

void QgsComposition::setSnapGridOffsetX ( double  offset)

Definition at line 1850 of file qgscomposition.cpp.

References mSnapGridOffsetX, and updatePaperItems().

void QgsComposition::setSnapGridOffsetY ( double  offset)

Definition at line 1856 of file qgscomposition.cpp.

References mSnapGridOffsetY, and updatePaperItems().

void QgsComposition::setSnapGridResolution ( double  r)

Definition at line 1839 of file qgscomposition.cpp.

References mSnapGridResolution, and updatePaperItems().

void QgsComposition::setSnapGridTolerance ( double  tolerance)

Definition at line 1845 of file qgscomposition.cpp.

References mSnapGridTolerance.

void QgsComposition::setSnapLinesVisible ( bool  visible)

Hides / shows custom snap lines.

Definition at line 1682 of file qgscomposition.cpp.

References mGuidesVisible, and mSnapLines.

Referenced by renderPage().

void QgsComposition::setSnapToGridEnabled ( bool  b)

Definition at line 1827 of file qgscomposition.cpp.

References mSnapToGrid, and updatePaperItems().

void QgsComposition::setStatusMessage ( const QString &  message)

Sets the status bar message for the composer window.

Note
Added in QGIS 2.1

Definition at line 288 of file qgscomposition.cpp.

References statusMsgChanged().

Referenced by QgsComposerMouseHandles::dragMouseMove(), QgsComposerMouseHandles::resetStatusBar(), and QgsComposerMouseHandles::resizeMouseMove().

void QgsComposition::setUseAdvancedEffects ( bool  effectsEnabled)

Used to enable or disable advanced effects such as blend modes in a composition.

Note
: added in version 1.9

Definition at line 490 of file qgscomposition.cpp.

References mUseAdvancedEffects, and QgsComposerItem::setEffectsEnabled().

void QgsComposition::setWorldFileMap ( QgsComposerMap map)
inline

Definition at line 250 of file qgscomposition.h.

bool QgsComposition::smartGuidesEnabled ( ) const
inline
double QgsComposition::snapGridOffsetX ( ) const
inline

Definition at line 170 of file qgscomposition.h.

Referenced by QgsPaperGrid::paint().

double QgsComposition::snapGridOffsetY ( ) const
inline

Definition at line 173 of file qgscomposition.h.

Referenced by QgsPaperGrid::paint().

double QgsComposition::snapGridResolution ( ) const
inline

Definition at line 164 of file qgscomposition.h.

Referenced by QgsPaperGrid::paint().

double QgsComposition::snapGridTolerance ( ) const
inline

Definition at line 167 of file qgscomposition.h.

QList< QGraphicsLineItem* >* QgsComposition::snapLines ( )
inline

Returns pointer to snap lines collection.

Definition at line 343 of file qgscomposition.h.

Referenced by QgsComposerMouseHandles::collectAlignCoordinates().

bool QgsComposition::snapLinesVisible ( ) const
inline

Definition at line 152 of file qgscomposition.h.

QPointF QgsComposition::snapPointToGrid ( const QPointF &  scenePoint) const
bool QgsComposition::snapToGridEnabled ( ) const
inline

Definition at line 145 of file qgscomposition.h.

void QgsComposition::sortZList ( )

Sorts the zList.

The only time where this function needs to be called is from QgsComposer after reading all the items from xml file

Definition at line 1560 of file qgscomposition.cpp.

References mItemZList.

double QgsComposition::spaceBetweenPages ( ) const
inline
void QgsComposition::statusMsgChanged ( QString  message)
signal

Is emitted when the composition has an updated status bar message for the composer window.

Referenced by setStatusMessage().

QUndoStack* QgsComposition::undoStack ( )
inline

Returns pointer to undo/redo command storage.

Definition at line 185 of file qgscomposition.h.

Referenced by QgsComposerMouseHandles::mouseReleaseEvent(), QgsComposerView::mouseReleaseEvent(), pushAddRemoveCommand(), and removeComposerItem().

void QgsComposition::unlockAllItems ( )
void QgsComposition::updateBounds ( )
slot
void QgsComposition::updatePaperItems ( )
private
void QgsComposition::updateSettings ( )

Refreshes the composition when composer related options change *Note: added in version 2.1.

Definition at line 1876 of file qgscomposition.cpp.

References loadSettings(), and updatePaperItems().

void QgsComposition::updateZValues ( bool  addUndoCommands = true)
private
bool QgsComposition::useAdvancedEffects ( ) const
inline

Returns true if a composition should use advanced effects such as blend modes.

Note
added in 1.9

Definition at line 254 of file qgscomposition.h.

Referenced by QgsComposerMap::draw().

QgsComposerMap* QgsComposition::worldFileMap ( ) const
inline

Definition at line 249 of file qgscomposition.h.

bool QgsComposition::writeXML ( QDomElement &  composerElem,
QDomDocument &  doc 
)

Member Data Documentation

QgsComposerItemCommand* QgsComposition::mActiveItemCommand
private

Definition at line 510 of file qgscomposition.h.

Referenced by beginCommand(), cancelCommand(), endCommand(), and ~QgsComposition().

QgsComposerMultiFrameCommand* QgsComposition::mActiveMultiFrameCommand
private

Definition at line 511 of file qgscomposition.h.

Referenced by beginMultiFrameCommand(), endMultiFrameCommand(), and ~QgsComposition().

bool QgsComposition::mAlignmentSnap
private

Parameters for alignment snap.

Definition at line 498 of file qgscomposition.h.

Referenced by readXML(), and writeXML().

double QgsComposition::mAlignmentSnapTolerance
private

Definition at line 501 of file qgscomposition.h.

Referenced by loadDefaults(), readXML(), and writeXML().

QgsAtlasComposition QgsComposition::mAtlasComposition
private

The atlas composition object.

It is held by the QgsComposition

Definition at line 514 of file qgscomposition.h.

Referenced by setAtlasMode().

QgsComposition::AtlasMode QgsComposition::mAtlasMode
private

Definition at line 516 of file qgscomposition.h.

Referenced by setAtlasMode().

bool QgsComposition::mGenerateWorldFile
private

Flag if a world file should be generated on raster export.

Definition at line 480 of file qgscomposition.h.

Referenced by readXML(), and writeXML().

QPen QgsComposition::mGridPen
private

Definition at line 494 of file qgscomposition.h.

Referenced by loadSettings(), and setGridPen().

GridStyle QgsComposition::mGridStyle
private

Definition at line 495 of file qgscomposition.h.

Referenced by loadSettings(), and setGridStyle().

bool QgsComposition::mGridVisible
private

Definition at line 489 of file qgscomposition.h.

Referenced by readXML(), setGridVisible(), and writeXML().

bool QgsComposition::mGuidesVisible
private

Definition at line 499 of file qgscomposition.h.

Referenced by addSnapLine(), readXML(), setSnapLinesVisible(), and writeXML().

QLinkedList<QgsComposerItem*> QgsComposition::mItemZList
private

Maintains z-Order of items.

Starts with item at position 1 (position 0 is always paper item)

Definition at line 468 of file qgscomposition.h.

Referenced by addItemsFromXML(), addItemToZList(), getComposerItemAbove(), getComposerItemBelow(), loadFromTemplate(), lowerItem(), moveItemToBottom(), moveItemToTop(), raiseItem(), refreshZList(), removeItemFromZList(), sortZList(), and updateZValues().

QgsMapRenderer* QgsComposition::mMapRenderer
private

Pointer to map renderer of QGIS main map.

Definition at line 456 of file qgscomposition.h.

QSet<QgsComposerMultiFrame*> QgsComposition::mMultiFrames
private

List multiframe objects.

Definition at line 471 of file qgscomposition.h.

Referenced by addMultiFrame(), deleteAndRemoveMultiFrames(), removeMultiFrame(), and writeXML().

double QgsComposition::mPageHeight
private
QList< QgsPaperItem* > QgsComposition::mPages
private
QgsFillSymbolV2* QgsComposition::mPageStyleSymbol
private

Drawing style for page.

Definition at line 464 of file qgscomposition.h.

Referenced by createDefaultPageStyleSymbol(), readXML(), setPageStyleSymbol(), writeXML(), and ~QgsComposition().

double QgsComposition::mPageWidth
private

Definition at line 458 of file qgscomposition.h.

Referenced by compositionBounds(), paperWidth(), readXML(), setPaperSize(), and writeXML().

QgsComposition::PlotStyle QgsComposition::mPlotStyle
private

Definition at line 457 of file qgscomposition.h.

Referenced by renderPage().

bool QgsComposition::mPreventCursorChange
private

Definition at line 548 of file qgscomposition.h.

bool QgsComposition::mPrintAsRaster
private

Flag if map should be printed as a raster (via QImage).

False by default

Definition at line 477 of file qgscomposition.h.

Referenced by doPrint(), readXML(), and writeXML().

int QgsComposition::mPrintResolution
private

Dpi for printout.

Definition at line 474 of file qgscomposition.h.

Referenced by QgsComposition(), readXML(), and writeXML().

QgsComposerMouseHandles* QgsComposition::mSelectionHandles
private

Definition at line 506 of file qgscomposition.h.

Referenced by QgsComposition().

bool QgsComposition::mSmartGuides
private

Definition at line 500 of file qgscomposition.h.

Referenced by readXML(), and writeXML().

double QgsComposition::mSnapGridOffsetX
private
double QgsComposition::mSnapGridOffsetY
private
double QgsComposition::mSnapGridResolution
private
double QgsComposition::mSnapGridTolerance
private
QList< QGraphicsLineItem* > QgsComposition::mSnapLines
private

Arbitraty snap lines (horizontal and vertical)

Definition at line 504 of file qgscomposition.h.

Referenced by addSnapLine(), clearSnapLines(), nearestSnapLine(), removeSnapLine(), setSnapLinesVisible(), and writeXML().

bool QgsComposition::mSnapToGrid
private

Parameters for snap to grid function.

Definition at line 488 of file qgscomposition.h.

Referenced by readXML(), setSnapToGridEnabled(), snapPointToGrid(), and writeXML().

double QgsComposition::mSpaceBetweenPages
private

Definition at line 461 of file qgscomposition.h.

Referenced by addItemsFromXML(), addPaperItem(), setPaperSize(), and snapPointToGrid().

QUndoStack QgsComposition::mUndoStack
private
bool QgsComposition::mUseAdvancedEffects
private

Flag if advanced visual effects such as blend modes should be used.

True by default

Definition at line 485 of file qgscomposition.h.

Referenced by setUseAdvancedEffects().

QgsComposerMap* QgsComposition::mWorldFileMap
private

Composer map to use for the world file generation.

Definition at line 482 of file qgscomposition.h.

Referenced by computeWorldFileParameters(), and writeXML().


The documentation for this class was generated from the following files: