QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Friends | List of all members
QgsComposerMap Class Reference

Object representing map window. More...

#include <qgscomposermap.h>

Inheritance diagram for QgsComposerMap:
Inheritance graph
[legend]

Public Types

enum  AtlasScalingMode { Fixed, Predefined, Auto }
 Scaling modes used for the serial rendering (atlas) More...
 
enum  Border { Left, Right, Bottom, Top }
 Enum for different frame borders. More...
 
enum  GridAnnotationDirection { Horizontal = 0, Vertical, HorizontalAndVertical, BoundaryDirection }
 
enum  GridAnnotationFormat {
  Decimal = 0, DegreeMinute, DegreeMinuteSecond, DecimalWithSuffix,
  DegreeMinuteNoSuffix, DegreeMinutePadded, DegreeMinuteSecondNoSuffix, DegreeMinuteSecondPadded
}
 
enum  GridAnnotationPosition { InsideMapFrame = 0, OutsideMapFrame, Disabled }
 
enum  GridFrameStyle {
  NoGridFrame = 0, Zebra, InteriorTicks, ExteriorTicks,
  InteriorExteriorTicks, LineBorder
}
 
enum  GridStyle { Solid = 0, Cross, Markers, FrameAnnotationsOnly }
 
enum  PreviewMode { Cache = 0, Render, Rectangle }
 Preview style. More...
 
- Public Types inherited from QgsComposerItem
enum  ItemPositionMode {
  UpperLeft, UpperMiddle, UpperRight, MiddleLeft,
  Middle, MiddleRight, LowerLeft, LowerMiddle,
  LowerRight
}
 
enum  ItemType {
  ComposerItem = UserType + 100, ComposerArrow, ComposerItemGroup, ComposerLabel,
  ComposerLegend, ComposerMap, ComposerPaper, ComposerPicture,
  ComposerScaleBar, ComposerShape, ComposerPolygon, ComposerPolyline,
  ComposerTable, ComposerAttributeTable, ComposerTextTable, ComposerFrame
}
 
enum  MouseMoveAction {
  MoveItem, ResizeUp, ResizeDown, ResizeLeft,
  ResizeRight, ResizeLeftUp, ResizeRightUp, ResizeLeftDown,
  ResizeRightDown, NoAction
}
 Describes the action (move or resize in different directon) to be done during mouse move. More...
 
enum  ZoomMode { Zoom = 0, ZoomRecenter, ZoomToPoint, NoZoom }
 Modes for zooming item content. More...
 
- Public Types inherited from QgsComposerObject
enum  DataDefinedProperty {
  NoProperty = 0, AllProperties, TestProperty, PresetPaperSize,
  PaperWidth, PaperHeight, NumPages, PaperOrientation,
  PageNumber, PositionX, PositionY, ItemWidth,
  ItemHeight, ItemRotation, Transparency, BlendMode,
  ExcludeFromExports, MapRotation, MapScale, MapXMin,
  MapYMin, MapXMax, MapYMax, MapAtlasMargin,
  MapLayers, MapStylePreset, PictureSource, SourceUrl
}
 Data defined properties for different item types. More...
 
enum  PropertyValueType { EvaluatedValue = 0, OriginalValue }
 Specifies whether the value returned by a function should be the original, user set value, or the current evaluated value for the property. More...
 

Public Slots

void overviewExtentChanged ()
 
virtual void refreshDataDefinedProperty (const QgsComposerObject::DataDefinedProperty property=QgsComposerObject::AllProperties, const QgsExpressionContext *context=nullptr) override
 
void renderModeUpdateCachedImage ()
 Updates the cached map image if the map is set to Render mode. More...
 
void updateBoundingRect ()
 Updates the bounding rect of this item. More...
 
void updateCachedImage ()
 Forces an update of the cached map image. More...
 
- Public Slots inherited from QgsComposerItem
virtual void refreshDataDefinedProperty (const QgsComposerObject::DataDefinedProperty property=QgsComposerObject::AllProperties, const QgsExpressionContext *context=nullptr) override
 Refreshes a data defined property for the item by reevaluating the property's value and redrawing the item with this new value. More...
 
void repaint () override
 
virtual void setItemRotation (const double r, const bool adjustPosition=false)
 Sets the item rotation. More...
 
- Public Slots inherited from QgsComposerObject
virtual void refreshDataDefinedProperty (const DataDefinedProperty property=AllProperties, const QgsExpressionContext *context=nullptr)
 Refreshes a data defined property for the item by reevaluating the property's value and redrawing the item with this new value. More...
 
virtual void repaint ()
 Triggers a redraw for the item. More...
 

Signals

void extentChanged ()
 
void layerStyleOverridesChanged ()
 Emitted when layer style overrides are changed... More...
 
void mapRotationChanged (double newRotation)
 Is emitted on rotation change to notify north arrow pictures. More...
 
void preparedForAtlas ()
 Is emitted when the map has been prepared for atlas rendering, just before actual rendering. More...
 
- Signals inherited from QgsComposerItem
void frameChanged ()
 Emitted if the item's frame style changes. More...
 
void itemRotationChanged (double newRotation)
 Is emitted on item rotation change. More...
 
void lockChanged ()
 Emitted if the item's lock status changes. More...
 
void sizeChanged ()
 Emitted if the rectangle changes. More...
 
- Signals inherited from QgsComposerObject
void itemChanged ()
 Emitted when the item changes. More...
 

Public Member Functions

 QgsComposerMap (QgsComposition *composition, int x, int y, int width, int height)
 Constructor. More...
 
 QgsComposerMap (QgsComposition *composition)
 Constructor. More...
 
virtual ~QgsComposerMap ()
 
Q_DECL_DEPRECATED QColor annotationFontColor () const
 Get font color for grid annotations. More...
 
Q_DECL_DEPRECATED double annotationFrameDistance () const
 
void assignFreeId ()
 Sets mId to a number not yet used in the composition. More...
 
bool atlasDriven () const
 Returns whether the map extent is set to follow the current atlas feature. More...
 
Q_DECL_DEPRECATED bool atlasFixedScale () const
 Returns true if the map uses a fixed scale when in atlas mode. More...
 
double atlasMargin (const QgsComposerObject::PropertyValueType valueType=QgsComposerObject::EvaluatedValue)
 Returns the margin size (percentage) used when the map is in atlas mode. More...
 
AtlasScalingMode atlasScalingMode () const
 Returns the current atlas scaling mode. More...
 
QRectF boundingRect () const override
 In case of annotations, the bounding rectangle can be larger than the map item rectangle. More...
 
void cache ()
 Create cache image. More...
 
Q_DECL_DEPRECATED void connectMapOverviewSignals ()
 
bool containsAdvancedEffects () const
 True if composer map contains layers with blend modes or flattened layers for vectors. More...
 
bool containsWMSLayer () const
 True if composer map renders a WMS layer. More...
 
Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect (double &x, double &y, double width, double height) const
 Calculates corner point after rotation and scaling. More...
 
virtual QgsExpressionContextcreateExpressionContext () const override
 Creates an expression context relating to the item's current state. More...
 
Q_DECL_DEPRECATED double crossLength ()
 
const QgsRectanglecurrentMapExtent () const
 Returns a pointer to the current map extent, which is either the original user specified extent or the temporary atlas-driven feature extent depending on the current atlas state of the composition. More...
 
QgsRectanglecurrentMapExtent ()
 
virtual QString displayName () const override
 Get item display name. More...
 
void draw (QPainter *painter, const QgsRectangle &extent, QSizeF size, double dpi, double *forceWidthScale=nullptr)
 Draw to paint device. More...
 
bool drawCanvasItems () const
 
bool drawSelection () const
 Get the flag to draw selection in map. More...
 
QgsRectangle extent () const
 
bool followVisibilityPreset () const
 Whether the map should follow a visibility preset. More...
 
QString followVisibilityPresetName () const
 Preset name that decides which layers and layer styles are used for map rendering. More...
 
QgsComposerMapGridgrid ()
 Returns the map item's first grid. More...
 
Q_DECL_DEPRECATED GridAnnotationDirection gridAnnotationDirection (QgsComposerMap::Border border) const
 
Q_DECL_DEPRECATED QFont gridAnnotationFont () const
 
Q_DECL_DEPRECATED GridAnnotationFormat gridAnnotationFormat () const
 
Q_DECL_DEPRECATED GridAnnotationPosition gridAnnotationPosition (QgsComposerMap::Border border) const
 
Q_DECL_DEPRECATED int gridAnnotationPrecision () const
 
Q_DECL_DEPRECATED QPainter::CompositionMode gridBlendMode () const
 Returns the grid's blending mode. More...
 
Q_DECL_DEPRECATED bool gridEnabled () const
 
Q_DECL_DEPRECATED QColor gridFrameFillColor1 () const
 Get first fill color for grid zebra frame. More...
 
Q_DECL_DEPRECATED QColor gridFrameFillColor2 () const
 Get second fill color for grid zebra frame. More...
 
Q_DECL_DEPRECATED QColor gridFramePenColor () const
 Get pen color for grid frame. More...
 
Q_DECL_DEPRECATED double gridFramePenSize () const
 
Q_DECL_DEPRECATED GridFrameStyle gridFrameStyle () const
 
Q_DECL_DEPRECATED double gridFrameWidth () const
 
Q_DECL_DEPRECATED double gridIntervalX () const
 
Q_DECL_DEPRECATED double gridIntervalY () const
 
Q_DECL_DEPRECATED QgsLineSymbolV2gridLineSymbol ()
 
Q_DECL_DEPRECATED double gridOffsetX () const
 
Q_DECL_DEPRECATED double gridOffsetY () const
 
Q_DECL_DEPRECATED QPen gridPen () const
 
QgsComposerMapGridStackgrids ()
 Returns the map item's grid stack, which is used to control how grids are drawn over the map's contents. More...
 
Q_DECL_DEPRECATED GridStyle gridStyle () const
 
int id () const
 Get identification number. More...
 
Q_DECL_DEPRECATED bool imageSizeConsideringRotation (double &width, double &height) const
 Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation. More...
 
bool isDrawing () const
 True if a draw is already in progress. More...
 
bool keepLayerSet () const
 Getter for flag that determines if the stored layer set should be used or the current layer set of the qgis mapcanvas. More...
 
bool keepLayerStyles () const
 Getter for flag that determines if current styles of layers should be overridden by previously stored styles. More...
 
QStringList layerSet () const
 Getter for stored layer set that is used if mKeepLayerSet is true. More...
 
QMap< QString, QStringlayerStyleOverrides () const
 Getter for stored overrides of styles for layers. More...
 
Q_DECL_DEPRECATED const QgsMapRenderermapRenderer () const
 
double mapRotation (QgsComposerObject::PropertyValueType valueType=QgsComposerObject::EvaluatedValue) const
 Returns the rotation used for drawing the map within the composer item. More...
 
QgsMapSettings mapSettings (const QgsRectangle &extent, QSizeF size, int dpi) const
 Return map settings that would be used for drawing of the map. More...
 
QPointF mapToItemCoords (QPointF mapCoords) const
 Transforms map coordinates to item coordinates (considering rotation and move offset) More...
 
double mapUnitsToMM () const
 Returns the conversion factor map units -> mm. More...
 
void moveContent (double dx, double dy) override
 Move content of map. More...
 
int numberExportLayers () const override
 Get the number of layers that this item requires for exporting as layers. More...
 
QgsComposerMapOverviewoverview ()
 Returns the map item's first overview. More...
 
Q_DECL_DEPRECATED QPainter::CompositionMode overviewBlendMode () const
 Returns the overview's blending mode. More...
 
Q_DECL_DEPRECATED bool overviewCentered () const
 Returns true if the extent is forced to center on the overview. More...
 
Q_DECL_DEPRECATED int overviewFrameMapId () const
 Returns id of overview frame (or -1 if no overfiew frame) More...
 
Q_DECL_DEPRECATED QgsFillSymbolV2overviewFrameMapSymbol ()
 
Q_DECL_DEPRECATED bool overviewInverted () const
 Returns true if the overview frame is inverted. More...
 
QgsComposerMapOverviewStackoverviews ()
 Returns the map item's overview stack, which is used to control how overviews are drawn over the map's contents. More...
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget) override
 Reimplementation of QCanvasItem::paint - draw on canvas. More...
 
PreviewMode previewMode () const
 
bool readXML (const QDomElement &itemElem, const QDomDocument &doc) override
 Sets state from Dom document. More...
 
void requestedExtent (QgsRectangle &extent) const
 Calculates the extent to request and the yShift of the top-left point in case of rotation. More...
 
void resize (double dx, double dy)
 Resizes an item in x- and y direction (canvas coordinates) More...
 
Q_DECL_DEPRECATED double rotation () const
 Returns the rotation used for drawing the map within the composer item. More...
 
double scale () const
 Scale. More...
 
Q_DECL_DEPRECATED void setAnnotationFontColor (const QColor &c)
 Sets font color for grid annotations. More...
 
Q_DECL_DEPRECATED void setAnnotationFrameDistance (double d)
 Sets distance between map frame and annotations. More...
 
void setAtlasDriven (bool enabled)
 Sets whether the map extent will follow the current atlas feature. More...
 
Q_DECL_DEPRECATED void setAtlasFixedScale (bool fixed)
 Set to true if the map should use a fixed scale when in atlas mode. More...
 
void setAtlasMargin (double margin)
 Sets the margin size (percentage) used when the map is in atlas mode. More...
 
void setAtlasScalingMode (AtlasScalingMode mode)
 Sets the current atlas scaling mode. More...
 
void setCacheUpdated (bool u=false)
 
Q_DECL_DEPRECATED void setCrossLength (double l)
 Sets length of the cross segments (if grid style is cross) More...
 
void setDrawCanvasItems (bool b)
 
void setDrawSelection (bool b)
 Set the flag to draw selection in map. More...
 
void setFollowVisibilityPreset (bool follow)
 Sets whether the map should follow a visibility preset. More...
 
void setFollowVisibilityPresetName (const QString &name)
 Sets preset name for map rendering. More...
 
virtual void setFrameOutlineWidth (const double outlineWidth) override
 Sets frame outline width. More...
 
Q_DECL_DEPRECATED void setGridAnnotationDirection (GridAnnotationDirection d, QgsComposerMap::Border border)
 
Q_DECL_DEPRECATED void setGridAnnotationFont (const QFont &f)
 Sets font for grid annotations. More...
 
Q_DECL_DEPRECATED void setGridAnnotationFormat (GridAnnotationFormat f)
 
Q_DECL_DEPRECATED void setGridAnnotationPosition (GridAnnotationPosition p, QgsComposerMap::Border border)
 
Q_DECL_DEPRECATED void setGridAnnotationPrecision (int p)
 Sets coordinate precision for grid annotations. More...
 
Q_DECL_DEPRECATED void setGridBlendMode (QPainter::CompositionMode blendMode)
 Sets the grid's blending mode. More...
 
Q_DECL_DEPRECATED void setGridEnabled (bool enabled)
 Enables a coordinate grid that is shown on top of this composermap. More...
 
Q_DECL_DEPRECATED void setGridFrameFillColor1 (const QColor &c)
 Sets first fill color for grid zebra frame. More...
 
Q_DECL_DEPRECATED void setGridFrameFillColor2 (const QColor &c)
 Sets second fill color for grid zebra frame. More...
 
Q_DECL_DEPRECATED void setGridFramePenColor (const QColor &c)
 Sets pen color for grid frame. More...
 
Q_DECL_DEPRECATED void setGridFramePenSize (double w)
 Set grid frame pen thickness. More...
 
Q_DECL_DEPRECATED void setGridFrameStyle (GridFrameStyle style)
 Set grid frame style (NoGridFrame or Zebra) More...
 
Q_DECL_DEPRECATED void setGridFrameWidth (double w)
 Set grid frame width. More...
 
Q_DECL_DEPRECATED void setGridIntervalX (double interval)
 Sets coordinate interval in x-direction for composergrid. More...
 
Q_DECL_DEPRECATED void setGridIntervalY (double interval)
 Sets coordinate interval in y-direction for composergrid. More...
 
Q_DECL_DEPRECATED void setGridLineSymbol (QgsLineSymbolV2 *symbol)
 
Q_DECL_DEPRECATED void setGridOffsetX (double offset)
 Sets x-coordinate offset for composer grid. More...
 
Q_DECL_DEPRECATED void setGridOffsetY (double offset)
 Sets y-coordinate offset for composer grid. More...
 
Q_DECL_DEPRECATED void setGridPen (const QPen &p)
 Sets the pen to draw composer grid. More...
 
Q_DECL_DEPRECATED void setGridPenColor (const QColor &c)
 Sets the color of the grid pen. More...
 
Q_DECL_DEPRECATED void setGridPenWidth (double w)
 Sets width of grid pen. More...
 
Q_DECL_DEPRECATED void setGridStyle (GridStyle style)
 Sets coordinate grid style to solid or cross. More...
 
void setKeepLayerSet (bool enabled)
 Setter for flag that determines if the stored layer set should be used or the current layer set of the qgis mapcanvas. More...
 
void setKeepLayerStyles (bool enabled)
 Setter for flag that determines if current styles of layers should be overridden by previously stored styles. More...
 
void setLayerSet (const QStringList &layerSet)
 Setter for stored layer set that is used if mKeepLayerSet is true. More...
 
void setLayerStyleOverrides (const QMap< QString, QString > &overrides)
 Setter for stored overrides of styles for layers. More...
 
void setMapCanvas (QGraphicsView *canvas)
 Sets canvas pointer (necessary to query and draw map canvas items) More...
 
void setMapRotation (double r)
 Sets rotation for the map - this does not affect the composer item shape, only the way the map is drawn within the item. More...
 
void setNewAtlasFeatureExtent (const QgsRectangle &extent)
 Sets new Extent for the current atlas preview and changes width, height (and implicitely also scale). More...
 
void setNewExtent (const QgsRectangle &extent)
 Sets new extent for the map. More...
 
void setNewScale (double scaleDenominator, bool forceUpdate=true)
 Sets new scale and changes only mExtent. More...
 
void setOffset (double xOffset, double yOffset)
 Sets offset values to shift image (useful for live updates when moving item content) More...
 
Q_DECL_DEPRECATED void setOverviewBlendMode (QPainter::CompositionMode blendMode)
 Sets the overview's blending mode. More...
 
Q_DECL_DEPRECATED void setOverviewCentered (bool centered)
 Set the overview's centering mode. More...
 
Q_DECL_DEPRECATED void setOverviewFrameMap (int mapId)
 Sets overview frame map. More...
 
Q_DECL_DEPRECATED void setOverviewFrameMapSymbol (QgsFillSymbolV2 *symbol)
 
Q_DECL_DEPRECATED void setOverviewInverted (bool inverted)
 Sets the overview's inversion mode. More...
 
void setPreviewMode (PreviewMode m)
 
Q_DECL_DEPRECATED void setRotation (double r) override
 Sets rotation for the map - this does not affect the composer item shape, only the way the map is drawn within the item. More...
 
void setSceneRect (const QRectF &rectangle) override
 Sets new scene rectangle bounds and recalculates hight and extent. More...
 
Q_DECL_DEPRECATED void setShowGridAnnotation (bool show)
 Sets flag if grid annotation should be shown. More...
 
void setUpdatesEnabled (bool enabled)
 Sets whether updates to the composer map are enabled. More...
 
Q_DECL_DEPRECATED bool showGridAnnotation () const
 
Q_DECL_DEPRECATED void sizeChangedByRotation (double &width, double &height)
 Calculates width / height of the bounding box of a rotated rectangle. More...
 
void storeCurrentLayerSet ()
 Stores the current layer set of the qgis mapcanvas in mLayerSet. More...
 
void storeCurrentLayerStyles ()
 Stores the current layer styles into style overrides. More...
 
Q_DECL_DEPRECATED void toggleAtlasPreview ()
 Called when atlas preview is toggled, to force map item to update its extent and redraw. More...
 
QPolygonF transformedMapPolygon () const
 Returns extent that considers rotation and shift with mOffsetX / mOffsetY. More...
 
virtual int type () const override
 Return correct graphics item type. More...
 
void updateItem () override
 Updates item, with the possibility to do custom update for subclasses. More...
 
bool updatesEnabled () const
 Returns whether updates to the composer map are enabled. More...
 
QPolygonF visibleExtentPolygon () const
 Returns a polygon representing the current visible map extent, considering map extents and rotation. More...
 
bool writeXML (QDomElement &elem, QDomDocument &doc) const override
 Stores state in Dom node. More...
 
Q_DECL_DEPRECATED void zoomContent (int delta, double x, double y) override
 Zoom content of map. More...
 
virtual void zoomContent (const double factor, const QPointF point, const ZoomMode mode=QgsComposerItem::Zoom) override
 Zoom content of item. More...
 
void zoomToExtent (const QgsRectangle &extent)
 Zooms the map so that the specified extent is fully visible within the map item. More...
 
- Public Member Functions inherited from QgsComposerItem
 QgsComposerItem (QgsComposition *composition, bool manageZValue=true)
 Constructor. More...
 
 QgsComposerItem (qreal x, qreal y, qreal width, qreal height, QgsComposition *composition, bool manageZValue=true)
 Constructor with box position and composer object. More...
 
virtual ~QgsComposerItem ()
 
bool _readXML (const QDomElement &itemElem, const QDomDocument &doc)
 Reads parameter that are not subclass specific in document. More...
 
bool _writeXML (QDomElement &itemElem, QDomDocument &doc) const
 Writes parameter that are not subclass specific in document. More...
 
virtual void addItem (QgsComposerItem *item)
 Composite operations for item groups do nothing per default. More...
 
QColor backgroundColor () const
 Gets the background color for this item. More...
 
void beginCommand (const QString &commandText, QgsComposerMergeCommand::Context c=QgsComposerMergeCommand::Unknown)
 Starts new composer undo command. More...
 
virtual void beginItemCommand (const QString &text)
 
QPainter::CompositionMode blendMode () const
 Returns the item's composition blending mode. More...
 
void cancelCommand ()
 
Q_DECL_DEPRECATED void drawText (QPainter *p, double x, double y, const QString &text, const QFont &font, const QColor &c=QColor()) const
 Draws Text. More...
 
Q_DECL_DEPRECATED void drawText (QPainter *p, const QRectF &rect, const QString &text, const QFont &font, Qt::AlignmentFlag halignment=Qt::AlignLeft, Qt::AlignmentFlag valignment=Qt::AlignTop, int flags=Qt::TextWordWrap) const
 Like the above, but with a rectangle for multiline text. More...
 
bool effectsEnabled () const
 Returns whether effects (eg blend modes) are enabled for the item. More...
 
void endCommand ()
 Finish current command and push it onto the undo stack. More...
 
virtual void endItemCommand ()
 
virtual double estimatedFrameBleed () const
 Returns the estimated amount the item's frame bleeds outside the item's actual rectangle. More...
 
bool excludeFromExports (const QgsComposerObject::PropertyValueType valueType=QgsComposerObject::EvaluatedValue)
 Returns whether the item should be excluded from composer exports and prints. More...
 
Q_DECL_DEPRECATED double fontAscentMillimeters (const QFont &font) const
 Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE. More...
 
Q_DECL_DEPRECATED double fontDescentMillimeters (const QFont &font) const
 Returns the font descent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE. More...
 
Q_DECL_DEPRECATED double fontHeightCharacterMM (const QFont &font, QChar c) const
 Returns the font height of a character in millimeters. More...
 
Q_DECL_DEPRECATED double fontHeightMillimeters (const QFont &font) const
 Returns the font height in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE. More...
 
Qt::PenJoinStyle frameJoinStyle () const
 Returns the join style used for drawing the item's frame. More...
 
QColor frameOutlineColor () const
 Returns the frame's outline color. More...
 
double frameOutlineWidth () const
 Returns the frame's outline width. More...
 
bool hasBackground () const
 Whether this item has a Background or not. More...
 
bool hasFrame () const
 Whether this item has a frame or not. More...
 
QString id () const
 Get item's id (which is not necessarly unique) More...
 
bool isGroupMember () const
 Returns whether this item is part of a group. More...
 
virtual bool isRemoved () const
 Returns whether this item has been removed from the composition. More...
 
double itemRotation (const QgsComposerObject::PropertyValueType valueType=QgsComposerObject::EvaluatedValue) const
 Returns the current rotation for the composer item. More...
 
ItemPositionMode lastUsedPositionMode ()
 Returns item's last used position mode. More...
 
void move (double dx, double dy)
 Moves item in canvas coordinates. More...
 
int page () const
 Gets the page the item is currently on. More...
 
QPointF pagePos () const
 Returns the item's position relative to its current page. More...
 
Q_DECL_DEPRECATED double pixelFontSize (double pointSize) const
 Calculates font size in mm from a font point size. More...
 
bool positionLock () const
 Returns whether position lock for mouse drags is enabled returns true if item is locked for mouse movement and resizing. More...
 
virtual QRectF rectWithFrame () const
 Returns the item's rectangular bounds, including any bleed caused by the item's frame. More...
 
virtual void removeItems ()
 
Q_DECL_DEPRECATED double rotation () const
 Returns the rotation for the composer item. More...
 
Q_DECL_DEPRECATED QFont scaledFontPixelSize (const QFont &font) const
 Returns a font where size is in pixel and font size is upscaled with FONT_WORKAROUND_SCALE. More...
 
virtual bool selected () const
 Is selected. More...
 
void setBackgroundColor (const QColor &backgroundColor)
 Sets the background color for this item. More...
 
void setBackgroundEnabled (const bool drawBackground)
 Set whether this item has a Background drawn around it or not. More...
 
void setBlendMode (const QPainter::CompositionMode blendMode)
 Sets the item's composition blending mode. More...
 
virtual void setCurrentExportLayer (const int layerIdx=-1)
 Sets the current layer to draw for exporting. More...
 
void setEffectsEnabled (const bool effectsEnabled)
 Sets whether effects (eg blend modes) are enabled for the item. More...
 
virtual void setExcludeFromExports (const bool exclude)
 Sets whether the item should be excluded from composer exports and prints. More...
 
virtual void setFrameEnabled (const bool drawFrame)
 Set whether this item has a frame drawn around it or not. More...
 
void setFrameJoinStyle (const Qt::PenJoinStyle style)
 Sets join style used when drawing the item's frame. More...
 
virtual void setFrameOutlineColor (const QColor &color)
 Sets frame outline color. More...
 
virtual void setId (const QString &id)
 Set item's id (which is not necessarly unique) More...
 
void setIsGroupMember (const bool isGroupMember)
 Sets whether this item is part of a group. More...
 
void setIsRemoved (const bool removed)
 Sets whether this item has been removed from the composition. More...
 
void setItemPosition (double x, double y, ItemPositionMode itemPoint=UpperLeft, int page=-1)
 Moves the item to a new position (in canvas coordinates) More...
 
void setItemPosition (double x, double y, double width, double height, ItemPositionMode itemPoint=UpperLeft, bool posIncludesFrame=false, int page=-1)
 Sets item position and width / height in one go. More...
 
void setPositionLock (const bool lock)
 Locks / unlocks the item position for mouse drags. More...
 
virtual void setSelected (bool s)
 Set selected, selected item should be highlighted. More...
 
void setTransparency (const int transparency)
 Sets the item's transparency. More...
 
virtual void setVisibility (const bool visible)
 Sets visibility for item. More...
 
Q_DECL_DEPRECATED double textWidthMillimeters (const QFont &font, const QString &text) const
 Returns the font width in millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE. More...
 
int transparency () const
 Returns the item's transparency. More...
 
void updatePagePos (double newPageWidth, double newPageHeight)
 Moves the item so that it retains its relative position on the page when the paper size changes. More...
 
QString uuid () const
 Get item identification name. More...
 
- Public Member Functions inherited from QgsComposerObject
 QgsComposerObject (QgsComposition *composition)
 Constructor. More...
 
virtual ~QgsComposerObject ()
 
const QgsCompositioncomposition () const
 Returns the composition the item is attached to. More...
 
QgsCompositioncomposition ()
 
QStringList customProperties () const
 Return list of keys stored in custom properties for the object. More...
 
QVariant customProperty (const QString &key, const QVariant &defaultValue=QVariant()) const
 Read a custom property from the object. More...
 
QgsDataDefineddataDefinedProperty (const DataDefinedProperty property) const
 Returns a reference to the data defined settings for one of the item's data defined properties. More...
 
void removeCustomProperty (const QString &key)
 Remove a custom property from the object. More...
 
void setCustomProperty (const QString &key, const QVariant &value)
 Set a custom property for the object. More...
 
void setDataDefinedProperty (const DataDefinedProperty property, const bool active, const bool useExpression, const QString &expression, const QString &field)
 Sets parameters for a data defined property for the item. More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 
- Public Member Functions inherited from QGraphicsRectItem
 QGraphicsRectItem (QGraphicsItem *parent)
 
 QGraphicsRectItem (const QRectF &rect, QGraphicsItem *parent)
 
 QGraphicsRectItem (qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent)
 
 ~QGraphicsRectItem ()
 
virtual bool contains (const QPointF &point) const
 
virtual bool isObscuredBy (const QGraphicsItem *item) const
 
virtual QPainterPath opaqueArea () const
 
QRectF rect () const
 
void setRect (const QRectF &rectangle)
 
void setRect (qreal x, qreal y, qreal width, qreal height)
 
virtual QPainterPath shape () const
 
- Public Member Functions inherited from QAbstractGraphicsShapeItem
 QAbstractGraphicsShapeItem (QGraphicsItem *parent)
 
 ~QAbstractGraphicsShapeItem ()
 
QBrush brush () const
 
QPen pen () const
 
void setBrush (const QBrush &brush)
 
void setPen (const QPen &pen)
 
- Public Member Functions inherited from QGraphicsItem
 QGraphicsItem (QGraphicsItem *parent)
 
virtual ~QGraphicsItem ()
 
bool acceptDrops () const
 
Qt::MouseButtons acceptedMouseButtons () const
 
bool acceptHoverEvents () const
 
bool acceptsHoverEvents () const
 
bool acceptTouchEvents () const
 
virtual void advance (int phase)
 
virtual QRectF boundingRect () const=0
 
QRegion boundingRegion (const QTransform &itemToDeviceTransform) const
 
qreal boundingRegionGranularity () const
 
CacheMode cacheMode () const
 
QList< QGraphicsItem * > childItems () const
 
QList< QGraphicsItem * > children () const
 
QRectF childrenBoundingRect () const
 
void clearFocus ()
 
QPainterPath clipPath () const
 
virtual bool collidesWithItem (const QGraphicsItem *other, Qt::ItemSelectionMode mode) const
 
virtual bool collidesWithPath (const QPainterPath &path, Qt::ItemSelectionMode mode) const
 
QList< QGraphicsItem * > collidingItems (Qt::ItemSelectionMode mode) const
 
QGraphicsItemcommonAncestorItem (const QGraphicsItem *other) const
 
QCursor cursor () const
 
QVariant data (int key) const
 
QTransform deviceTransform (const QTransform &viewportTransform) const
 
qreal effectiveOpacity () const
 
void ensureVisible (const QRectF &rect, int xmargin, int ymargin)
 
void ensureVisible (qreal x, qreal y, qreal w, qreal h, int xmargin, int ymargin)
 
bool filtersChildEvents () const
 
GraphicsItemFlags flags () const
 
QGraphicsItemfocusItem () const
 
QGraphicsItemfocusProxy () const
 
void grabKeyboard ()
 
void grabMouse ()
 
QGraphicsEffectgraphicsEffect () const
 
QGraphicsItemGroupgroup () const
 
bool handlesChildEvents () const
 
bool hasCursor () const
 
bool hasFocus () const
 
void hide ()
 
Qt::InputMethodHints inputMethodHints () const
 
void installSceneEventFilter (QGraphicsItem *filterItem)
 
bool isActive () const
 
bool isAncestorOf (const QGraphicsItem *child) const
 
bool isBlockedByModalPanel (QGraphicsItem **blockingPanel) const
 
bool isClipped () const
 
bool isEnabled () const
 
bool isObscured () const
 
bool isObscured (const QRectF &rect) const
 
bool isObscured (qreal x, qreal y, qreal w, qreal h) const
 
bool isPanel () const
 
bool isSelected () const
 
bool isUnderMouse () const
 
bool isVisible () const
 
bool isVisibleTo (const QGraphicsItem *parent) const
 
bool isWidget () const
 
bool isWindow () const
 
QTransform itemTransform (const QGraphicsItem *other, bool *ok) const
 
QPointF mapFromItem (const QGraphicsItem *item, const QPointF &point) const
 
QPolygonF mapFromItem (const QGraphicsItem *item, const QRectF &rect) const
 
QPolygonF mapFromItem (const QGraphicsItem *item, const QPolygonF &polygon) const
 
QPainterPath mapFromItem (const QGraphicsItem *item, const QPainterPath &path) const
 
QPointF mapFromItem (const QGraphicsItem *item, qreal x, qreal y) const
 
QPolygonF mapFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QPointF mapFromParent (const QPointF &point) const
 
QPolygonF mapFromParent (const QRectF &rect) const
 
QPolygonF mapFromParent (const QPolygonF &polygon) const
 
QPainterPath mapFromParent (const QPainterPath &path) const
 
QPointF mapFromParent (qreal x, qreal y) const
 
QPolygonF mapFromParent (qreal x, qreal y, qreal w, qreal h) const
 
QPolygonF mapFromScene (const QPolygonF &polygon) const
 
QPointF mapFromScene (const QPointF &point) const
 
QPolygonF mapFromScene (const QRectF &rect) const
 
QPainterPath mapFromScene (const QPainterPath &path) const
 
QPointF mapFromScene (qreal x, qreal y) const
 
QPolygonF mapFromScene (qreal x, qreal y, qreal w, qreal h) const
 
QRectF mapRectFromItem (const QGraphicsItem *item, const QRectF &rect) const
 
QRectF mapRectFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QRectF mapRectFromParent (const QRectF &rect) const
 
QRectF mapRectFromParent (qreal x, qreal y, qreal w, qreal h) const
 
QRectF mapRectFromScene (qreal x, qreal y, qreal w, qreal h) const
 
QRectF mapRectFromScene (const QRectF &rect) const
 
QRectF mapRectToItem (const QGraphicsItem *item, const QRectF &rect) const
 
QRectF mapRectToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QRectF mapRectToParent (const QRectF &rect) const
 
QRectF mapRectToParent (qreal x, qreal y, qreal w, qreal h) const
 
QRectF mapRectToScene (const QRectF &rect) const
 
QRectF mapRectToScene (qreal x, qreal y, qreal w, qreal h) const
 
QPointF mapToItem (const QGraphicsItem *item, const QPointF &point) const
 
QPolygonF mapToItem (const QGraphicsItem *item, const QRectF &rect) const
 
QPolygonF mapToItem (const QGraphicsItem *item, const QPolygonF &polygon) const
 
QPainterPath mapToItem (const QGraphicsItem *item, const QPainterPath &path) const
 
QPointF mapToItem (const QGraphicsItem *item, qreal x, qreal y) const
 
QPolygonF mapToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QPointF mapToParent (const QPointF &point) const
 
QPolygonF mapToParent (const QRectF &rect) const
 
QPainterPath mapToParent (const QPainterPath &path) const
 
QPointF mapToParent (qreal x, qreal y) const
 
QPolygonF mapToParent (qreal x, qreal y, qreal w, qreal h) const
 
QPolygonF mapToParent (const QPolygonF &polygon) const
 
QPolygonF mapToScene (const QRectF &rect) const
 
QPainterPath mapToScene (const QPainterPath &path) const
 
QPointF mapToScene (qreal x, qreal y) const
 
QPolygonF mapToScene (qreal x, qreal y, qreal w, qreal h) const
 
QPolygonF mapToScene (const QPolygonF &polygon) const
 
QPointF mapToScene (const QPointF &point) const
 
QMatrix matrix () const
 
void moveBy (qreal dx, qreal dy)
 
qreal opacity () const
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)=0
 
QGraphicsItempanel () const
 
PanelModality panelModality () const
 
QGraphicsItemparentItem () const
 
QGraphicsObjectparentObject () const
 
QGraphicsWidgetparentWidget () const
 
QPointF pos () const
 
void removeSceneEventFilter (QGraphicsItem *filterItem)
 
void resetMatrix ()
 
void resetTransform ()
 
void rotate (qreal angle)
 
qreal rotation () const
 
void scale (qreal sx, qreal sy)
 
qreal scale () const
 
QGraphicsScenescene () const
 
QRectF sceneBoundingRect () const
 
QMatrix sceneMatrix () const
 
QPointF scenePos () const
 
QTransform sceneTransform () const
 
void scroll (qreal dx, qreal dy, const QRectF &rect)
 
void setAcceptDrops (bool on)
 
void setAcceptedMouseButtons (QFlags< Qt::MouseButton > buttons)
 
void setAcceptHoverEvents (bool enabled)
 
void setAcceptsHoverEvents (bool enabled)
 
void setAcceptTouchEvents (bool enabled)
 
void setActive (bool active)
 
void setBoundingRegionGranularity (qreal granularity)
 
void setCacheMode (CacheMode mode, const QSize &logicalCacheSize)
 
void setCursor (const QCursor &cursor)
 
void setData (int key, const QVariant &value)
 
void setEnabled (bool enabled)
 
void setFiltersChildEvents (bool enabled)
 
void setFlag (GraphicsItemFlag flag, bool enabled)
 
void setFlags (QFlags< QGraphicsItem::GraphicsItemFlag > flags)
 
void setFocus (Qt::FocusReason focusReason)
 
void setFocusProxy (QGraphicsItem *item)
 
void setGraphicsEffect (QGraphicsEffect *effect)
 
void setGroup (QGraphicsItemGroup *group)
 
void setHandlesChildEvents (bool enabled)
 
void setInputMethodHints (QFlags< Qt::InputMethodHint > hints)
 
void setMatrix (const QMatrix &matrix, bool combine)
 
void setOpacity (qreal opacity)
 
void setPanelModality (PanelModality panelModality)
 
void setParentItem (QGraphicsItem *newParent)
 
void setPos (const QPointF &pos)
 
void setPos (qreal x, qreal y)
 
void setRotation (qreal angle)
 
void setScale (qreal factor)
 
void setSelected (bool selected)
 
void setToolTip (const QString &toolTip)
 
void setTransform (const QTransform &matrix, bool combine)
 
void setTransformations (const QList< QGraphicsTransform * > &transformations)
 
void setTransformOriginPoint (qreal x, qreal y)
 
void setTransformOriginPoint (const QPointF &origin)
 
void setVisible (bool visible)
 
void setX (qreal x)
 
void setY (qreal y)
 
void setZValue (qreal z)
 
void shear (qreal sh, qreal sv)
 
void show ()
 
void stackBefore (const QGraphicsItem *sibling)
 
QGraphicsObjecttoGraphicsObject ()
 
const QGraphicsObjecttoGraphicsObject () const
 
QString toolTip () const
 
QGraphicsItemtopLevelItem () const
 
QGraphicsWidgettopLevelWidget () const
 
QTransform transform () const
 
QList< QGraphicsTransform * > transformations () const
 
QPointF transformOriginPoint () const
 
void translate (qreal dx, qreal dy)
 
void ungrabKeyboard ()
 
void ungrabMouse ()
 
void unsetCursor ()
 
void update (qreal x, qreal y, qreal width, qreal height)
 
void update (const QRectF &rect)
 
QGraphicsWidgetwindow () const
 
qreal x () const
 
qreal y () const
 
qreal zValue () const
 

Protected Slots

void layersChanged ()
 Called when layers are added or removed from the layer registry. More...
 

Friends

class QgsComposerMapOverview
 
class TestQgsComposerMap
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QGraphicsItem
typedef GraphicsItemFlags
 
- Protected Member Functions inherited from QgsComposerItem
Q_DECL_DEPRECATED double angle (QPointF p1, QPointF p2) const
 Returns angle of the line from p1 to p2 (clockwise, starting at N) More...
 
Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect (double &x, double &y, double width, double height, double rotation) const
 Calculates corner point after rotation and scaling. More...
 
Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect (double &x, double &y, double width, double height) const
 Calculates corner point after rotation and scaling. More...
 
void deleteAlignItems ()
 
void deleteHAlignSnapItem ()
 
void deleteVAlignSnapItem ()
 
Q_DECL_DEPRECATED void drawArrowHead (QPainter *p, double x, double y, double angle, double arrowHeadWidth) const
 Draws arrowhead. More...
 
virtual void drawBackground (QPainter *p)
 Draw background. More...
 
virtual void drawFrame (QPainter *p)
 Draw black frame around item. More...
 
virtual void drawSelectionBoxes (QPainter *p)
 Draws additional graphics on selected items. More...
 
QRectF evalItemRect (const QRectF &newRect, const bool resizeOnly=false, const QgsExpressionContext *context=nullptr)
 Evaluates an item's bounding rect to consider data defined position and size of item and reference point. More...
 
QGraphicsLineItemhAlignSnapItem ()
 Return horizontal align snap item. More...
 
double horizontalViewScaleFactor () const
 Returns the zoom factor of the graphics view. More...
 
Q_DECL_DEPRECATED bool imageSizeConsideringRotation (double &width, double &height, double rotation) const
 Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation. More...
 
Q_DECL_DEPRECATED bool imageSizeConsideringRotation (double &width, double &height) const
 Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation. More...
 
Q_DECL_DEPRECATED QRectF largestRotatedRectWithinBounds (const QRectF &originalRect, const QRectF &boundsRect, double rotation) const
 Calculates the largest scaled version of originalRect which fits within boundsRect, when it is rotated by a specified amount. More...
 
Q_DECL_DEPRECATED double lockSymbolSize () const
 Returns the size of the lock symbol depending on the composer zoom level and the item size. More...
 
double rectHandlerBorderTolerance () const
 Returns the current (zoom level dependent) tolerance to decide if mouse position is close enough to the item border for resizing. More...
 
Q_DECL_DEPRECATED void rotate (double angle, double &x, double &y) const
 Rotates a point / vector. More...
 
bool shouldDrawItem () const
 Returns whether the item should be drawn in the current context. More...
 
Q_DECL_DEPRECATED void sizeChangedByRotation (double &width, double &height, double rotation)
 Calculates width / height of the bounding box of a rotated rectangle. More...
 
Q_DECL_DEPRECATED void sizeChangedByRotation (double &width, double &height)
 Calculates width / height of the bounding box of a rotated rectangle. More...
 
QGraphicsLineItemvAlignSnapItem ()
 Return vertical align snap item. More...
 
- Protected Member Functions inherited from QgsComposerObject
bool dataDefinedEvaluate (const QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue, const QgsExpressionContext &context=QgsExpressionContext()) const
 Evaluate a data defined property and return the calculated value. More...
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Protected Member Functions inherited from QGraphicsItem
virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
 
virtual void dragEnterEvent (QGraphicsSceneDragDropEvent *event)
 
virtual void dragLeaveEvent (QGraphicsSceneDragDropEvent *event)
 
virtual void dragMoveEvent (QGraphicsSceneDragDropEvent *event)
 
virtual void dropEvent (QGraphicsSceneDragDropEvent *event)
 
virtual void focusInEvent (QFocusEvent *event)
 
virtual void focusOutEvent (QFocusEvent *event)
 
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
 
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
 
virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event)
 
virtual void inputMethodEvent (QInputMethodEvent *event)
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const
 
virtual QVariant itemChange (GraphicsItemChange change, const QVariant &value)
 
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
virtual void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event)
 
virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
 
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
 
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 
void prepareGeometryChange ()
 
virtual bool sceneEvent (QEvent *event)
 
virtual bool sceneEventFilter (QGraphicsItem *watched, QEvent *event)
 
void updateMicroFocus ()
 
virtual void wheelEvent (QGraphicsSceneWheelEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Protected Attributes inherited from QgsComposerItem
bool mBackground
 True if item background needs to be painted. More...
 
QColor mBackgroundColor
 Background color. More...
 
QPainter::CompositionMode mBlendMode
 Composition blend mode for item. More...
 
QGraphicsRectItemmBoundingResizeRectangle
 Rectangle used during move and resize actions. More...
 
int mCurrentExportLayer
 The layer that needs to be exported. More...
 
QgsComposerItem::MouseMoveAction mCurrentMouseMoveAction
 
QgsComposerEffectmEffect
 
bool mEffectsEnabled
 
bool mEvaluatedExcludeFromExports
 Temporary evaluated item exclusion. More...
 
double mEvaluatedItemRotation
 Temporary evaluated item rotation in degrees, clockwise. More...
 
bool mExcludeFromExports
 Whether item should be excluded in exports. More...
 
bool mFrame
 True if item fram needs to be painted. More...
 
Qt::PenJoinStyle mFrameJoinStyle
 Frame join style. More...
 
QGraphicsLineItemmHAlignSnapItem
 
bool mIsGroupMember
 Whether or not this item is part of a group. More...
 
bool mItemPositionLocked
 True if item position and size cannot be changed with mouse move. More...
 
double mItemRotation
 Item rotation in degrees, clockwise. More...
 
QPointF mLastMouseEventPos
 Position of the last mouse move event (in scene coordinates) More...
 
ItemPositionMode mLastUsedPositionMode
 The item's position mode. More...
 
double mLastValidViewScaleFactor
 Backup to restore item appearance if no view scale factor is available. More...
 
QPointF mMouseMoveStartPos
 Start point of the last mouse move action (in scene coordinates) More...
 
bool mRemovedFromComposition
 True if item has been removed from the composition. More...
 
int mTransparency
 Item transparency. More...
 
QGraphicsLineItemmVAlignSnapItem
 
- Protected Attributes inherited from QgsComposerObject
QgsCompositionmComposition
 
QgsObjectCustomProperties mCustomProperties
 Custom properties for object. More...
 
QMap< QgsComposerObject::DataDefinedProperty, QStringmDataDefinedNames
 Map of data defined properties for the item to string name to use when exporting item to xml. More...
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Object representing map window.

Definition at line 48 of file qgscomposermap.h.

Member Enumeration Documentation

◆ AtlasScalingMode

Scaling modes used for the serial rendering (atlas)

Enumerator
Fixed 

The current scale of the map is used for each feature of the atlas

Predefined 

A scale is chosen from the predefined scales. The smallest scale from the list of scales where the atlas feature is fully visible is chosen.

See also
QgsAtlasComposition::setPredefinedScales.
Note
This mode is only valid for polygon or line atlas coverage layers
Auto 

The extent is adjusted so that each feature is fully visible. A margin is applied around the center

See also
setAtlasMargin
Note
This mode is only valid for polygon or line atlas coverage layers

Definition at line 128 of file qgscomposermap.h.

◆ Border

Enum for different frame borders.

Enumerator
Left 
Right 
Bottom 
Top 

Definition at line 118 of file qgscomposermap.h.

◆ GridAnnotationDirection

Enumerator
Horizontal 
Vertical 
HorizontalAndVertical 
BoundaryDirection 

Definition at line 87 of file qgscomposermap.h.

◆ GridAnnotationFormat

Enumerator
Decimal 
DegreeMinute 
DegreeMinuteSecond 
DecimalWithSuffix 
DegreeMinuteNoSuffix 
DegreeMinutePadded 
DegreeMinuteSecondNoSuffix 
DegreeMinuteSecondPadded 

Definition at line 95 of file qgscomposermap.h.

◆ GridAnnotationPosition

Enumerator
InsideMapFrame 
OutsideMapFrame 
Disabled 

Definition at line 80 of file qgscomposermap.h.

◆ GridFrameStyle

Enumerator
NoGridFrame 
Zebra 
InteriorTicks 
ExteriorTicks 
InteriorExteriorTicks 
LineBorder 

Definition at line 107 of file qgscomposermap.h.

◆ GridStyle

Enumerator
Solid 
Cross 
Markers 
FrameAnnotationsOnly 

Definition at line 72 of file qgscomposermap.h.

◆ PreviewMode

Preview style.

Enumerator
Cache 
Render 
Rectangle 

Definition at line 63 of file qgscomposermap.h.

Constructor & Destructor Documentation

◆ QgsComposerMap() [1/2]

QgsComposerMap::QgsComposerMap ( QgsComposition composition,
int  x,
int  y,
int  width,
int  height 
)

Constructor.

Definition at line 50 of file qgscomposermap.cpp.

◆ QgsComposerMap() [2/2]

QgsComposerMap::QgsComposerMap ( QgsComposition composition)

Constructor.

Settings are read from project.

Definition at line 97 of file qgscomposermap.cpp.

◆ ~QgsComposerMap()

QgsComposerMap::~QgsComposerMap ( )
virtual

Definition at line 172 of file qgscomposermap.cpp.

Member Function Documentation

◆ annotationFontColor()

QColor QgsComposerMap::annotationFontColor ( ) const

Get font color for grid annotations.

Deprecated:
use grid()->annotationFontColor() or grids() instead

Definition at line 1844 of file qgscomposermap.cpp.

◆ annotationFrameDistance()

double QgsComposerMap::annotationFrameDistance ( ) const
Deprecated:
use grid()->annotationFrameDistance() or grids() instead

Definition at line 1899 of file qgscomposermap.cpp.

◆ assignFreeId()

void QgsComposerMap::assignFreeId ( )

Sets mId to a number not yet used in the composition.

mId is kept if it is not in use. Usually, this function is called before adding the composer map to the composition

Definition at line 2480 of file qgscomposermap.cpp.

◆ atlasDriven()

bool QgsComposerMap::atlasDriven ( ) const
inline

Returns whether the map extent is set to follow the current atlas feature.

Returns
true if map will follow the current atlas feature.
See also
setAtlasDriven
atlasScalingMode

Definition at line 731 of file qgscomposermap.h.

◆ atlasFixedScale()

bool QgsComposerMap::atlasFixedScale ( ) const

Returns true if the map uses a fixed scale when in atlas mode.

Deprecated:
since 2.4 Use atlasScalingMode() instead

Definition at line 2543 of file qgscomposermap.cpp.

◆ atlasMargin()

double QgsComposerMap::atlasMargin ( const QgsComposerObject::PropertyValueType  valueType = QgsComposerObject::EvaluatedValue)

Returns the margin size (percentage) used when the map is in atlas mode.

Parameters
valueTypecontrols whether the returned value is the user specified atlas margin, or the current evaluated atlas margin (which may be affected by data driven atlas margin settings).
Returns
margin size in percentage to leave around the atlas feature's extent
Note
this is only used if atlasScalingMode() is Auto.
See also
atlasScalingMode
setAtlasMargin

Definition at line 2554 of file qgscomposermap.cpp.

◆ atlasScalingMode()

AtlasScalingMode QgsComposerMap::atlasScalingMode ( ) const
inline

Returns the current atlas scaling mode.

This controls how the map's extents are calculated for the current atlas feature when an atlas composition is enabled.

Returns
the current scaling mode
Note
this parameter is only used if atlasDriven() is true
See also
setAtlasScalingMode
atlasDriven

Definition at line 758 of file qgscomposermap.h.

◆ boundingRect()

QRectF QgsComposerMap::boundingRect ( ) const
overridevirtual

In case of annotations, the bounding rectangle can be larger than the map item rectangle.

Reimplemented from QGraphicsRectItem.

Definition at line 2057 of file qgscomposermap.cpp.

◆ cache()

void QgsComposerMap::cache ( )

Create cache image.

Definition at line 258 of file qgscomposermap.cpp.

◆ connectMapOverviewSignals()

void QgsComposerMap::connectMapOverviewSignals ( )
Deprecated:
will be removed in QGIS 3.0

Definition at line 2389 of file qgscomposermap.cpp.

◆ containsAdvancedEffects()

bool QgsComposerMap::containsAdvancedEffects ( ) const

True if composer map contains layers with blend modes or flattened layers for vectors.

Definition at line 1196 of file qgscomposermap.cpp.

◆ containsWMSLayer()

bool QgsComposerMap::containsWMSLayer ( ) const

True if composer map renders a WMS layer.

Definition at line 1167 of file qgscomposermap.cpp.

◆ cornerPointOnRotatedAndScaledRect()

bool QgsComposerMap::cornerPointOnRotatedAndScaledRect ( double &  x,
double &  y,
double  width,
double  height 
) const

Calculates corner point after rotation and scaling.

Deprecated:
Use QgsComposerItem::cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation ) instead

Definition at line 2515 of file qgscomposermap.cpp.

◆ createExpressionContext()

QgsExpressionContext * QgsComposerMap::createExpressionContext ( ) const
overridevirtual

Creates an expression context relating to the item's current state.

The context includes scopes for global, project, composition, atlas and item properties.

Note
added in QGIS 2.12

Reimplemented from QgsComposerItem.

Definition at line 2203 of file qgscomposermap.cpp.

◆ crossLength()

double QgsComposerMap::crossLength ( )
Deprecated:
use grid()->crossLength() or grids() instead

Definition at line 2024 of file qgscomposermap.cpp.

◆ currentMapExtent() [1/2]

const QgsRectangle * QgsComposerMap::currentMapExtent ( ) const

Returns a pointer to the current map extent, which is either the original user specified extent or the temporary atlas-driven feature extent depending on the current atlas state of the composition.

Both a const and non-const version are included.

Returns
pointer to current map extent
See also
visibleExtentPolygon

Definition at line 901 of file qgscomposermap.cpp.

◆ currentMapExtent() [2/2]

QgsRectangle * QgsComposerMap::currentMapExtent ( )
Note
not available in python bindings

Definition at line 885 of file qgscomposermap.cpp.

◆ displayName()

QString QgsComposerMap::displayName ( ) const
overridevirtual

Get item display name.

This is the item's id if set, and if not, a user-friendly string identifying item type.

Returns
display name for item
See also
id
setId
Note
added in version 2.5

Reimplemented from QgsComposerItem.

Definition at line 2174 of file qgscomposermap.cpp.

◆ draw()

void QgsComposerMap::draw ( QPainter painter,
const QgsRectangle extent,
QSizeF  size,
double  dpi,
double *  forceWidthScale = nullptr 
)

Draw to paint device.

Parameters
painterpainter
extentmap extent
sizesize in scene coordinates
dpiscene dpi
forceWidthScaleforce wysiwyg line widths / marker sizes

Definition at line 180 of file qgscomposermap.cpp.

◆ drawCanvasItems()

bool QgsComposerMap::drawCanvasItems ( ) const
inline

Definition at line 640 of file qgscomposermap.h.

◆ drawSelection()

bool QgsComposerMap::drawSelection ( ) const
inline

Get the flag to draw selection in map.

Note
this function was added in version 2.18.21
not available in Python bindings

Definition at line 651 of file qgscomposermap.h.

◆ extent()

QgsRectangle QgsComposerMap::extent ( ) const
inline

Definition at line 290 of file qgscomposermap.h.

◆ extentChanged

void QgsComposerMap::extentChanged ( )
signal

◆ followVisibilityPreset()

bool QgsComposerMap::followVisibilityPreset ( ) const
inline

Whether the map should follow a visibility preset.

If true, the layers and layer styles will be used from given preset name (configured with setFollowVisibilityPresetName() method). This means when preset's settings are changed, the new settings are automatically picked up next time when rendering, without having to explicitly update them. At most one of the flags keepLayerSet() and followVisibilityPreset() should be enabled at any time since they are alternative approaches - if both are enabled, following visibility preset has higher priority. If neither is enabled (or if preset name is not set), map will use the same configuration as the map canvas uses.

Note
added in 2.16

Definition at line 275 of file qgscomposermap.h.

◆ followVisibilityPresetName()

QString QgsComposerMap::followVisibilityPresetName ( ) const
inline

Preset name that decides which layers and layer styles are used for map rendering.

It is only used when followVisibilityPreset() returns true.

Note
added in 2.16

Definition at line 282 of file qgscomposermap.h.

◆ grid()

QgsComposerMapGrid * QgsComposerMap::grid ( )

Returns the map item's first grid.

This is a convenience function.

Returns
pointer to first grid for map item
See also
grids()
Note
introduced in QGIS 2.5

Definition at line 1713 of file qgscomposermap.cpp.

◆ gridAnnotationDirection()

QgsComposerMap::GridAnnotationDirection QgsComposerMap::gridAnnotationDirection ( QgsComposerMap::Border  border) const
Deprecated:
use grid()->annotationDirection() or grids() instead

Definition at line 1928 of file qgscomposermap.cpp.

◆ gridAnnotationFont()

QFont QgsComposerMap::gridAnnotationFont ( ) const
Deprecated:
use grid()->annotationFont() or grids() instead

Definition at line 1832 of file qgscomposermap.cpp.

◆ gridAnnotationFormat()

QgsComposerMap::GridAnnotationFormat QgsComposerMap::gridAnnotationFormat ( ) const
Deprecated:
use grid()->annotationFormat() or grids() instead

Definition at line 1940 of file qgscomposermap.cpp.

◆ gridAnnotationPosition()

QgsComposerMap::GridAnnotationPosition QgsComposerMap::gridAnnotationPosition ( QgsComposerMap::Border  border) const
Deprecated:
use grid()->annotationPosition() or grids() instead

Definition at line 1887 of file qgscomposermap.cpp.

◆ gridAnnotationPrecision()

int QgsComposerMap::gridAnnotationPrecision ( ) const
Deprecated:
use grid()->annotationPrecision() or grids() instead

Definition at line 1856 of file qgscomposermap.cpp.

◆ gridBlendMode()

QPainter::CompositionMode QgsComposerMap::gridBlendMode ( ) const

Returns the grid's blending mode.

Deprecated:
use grid()->blendMode() or grids() instead

Definition at line 2051 of file qgscomposermap.cpp.

◆ gridEnabled()

bool QgsComposerMap::gridEnabled ( ) const
Deprecated:
use grid()->enabled() or grids() instead

Definition at line 2350 of file qgscomposermap.cpp.

◆ gridFrameFillColor1()

QColor QgsComposerMap::gridFrameFillColor1 ( ) const

Get first fill color for grid zebra frame.

Note
: this function was added in version 2.1
Deprecated:
use grid()->frameFillColor1() or grids() instead

Definition at line 2000 of file qgscomposermap.cpp.

◆ gridFrameFillColor2()

QColor QgsComposerMap::gridFrameFillColor2 ( ) const

Get second fill color for grid zebra frame.

Note
: this function was added in version 2.1
Deprecated:
use grid()->frameFillColor2() or grids() instead

Definition at line 2012 of file qgscomposermap.cpp.

◆ gridFramePenColor()

QColor QgsComposerMap::gridFramePenColor ( ) const

Get pen color for grid frame.

Note
: this function was added in version 2.1
Deprecated:
use grid()->framePenColor() or grids() instead

Definition at line 1988 of file qgscomposermap.cpp.

◆ gridFramePenSize()

double QgsComposerMap::gridFramePenSize ( ) const
Deprecated:
use grid()->framePenSize() or grids() instead

Definition at line 1976 of file qgscomposermap.cpp.

◆ gridFrameStyle()

QgsComposerMap::GridFrameStyle QgsComposerMap::gridFrameStyle ( ) const
Deprecated:
use grid()->frameStyle() or grids() instead

Definition at line 1952 of file qgscomposermap.cpp.

◆ gridFrameWidth()

double QgsComposerMap::gridFrameWidth ( ) const
Deprecated:
use grid()->frameWidth() or grids() instead

Definition at line 1964 of file qgscomposermap.cpp.

◆ gridIntervalX()

double QgsComposerMap::gridIntervalX ( ) const
Deprecated:
use grid()->intervalX() or grids() instead

Definition at line 1746 of file qgscomposermap.cpp.

◆ gridIntervalY()

double QgsComposerMap::gridIntervalY ( ) const
Deprecated:
use grid()->intervalY() or grids() instead

Definition at line 1758 of file qgscomposermap.cpp.

◆ gridLineSymbol()

QgsLineSymbolV2 * QgsComposerMap::gridLineSymbol ( )
Deprecated:
use grid()->lineSymbol() or grids() instead

Definition at line 2338 of file qgscomposermap.cpp.

◆ gridOffsetX()

double QgsComposerMap::gridOffsetX ( ) const
Deprecated:
use grid()->offsetX() or grids() instead

Definition at line 1770 of file qgscomposermap.cpp.

◆ gridOffsetY()

double QgsComposerMap::gridOffsetY ( ) const
Deprecated:
use grid()->offsetY() or grids() instead

Definition at line 1782 of file qgscomposermap.cpp.

◆ gridPen()

QPen QgsComposerMap::gridPen ( ) const
Deprecated:
use grid()->pen() or grids() instead

Definition at line 1807 of file qgscomposermap.cpp.

◆ grids()

QgsComposerMapGridStack* QgsComposerMap::grids ( )
inline

Returns the map item's grid stack, which is used to control how grids are drawn over the map's contents.

Returns
pointer to grid stack
See also
grid()
Note
introduced in QGIS 2.5

Definition at line 579 of file qgscomposermap.h.

◆ gridStyle()

QgsComposerMap::GridStyle QgsComposerMap::gridStyle ( ) const
Deprecated:
use grid()->style() or grids() instead

Definition at line 1734 of file qgscomposermap.cpp.

◆ id()

int QgsComposerMap::id ( ) const
inline

Get identification number.

Definition at line 161 of file qgscomposermap.h.

◆ imageSizeConsideringRotation()

bool QgsComposerMap::imageSizeConsideringRotation ( double &  width,
double &  height 
) const

Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation.

Deprecated:
Use bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height, double rotation ) instead

Definition at line 2507 of file qgscomposermap.cpp.

◆ isDrawing()

bool QgsComposerMap::isDrawing ( ) const
inline

True if a draw is already in progress.

Definition at line 164 of file qgscomposermap.h.

◆ keepLayerSet()

bool QgsComposerMap::keepLayerSet ( ) const
inline

Getter for flag that determines if the stored layer set should be used or the current layer set of the qgis mapcanvas.

Definition at line 243 of file qgscomposermap.h.

◆ keepLayerStyles()

bool QgsComposerMap::keepLayerStyles ( ) const
inline

Getter for flag that determines if current styles of layers should be overridden by previously stored styles.

Note
added in 2.8

Definition at line 255 of file qgscomposermap.h.

◆ layersChanged

void QgsComposerMap::layersChanged ( )
protectedslot

Called when layers are added or removed from the layer registry.

Updates the maps layer set and redraws the map if required.

Note
added in QGIS 2.9

Definition at line 517 of file qgscomposermap.cpp.

◆ layerSet()

QStringList QgsComposerMap::layerSet ( ) const
inline

Getter for stored layer set that is used if mKeepLayerSet is true.

Definition at line 248 of file qgscomposermap.h.

◆ layerStyleOverrides()

QMap<QString, QString> QgsComposerMap::layerStyleOverrides ( ) const
inline

Getter for stored overrides of styles for layers.

Note
added in 2.8

Definition at line 260 of file qgscomposermap.h.

◆ layerStyleOverridesChanged

void QgsComposerMap::layerStyleOverridesChanged ( )
signal

Emitted when layer style overrides are changed...

a means to let associated legend items know they should update

Note
added in 2.10

◆ mapRenderer()

const QgsMapRenderer * QgsComposerMap::mapRenderer ( ) const
Deprecated:
since 2.4 - use mapSettings() - may return 0 if not initialized with QgsMapRenderer

Definition at line 528 of file qgscomposermap.cpp.

◆ mapRotation()

double QgsComposerMap::mapRotation ( QgsComposerObject::PropertyValueType  valueType = QgsComposerObject::EvaluatedValue) const

Returns the rotation used for drawing the map within the composer item.

Returns
rotation for map
Parameters
valueTypecontrols whether the returned value is the user specified rotation, or the current evaluated rotation (which may be affected by data driven rotation settings).

Definition at line 978 of file qgscomposermap.cpp.

◆ mapRotationChanged

void QgsComposerMap::mapRotationChanged ( double  newRotation)
signal

Is emitted on rotation change to notify north arrow pictures.

◆ mapSettings()

QgsMapSettings QgsComposerMap::mapSettings ( const QgsRectangle extent,
QSizeF  size,
int  dpi 
) const

Return map settings that would be used for drawing of the map.

Note
added in 2.6

Definition at line 202 of file qgscomposermap.cpp.

◆ mapToItemCoords()

QPointF QgsComposerMap::mapToItemCoords ( QPointF  mapCoords) const

Transforms map coordinates to item coordinates (considering rotation and move offset)

Definition at line 2368 of file qgscomposermap.cpp.

◆ mapUnitsToMM()

double QgsComposerMap::mapUnitsToMM ( ) const

Returns the conversion factor map units -> mm.

Definition at line 2229 of file qgscomposermap.cpp.

◆ moveContent()

void QgsComposerMap::moveContent ( double  dx,
double  dy 
)
overridevirtual

Move content of map.

Parameters
dxmove in x-direction (item and canvas coordinates)
dymove in y-direction (item and canvas coordinates)

Reimplemented from QgsComposerItem.

Definition at line 651 of file qgscomposermap.cpp.

◆ numberExportLayers()

int QgsComposerMap::numberExportLayers ( ) const
overridevirtual

Get the number of layers that this item requires for exporting as layers.

Returns
0 if this item is to be placed on the same layer as the previous item, 1 if it should be placed on its own layer, and >1 if it requires multiple export layers
Note
this method was added in version 2.4

Reimplemented from QgsComposerItem.

Definition at line 443 of file qgscomposermap.cpp.

◆ overview()

QgsComposerMapOverview * QgsComposerMap::overview ( )

Returns the map item's first overview.

This is a convenience function.

Returns
pointer to first overview for map item
See also
overviews()
Note
introduced in QGIS 2.5

Definition at line 2030 of file qgscomposermap.cpp.

◆ overviewBlendMode()

QPainter::CompositionMode QgsComposerMap::overviewBlendMode ( ) const

Returns the overview's blending mode.

Deprecated:
use overview()->blendMode() or overviews() instead

Definition at line 2295 of file qgscomposermap.cpp.

◆ overviewCentered()

bool QgsComposerMap::overviewCentered ( ) const

Returns true if the extent is forced to center on the overview.

Deprecated:
use overview()->centered() or overviews() instead

Definition at line 2319 of file qgscomposermap.cpp.

◆ overviewExtentChanged

void QgsComposerMap::overviewExtentChanged ( )
inlineslot

◆ overviewFrameMapId()

int QgsComposerMap::overviewFrameMapId ( ) const

Returns id of overview frame (or -1 if no overfiew frame)

Deprecated:
use overview()->frameMapId() or overviews() instead

Definition at line 2245 of file qgscomposermap.cpp.

◆ overviewFrameMapSymbol()

QgsFillSymbolV2 * QgsComposerMap::overviewFrameMapSymbol ( )
Deprecated:
use overview()->frameSymbol() or overviews() instead

Definition at line 2289 of file qgscomposermap.cpp.

◆ overviewInverted()

bool QgsComposerMap::overviewInverted ( ) const

Returns true if the overview frame is inverted.

Deprecated:
use overview()->inverted() or overviews() instead

Definition at line 2307 of file qgscomposermap.cpp.

◆ overviews()

QgsComposerMapOverviewStack* QgsComposerMap::overviews ( )
inline

Returns the map item's overview stack, which is used to control how overviews are drawn over the map's contents.

Returns
pointer to overview stack
See also
overview()
Note
introduced in QGIS 2.5

Definition at line 594 of file qgscomposermap.h.

◆ paint()

void QgsComposerMap::paint ( QPainter painter,
const QStyleOptionGraphicsItem itemStyle,
QWidget pWidget 
)
overridevirtual

Reimplementation of QCanvasItem::paint - draw on canvas.

Reimplemented from QGraphicsRectItem.

Definition at line 328 of file qgscomposermap.cpp.

◆ preparedForAtlas

void QgsComposerMap::preparedForAtlas ( )
signal

Is emitted when the map has been prepared for atlas rendering, just before actual rendering.

◆ previewMode()

PreviewMode QgsComposerMap::previewMode ( ) const
inline

Definition at line 239 of file qgscomposermap.h.

◆ readXML()

bool QgsComposerMap::readXML ( const QDomElement itemElem,
const QDomDocument doc 
)
overridevirtual

Sets state from Dom document.

Parameters
itemElemis Dom node corresponding to 'ComposerMap' tag
docis Dom document

Reimplemented from QgsComposerObject.

Definition at line 1394 of file qgscomposermap.cpp.

◆ refreshDataDefinedProperty

void QgsComposerMap::refreshDataDefinedProperty ( const QgsComposerObject::DataDefinedProperty  property = QgsComposerObject::AllProperties,
const QgsExpressionContext context = nullptr 
)
overridevirtualslot

Definition at line 2251 of file qgscomposermap.cpp.

◆ renderModeUpdateCachedImage

void QgsComposerMap::renderModeUpdateCachedImage ( )
slot

Updates the cached map image if the map is set to Render mode.

See also
updateCachedImage

Definition at line 509 of file qgscomposermap.cpp.

◆ requestedExtent()

void QgsComposerMap::requestedExtent ( QgsRectangle extent) const

Calculates the extent to request and the yShift of the top-left point in case of rotation.

Note
added in 2.6

Definition at line 2184 of file qgscomposermap.cpp.

◆ resize()

void QgsComposerMap::resize ( double  dx,
double  dy 
)

Resizes an item in x- and y direction (canvas coordinates)

Definition at line 642 of file qgscomposermap.cpp.

◆ rotation()

Q_DECL_DEPRECATED double QgsComposerMap::rotation ( ) const
inline

Returns the rotation used for drawing the map within the composer item.

Deprecated:
Use mapRotation() instead

Definition at line 618 of file qgscomposermap.h.

◆ scale()

double QgsComposerMap::scale ( ) const

Scale.

Definition at line 634 of file qgscomposermap.cpp.

◆ setAnnotationFontColor()

void QgsComposerMap::setAnnotationFontColor ( const QColor c)

Sets font color for grid annotations.

Deprecated:
use grid()->setAnnotationFontColor() or grids() instead

Definition at line 1838 of file qgscomposermap.cpp.

◆ setAnnotationFrameDistance()

void QgsComposerMap::setAnnotationFrameDistance ( double  d)

Sets distance between map frame and annotations.

Deprecated:
use grid()->setAnnotationFrameDistance() or grids() instead

Definition at line 1893 of file qgscomposermap.cpp.

◆ setAtlasDriven()

void QgsComposerMap::setAtlasDriven ( bool  enabled)

Sets whether the map extent will follow the current atlas feature.

Parameters
enabledset to true if the map extents should be set by the current atlas feature.
See also
atlasDriven
setAtlasScalingMode

Definition at line 2531 of file qgscomposermap.cpp.

◆ setAtlasFixedScale()

void QgsComposerMap::setAtlasFixedScale ( bool  fixed)

Set to true if the map should use a fixed scale when in atlas mode.

Deprecated:
since 2.4 Use setAtlasScalingMode() instead

Definition at line 2548 of file qgscomposermap.cpp.

◆ setAtlasMargin()

void QgsComposerMap::setAtlasMargin ( double  margin)
inline

Sets the margin size (percentage) used when the map is in atlas mode.

Parameters
marginsize in percentage to leave around the atlas feature's extent
Note
this is only used if atlasScalingMode() is Auto.
See also
atlasScalingMode
atlasMargin

Definition at line 787 of file qgscomposermap.h.

◆ setAtlasScalingMode()

void QgsComposerMap::setAtlasScalingMode ( AtlasScalingMode  mode)
inline

Sets the current atlas scaling mode.

This controls how the map's extents are calculated for the current atlas feature when an atlas composition is enabled.

Parameters
modeatlas scaling mode to set
Note
this parameter is only used if atlasDriven() is true
See also
atlasScalingMode
atlasDriven

Definition at line 768 of file qgscomposermap.h.

◆ setCacheUpdated()

void QgsComposerMap::setCacheUpdated ( bool  u = false)

Definition at line 523 of file qgscomposermap.cpp.

◆ setCrossLength()

void QgsComposerMap::setCrossLength ( double  l)

Sets length of the cross segments (if grid style is cross)

Deprecated:
use grid()->setCrossLength() or grids() instead

Definition at line 2018 of file qgscomposermap.cpp.

◆ setDrawCanvasItems()

void QgsComposerMap::setDrawCanvasItems ( bool  b)
inline

Definition at line 639 of file qgscomposermap.h.

◆ setDrawSelection()

void QgsComposerMap::setDrawSelection ( bool  b)
inline

Set the flag to draw selection in map.

Note
this function was added in version 2.18.21
not available in Python bindings

Definition at line 646 of file qgscomposermap.h.

◆ setFollowVisibilityPreset()

void QgsComposerMap::setFollowVisibilityPreset ( bool  follow)
inline

Sets whether the map should follow a visibility preset.

See followVisibilityPreset() for more details.

Note
added in 2.16

Definition at line 278 of file qgscomposermap.h.

◆ setFollowVisibilityPresetName()

void QgsComposerMap::setFollowVisibilityPresetName ( const QString name)
inline

Sets preset name for map rendering.

See followVisibilityPresetName() for more details.

Note
added in 2.16

Definition at line 285 of file qgscomposermap.h.

◆ setFrameOutlineWidth()

void QgsComposerMap::setFrameOutlineWidth ( const double  outlineWidth)
overridevirtual

Sets frame outline width.

Parameters
outlineWidthnew width for outline frame
Note
introduced in 2.2
See also
frameOutlineWidth
setFrameEnabled
setFrameJoinStyle
setFrameOutlineColor

Reimplemented from QgsComposerItem.

Definition at line 2091 of file qgscomposermap.cpp.

◆ setGridAnnotationDirection()

void QgsComposerMap::setGridAnnotationDirection ( GridAnnotationDirection  d,
QgsComposerMap::Border  border 
)
Deprecated:
use grid()->setAnnotationDirection() or grids() instead

Definition at line 1905 of file qgscomposermap.cpp.

◆ setGridAnnotationFont()

void QgsComposerMap::setGridAnnotationFont ( const QFont f)

Sets font for grid annotations.

Deprecated:
use grid()->setAnnotationFont() or grids() instead

Definition at line 1826 of file qgscomposermap.cpp.

◆ setGridAnnotationFormat()

void QgsComposerMap::setGridAnnotationFormat ( QgsComposerMap::GridAnnotationFormat  f)
Deprecated:
use grid()->setAnnotationFormat() or grids() instead

Definition at line 1934 of file qgscomposermap.cpp.

◆ setGridAnnotationPosition()

void QgsComposerMap::setGridAnnotationPosition ( QgsComposerMap::GridAnnotationPosition  p,
QgsComposerMap::Border  border 
)
Deprecated:
use grid()->setAnnotationPosition() or grids() instead

Definition at line 1874 of file qgscomposermap.cpp.

◆ setGridAnnotationPrecision()

void QgsComposerMap::setGridAnnotationPrecision ( int  p)

Sets coordinate precision for grid annotations.

Deprecated:
use grid()->setAnnotationPrecision or grids() instead

Definition at line 1850 of file qgscomposermap.cpp.

◆ setGridBlendMode()

void QgsComposerMap::setGridBlendMode ( QPainter::CompositionMode  blendMode)

Sets the grid's blending mode.

Deprecated:
use grid()->setBlendMode() or grids() instead

Definition at line 2045 of file qgscomposermap.cpp.

◆ setGridEnabled()

void QgsComposerMap::setGridEnabled ( bool  enabled)

Enables a coordinate grid that is shown on top of this composermap.

Deprecated:
use grid()->setEnabled() or grids() instead

Definition at line 2344 of file qgscomposermap.cpp.

◆ setGridFrameFillColor1()

void QgsComposerMap::setGridFrameFillColor1 ( const QColor c)

Sets first fill color for grid zebra frame.

Note
: this function was added in version 2.1
Deprecated:
use grid()->setFrameFillColor1() or grids() instead

Definition at line 1994 of file qgscomposermap.cpp.

◆ setGridFrameFillColor2()

void QgsComposerMap::setGridFrameFillColor2 ( const QColor c)

Sets second fill color for grid zebra frame.

Note
: this function was added in version 2.1
Deprecated:
use grid()->setFrameFillColor2() or grids() instead

Definition at line 2006 of file qgscomposermap.cpp.

◆ setGridFramePenColor()

void QgsComposerMap::setGridFramePenColor ( const QColor c)

Sets pen color for grid frame.

Note
: this function was added in version 2.1
Deprecated:
use grid()->setFramePenColor() or grids() instead

Definition at line 1982 of file qgscomposermap.cpp.

◆ setGridFramePenSize()

void QgsComposerMap::setGridFramePenSize ( double  w)

Set grid frame pen thickness.

Note
: this function was added in version 2.1
Deprecated:
use grid()->setFramePenSize() or grids() instead

Definition at line 1970 of file qgscomposermap.cpp.

◆ setGridFrameStyle()

void QgsComposerMap::setGridFrameStyle ( GridFrameStyle  style)

Set grid frame style (NoGridFrame or Zebra)

Deprecated:
use grid()->setFrameStyle() or grids() instead

Definition at line 1946 of file qgscomposermap.cpp.

◆ setGridFrameWidth()

void QgsComposerMap::setGridFrameWidth ( double  w)

Set grid frame width.

Deprecated:
use grid()->setFrameWidth() or grids() instead

Definition at line 1958 of file qgscomposermap.cpp.

◆ setGridIntervalX()

void QgsComposerMap::setGridIntervalX ( double  interval)

Sets coordinate interval in x-direction for composergrid.

Deprecated:
use grid()->setIntervalX() or grids() instead

Definition at line 1740 of file qgscomposermap.cpp.

◆ setGridIntervalY()

void QgsComposerMap::setGridIntervalY ( double  interval)

Sets coordinate interval in y-direction for composergrid.

Deprecated:
use grid()->setIntervalY() or grids() instead

Definition at line 1752 of file qgscomposermap.cpp.

◆ setGridLineSymbol()

void QgsComposerMap::setGridLineSymbol ( QgsLineSymbolV2 symbol)
Deprecated:
use grid()->setLineSymbol() or grids() instead

Definition at line 2332 of file qgscomposermap.cpp.

◆ setGridOffsetX()

void QgsComposerMap::setGridOffsetX ( double  offset)

Sets x-coordinate offset for composer grid.

Deprecated:
use grid()->setOffsetX() or grids() instead

Definition at line 1764 of file qgscomposermap.cpp.

◆ setGridOffsetY()

void QgsComposerMap::setGridOffsetY ( double  offset)

Sets y-coordinate offset for composer grid.

Deprecated:
use grid()->setOffsetY() or grids() instead

Definition at line 1776 of file qgscomposermap.cpp.

◆ setGridPen()

void QgsComposerMap::setGridPen ( const QPen p)

Sets the pen to draw composer grid.

Deprecated:
use grid()->setPenWidth(), grid()->setPenColor() or grids() instead

Definition at line 1800 of file qgscomposermap.cpp.

◆ setGridPenColor()

void QgsComposerMap::setGridPenColor ( const QColor c)

Sets the color of the grid pen.

Deprecated:
use grid()->setPenColor() or grids() instead

Definition at line 1794 of file qgscomposermap.cpp.

◆ setGridPenWidth()

void QgsComposerMap::setGridPenWidth ( double  w)

Sets width of grid pen.

Deprecated:
use grid()->setPenWidth() or grids() instead

Definition at line 1788 of file qgscomposermap.cpp.

◆ setGridStyle()

void QgsComposerMap::setGridStyle ( GridStyle  style)

Sets coordinate grid style to solid or cross.

Deprecated:
use grid()->setStyle() or grids() instead

Definition at line 1728 of file qgscomposermap.cpp.

◆ setKeepLayerSet()

void QgsComposerMap::setKeepLayerSet ( bool  enabled)
inline

Setter for flag that determines if the stored layer set should be used or the current layer set of the qgis mapcanvas.

Definition at line 245 of file qgscomposermap.h.

◆ setKeepLayerStyles()

void QgsComposerMap::setKeepLayerStyles ( bool  enabled)
inline

Setter for flag that determines if current styles of layers should be overridden by previously stored styles.

Note
added in 2.8

Definition at line 257 of file qgscomposermap.h.

◆ setLayerSet()

void QgsComposerMap::setLayerSet ( const QStringList layerSet)
inline

Setter for stored layer set that is used if mKeepLayerSet is true.

Definition at line 250 of file qgscomposermap.h.

◆ setLayerStyleOverrides()

void QgsComposerMap::setLayerStyleOverrides ( const QMap< QString, QString > &  overrides)

Setter for stored overrides of styles for layers.

Note
added in 2.8

Definition at line 1661 of file qgscomposermap.cpp.

◆ setMapCanvas()

void QgsComposerMap::setMapCanvas ( QGraphicsView canvas)
inline

Sets canvas pointer (necessary to query and draw map canvas items)

Definition at line 637 of file qgscomposermap.h.

◆ setMapRotation()

void QgsComposerMap::setMapRotation ( double  r)

Sets rotation for the map - this does not affect the composer item shape, only the way the map is drawn within the item.

Note
this function was added in version 2.1

Definition at line 969 of file qgscomposermap.cpp.

◆ setNewAtlasFeatureExtent()

void QgsComposerMap::setNewAtlasFeatureExtent ( const QgsRectangle extent)

Sets new Extent for the current atlas preview and changes width, height (and implicitely also scale).

Atlas preview extents are only temporary, and are regenerated whenever the atlas feature changes

Definition at line 844 of file qgscomposermap.cpp.

◆ setNewExtent()

void QgsComposerMap::setNewExtent ( const QgsRectangle extent)

Sets new extent for the map.

This method may change the width or height of the map item to ensure that the extent exactly matches the specified extent, with no overlap or margin. This method implicitly alters the map scale.

Parameters
extentnew extent for the map
See also
zoomToExtent

Definition at line 784 of file qgscomposermap.cpp.

◆ setNewScale()

void QgsComposerMap::setNewScale ( double  scaleDenominator,
bool  forceUpdate = true 
)

Sets new scale and changes only mExtent.

Definition at line 917 of file qgscomposermap.cpp.

◆ setOffset()

void QgsComposerMap::setOffset ( double  xOffset,
double  yOffset 
)

Sets offset values to shift image (useful for live updates when moving item content)

Definition at line 957 of file qgscomposermap.cpp.

◆ setOverviewBlendMode()

void QgsComposerMap::setOverviewBlendMode ( QPainter::CompositionMode  blendMode)

Sets the overview's blending mode.

Deprecated:
use overview()->setBlendMode() or overviews() instead

Definition at line 2301 of file qgscomposermap.cpp.

◆ setOverviewCentered()

void QgsComposerMap::setOverviewCentered ( bool  centered)

Set the overview's centering mode.

Deprecated:
use overview()->setCentered() or overviews() instead

Definition at line 2325 of file qgscomposermap.cpp.

◆ setOverviewFrameMap()

void QgsComposerMap::setOverviewFrameMap ( int  mapId)

Sets overview frame map.

-1 disables the overview frame

Deprecated:
use overview()->setFrameMap() or overviews() instead

Definition at line 2239 of file qgscomposermap.cpp.

◆ setOverviewFrameMapSymbol()

void QgsComposerMap::setOverviewFrameMapSymbol ( QgsFillSymbolV2 symbol)
Deprecated:
use overview()->setFrameSymbol() or overviews() instead

Definition at line 2283 of file qgscomposermap.cpp.

◆ setOverviewInverted()

void QgsComposerMap::setOverviewInverted ( bool  inverted)

Sets the overview's inversion mode.

Deprecated:
use overview()->setInverted() or overviews() instead

Definition at line 2313 of file qgscomposermap.cpp.

◆ setPreviewMode()

void QgsComposerMap::setPreviewMode ( PreviewMode  m)

Definition at line 951 of file qgscomposermap.cpp.

◆ setRotation()

void QgsComposerMap::setRotation ( double  r)
overridevirtual

Sets rotation for the map - this does not affect the composer item shape, only the way the map is drawn within the item.

Deprecated:
Use setMapRotation( double rotation ) instead

Reimplemented from QgsComposerItem.

Definition at line 963 of file qgscomposermap.cpp.

◆ setSceneRect()

void QgsComposerMap::setSceneRect ( const QRectF rectangle)
overridevirtual

Sets new scene rectangle bounds and recalculates hight and extent.

Reimplemented from QgsComposerItem.

Definition at line 762 of file qgscomposermap.cpp.

◆ setShowGridAnnotation()

void QgsComposerMap::setShowGridAnnotation ( bool  show)

Sets flag if grid annotation should be shown.

Deprecated:
use grid()->setAnnotationEnabled() or grids() instead

Definition at line 1862 of file qgscomposermap.cpp.

◆ setUpdatesEnabled()

void QgsComposerMap::setUpdatesEnabled ( bool  enabled)
inline

Sets whether updates to the composer map are enabled.

Definition at line 790 of file qgscomposermap.h.

◆ showGridAnnotation()

bool QgsComposerMap::showGridAnnotation ( ) const
Deprecated:
use grid()->annotationEnabled() or grids() instead

Definition at line 1868 of file qgscomposermap.cpp.

◆ sizeChangedByRotation()

void QgsComposerMap::sizeChangedByRotation ( double &  width,
double &  height 
)

Calculates width / height of the bounding box of a rotated rectangle.

Deprecated:
Use QgsComposerItem::sizeChangedByRotation( double& width, double& height, double rotation ) instead

Definition at line 2523 of file qgscomposermap.cpp.

◆ storeCurrentLayerSet()

void QgsComposerMap::storeCurrentLayerSet ( )

Stores the current layer set of the qgis mapcanvas in mLayerSet.

Definition at line 1649 of file qgscomposermap.cpp.

◆ storeCurrentLayerStyles()

void QgsComposerMap::storeCurrentLayerStyles ( )

Stores the current layer styles into style overrides.

Note
added in 2.8

Definition at line 1671 of file qgscomposermap.cpp.

◆ toggleAtlasPreview()

Q_DECL_DEPRECATED void QgsComposerMap::toggleAtlasPreview ( )
inline

Called when atlas preview is toggled, to force map item to update its extent and redraw.

Deprecated:
no longer required

Definition at line 226 of file qgscomposermap.h.

◆ transformedMapPolygon()

QPolygonF QgsComposerMap::transformedMapPolygon ( ) const

Returns extent that considers rotation and shift with mOffsetX / mOffsetY.

Definition at line 2105 of file qgscomposermap.cpp.

◆ type()

virtual int QgsComposerMap::type ( ) const
inlineoverridevirtual

Return correct graphics item type.

Reimplemented from QgsComposerItem.

Definition at line 60 of file qgscomposermap.h.

◆ updateBoundingRect

void QgsComposerMap::updateBoundingRect ( )
slot

Updates the bounding rect of this item.

Call this function before doing any changes related to annotation out of the map rectangle

Definition at line 2062 of file qgscomposermap.cpp.

◆ updateCachedImage

void QgsComposerMap::updateCachedImage ( )
slot

Forces an update of the cached map image.

Definition at line 502 of file qgscomposermap.cpp.

◆ updateItem()

void QgsComposerMap::updateItem ( )
overridevirtual

Updates item, with the possibility to do custom update for subclasses.

Reimplemented from QgsComposerItem.

Definition at line 1153 of file qgscomposermap.cpp.

◆ updatesEnabled()

bool QgsComposerMap::updatesEnabled ( ) const
inline

Returns whether updates to the composer map are enabled.

Definition at line 793 of file qgscomposermap.h.

◆ visibleExtentPolygon()

QPolygonF QgsComposerMap::visibleExtentPolygon ( ) const

Returns a polygon representing the current visible map extent, considering map extents and rotation.

If the map rotation is 0, the result is the same as currentMapExtent

Returns
polygon with the four corner points representing the visible map extent. The points are clockwise, starting at the top-left point
See also
currentMapExtent

Definition at line 2167 of file qgscomposermap.cpp.

◆ writeXML()

bool QgsComposerMap::writeXML ( QDomElement elem,
QDomDocument doc 
) const
overridevirtual

Stores state in Dom node.

Parameters
elemis Dom element corresponding to 'Composer' tag
docDom document

Reimplemented from QgsComposerObject.

Definition at line 1271 of file qgscomposermap.cpp.

◆ zoomContent() [1/2]

void QgsComposerMap::zoomContent ( int  delta,
double  x,
double  y 
)
overridevirtual

Zoom content of map.

Parameters
deltavalue from wheel event that describes direction (positive /negative number)
xx-position of mouse cursor (in item coordinates)
yy-position of mouse cursor (in item coordinates)
Deprecated:
use zoomContent( double, QPointF, ZoomMode ) instead

Reimplemented from QgsComposerItem.

Definition at line 671 of file qgscomposermap.cpp.

◆ zoomContent() [2/2]

void QgsComposerMap::zoomContent ( const double  factor,
const QPointF  point,
const ZoomMode  mode = QgsComposerItem::Zoom 
)
overridevirtual

Zoom content of item.

Does nothing per default (but implemented in composer map)

Parameters
factorzoom factor, where > 1 results in a zoom in and < 1 results in a zoom out
pointitem point for zoom center
modezoom mode
Note
added in QGIS 2.5

Reimplemented from QgsComposerItem.

Definition at line 689 of file qgscomposermap.cpp.

◆ zoomToExtent()

void QgsComposerMap::zoomToExtent ( const QgsRectangle extent)

Zooms the map so that the specified extent is fully visible within the map item.

This method will not change the width or height of the map, and may result in an overlap or margin from the specified extent. This method implicitly alters the map scale.

Parameters
extentnew extent for the map
See also
setNewExtent
Note
added in QGIS 2.5

Definition at line 804 of file qgscomposermap.cpp.

Friends And Related Function Documentation

◆ QgsComposerMapOverview

friend class QgsComposerMapOverview
friend

Definition at line 1012 of file qgscomposermap.h.

◆ TestQgsComposerMap

friend class TestQgsComposerMap
friend

Definition at line 1013 of file qgscomposermap.h.


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