QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | List of all members
QgsComposerMapGrid Class Reference

An individual grid which is drawn above the map content in a QgsComposerMap. More...

#include <qgscomposermapgrid.h>

Public Types

enum  GridUnit { MapUnit, MM, CM }
 Unit for grid values. More...
 
enum  GridStyle { Solid = 0, Cross, Markers, FrameAnnotationsOnly }
 Grid drawing style. More...
 
enum  AnnotationPosition { InsideMapFrame = 0, OutsideMapFrame, Disabled }
 Position for grid annotations. More...
 
enum  AnnotationDirection { Horizontal = 0, Vertical, BoundaryDirection }
 Direction of grid annotations. More...
 
enum  AnnotationFormat {
  Decimal = 0, DegreeMinute, DegreeMinuteSecond, DecimalWithSuffix,
  DegreeMinuteNoSuffix, DegreeMinutePadded, DegreeMinuteSecondNoSuffix, DegreeMinuteSecondPadded
}
 Format for displaying grid annotations. More...
 
enum  BorderSide { Left, Right, Bottom, Top }
 Border sides for annotations. More...
 
enum  FrameStyle {
  NoFrame = 0, Zebra, InteriorTicks, ExteriorTicks,
  InteriorExteriorTicks, LineBorder
}
 Style for grid frame. More...
 
enum  FrameSideFlag { FrameLeft = 0x01, FrameRight = 0x02, FrameTop = 0x04, FrameBottom = 0x08 }
 Flags for controlling which side of the map a frame is drawn on. More...
 
enum  AnnotationCoordinate { Longitude = 0, Latitude }
 Annotation coordinate type. More...
 

Public Member Functions

 QgsComposerMapGrid (const QString &name, QgsComposerMap *map)
 Constructor for QgsComposerMapGrid. More...
 
virtual ~QgsComposerMapGrid ()
 
void drawGrid (QPainter *painter) const
 Draws a grid. More...
 
bool writeXML (QDomElement &elem, QDomDocument &doc) const
 Stores grid state in DOM element. More...
 
bool readXML (const QDomElement &itemElem, const QDomDocument &doc)
 Sets grid state from a DOM document. More...
 
void setComposerMap (QgsComposerMap *map)
 Sets composer map for the grid. More...
 
const QgsComposerMapcomposerMap () const
 Get composer map for the grid. More...
 
void setName (const QString &name)
 Sets the friendly display name for the grid. More...
 
QString name () const
 Get friendly display name for the grid. More...
 
QString id () const
 Get the unique id for the grid. More...
 
void setEnabled (const bool enabled)
 Controls whether the grid will be drawn. More...
 
bool enabled () const
 Returns whether the grid will be drawn. More...
 
void setCrs (const QgsCoordinateReferenceSystem &crs)
 Sets the CRS for the grid. More...
 
QgsCoordinateReferenceSystem crs () const
 Retrieves the CRS for the grid. More...
 
void setBlendMode (const QPainter::CompositionMode mode)
 Sets the blending mode used for drawing the grid. More...
 
QPainter::CompositionMode blendMode () const
 Retrieves the blending mode used for drawing the grid. More...
 
double maxExtension () const
 Calculates the maximum distance the grid extends beyond the QgsComposerMap's item rect. More...
 
void setUnits (const GridUnit unit)
 Sets the units to use for grid measurements such as the interval and offset for grid lines. More...
 
GridUnit units () const
 Gets the units used for grid measurements such as the interval and offset for grid lines. More...
 
void setIntervalX (const double interval)
 Sets the interval between grid lines in the x-direction. More...
 
double intervalX () const
 Gets the interval between grid lines in the x-direction. More...
 
void setIntervalY (const double interval)
 Sets the interval between grid lines in the y-direction. More...
 
double intervalY () const
 Gets the interval between grid lines in the y-direction. More...
 
void setOffsetX (const double offset)
 Sets the offset for grid lines in the x-direction. More...
 
double offsetX () const
 Gets the offset for grid lines in the x-direction. More...
 
void setOffsetY (const double offset)
 Sets the offset for grid lines in the y-direction. More...
 
double offsetY () const
 Gets the offset for grid lines in the y-direction. More...
 
void setStyle (const GridStyle style)
 Sets the grid style, which controls how the grid is drawn over the map's contents. More...
 
GridStyle style () const
 Gets the grid's style, which controls how the grid is drawn over the map's contents. More...
 
void setCrossLength (const double length)
 Sets the length of the cross segments drawn for the grid. More...
 
double crossLength () const
 Retrieves the length of the cross segments drawn for the grid. More...
 
void setGridLineWidth (const double width)
 Sets width of grid lines. More...
 
void setGridLineColor (const QColor &color)
 Sets color of grid lines. More...
 
void setLineSymbol (QgsLineSymbolV2 *symbol)
 Sets the line symbol used for drawing grid lines. More...
 
const QgsLineSymbolV2lineSymbol () const
 Gets the line symbol used for drawing grid lines. More...
 
QgsLineSymbolV2lineSymbol ()
 Gets the line symbol used for drawing grid lines. More...
 
void setMarkerSymbol (QgsMarkerSymbolV2 *symbol)
 Sets the marker symbol used for drawing grid points. More...
 
const QgsMarkerSymbolV2markerSymbol () const
 Gets the marker symbol used for drawing grid points. More...
 
QgsMarkerSymbolV2markerSymbol ()
 Gets the marker symbol used for drawing grid points. More...
 
void setAnnotationEnabled (const bool enabled)
 Sets whether annotations should be shown for the grid. More...
 
bool annotationEnabled () const
 Gets whether annotations are shown for the grid. More...
 
void setAnnotationFont (const QFont &font)
 Sets the font used for drawing grid annotations. More...
 
QFont annotationFont () const
 Gets the font used for drawing grid annotations. More...
 
void setAnnotationFontColor (const QColor &color)
 Sets the font color used for drawing grid annotations. More...
 
QColor annotationFontColor () const
 Gets the font color used for drawing grid annotations. More...
 
void setAnnotationPrecision (const int precision)
 Sets the coordinate precision for grid annotations. More...
 
int annotationPrecision () const
 Returns the coordinate precision for grid annotations. More...
 
void setAnnotationPosition (const AnnotationPosition position, const BorderSide border)
 Sets the position for the grid annotations on a specified side of the map frame. More...
 
AnnotationPosition annotationPosition (const BorderSide border) const
 Gets the position for the grid annotations on a specified side of the map frame. More...
 
void setAnnotationFrameDistance (const double distance)
 Sets the distance between the map frame and annotations. More...
 
double annotationFrameDistance () const
 Gets the distance between the map frame and annotations. More...
 
void setAnnotationDirection (const AnnotationDirection direction, const BorderSide border)
 Sets the direction for drawing frame annotations. More...
 
void setAnnotationDirection (const AnnotationDirection direction)
 Sets the direction for drawing all frame annotations. More...
 
AnnotationDirection annotationDirection (const BorderSide border) const
 Gets the direction for drawing frame annotations. More...
 
void setAnnotationFormat (const AnnotationFormat format)
 Sets the format for drawing grid annotations. More...
 
AnnotationFormat annotationFormat () const
 Gets the format for drawing grid annotations. More...
 
void setFrameStyle (const FrameStyle style)
 Sets the grid frame style. More...
 
FrameStyle frameStyle () const
 Gets the grid frame style. More...
 
void setFrameSideFlags (const FrameSideFlags flags)
 Sets flags for grid frame sides. More...
 
void setFrameSideFlag (const FrameSideFlag flag, bool on=true)
 Sets whether the grid frame is drawn for a certain side of the map item. More...
 
FrameSideFlags frameSideFlags () const
 Returns the flags which control which sides of the map item the grid frame is drawn on. More...
 
bool testFrameSideFlag (const FrameSideFlag flag) const
 Tests whether the grid frame should be drawn on a specified side of the map item. More...
 
void setFrameWidth (const double width)
 Sets the grid frame width. More...
 
double frameWidth () const
 Gets the grid frame width. More...
 
void setFramePenSize (const double width)
 Sets the width of the outline drawn in the grid frame. More...
 
double framePenSize () const
 Retrieves the width of the outline drawn in the grid frame. More...
 
void setFramePenColor (const QColor &color)
 Sets the color of the outline drawn in the grid frame. More...
 
QColor framePenColor () const
 Retrieves the color of the outline drawn in the grid frame. More...
 
void setFrameFillColor1 (const QColor &color)
 Sets the first fill color used for the grid frame. More...
 
QColor frameFillColor1 () const
 Retrieves the first fill color for the grid frame. More...
 
void setFrameFillColor2 (const QColor &color)
 Sets the second fill color used for the grid frame. More...
 
QColor frameFillColor2 () const
 Retrieves the second fill color for the grid frame. More...
 

Detailed Description

An individual grid which is drawn above the map content in a QgsComposerMap.

Note
added in QGIS 2.5
See also
QgsComposerMapGridStack

Member Enumeration Documentation

Annotation coordinate type.

Enumerator
Longitude 
Latitude 

Direction of grid annotations.

Enumerator
Horizontal 
Vertical 
BoundaryDirection 

Format for displaying grid annotations.

Enumerator
Decimal 
DegreeMinute 
DegreeMinuteSecond 
DecimalWithSuffix 
DegreeMinuteNoSuffix 
DegreeMinutePadded 
DegreeMinuteSecondNoSuffix 
DegreeMinuteSecondPadded 

Position for grid annotations.

Enumerator
InsideMapFrame 
OutsideMapFrame 
Disabled 

Border sides for annotations.

Enumerator
Left 
Right 
Bottom 
Top 

Flags for controlling which side of the map a frame is drawn on.

Enumerator
FrameLeft 
FrameRight 
FrameTop 
FrameBottom 

Style for grid frame.

Enumerator
NoFrame 
Zebra 
InteriorTicks 
ExteriorTicks 
InteriorExteriorTicks 
LineBorder 

Grid drawing style.

Enumerator
Solid 
Cross 
Markers 
FrameAnnotationsOnly 

Unit for grid values.

Enumerator
MapUnit 
MM 
CM 

Constructor & Destructor Documentation

QgsComposerMapGrid::QgsComposerMapGrid ( const QString &  name,
QgsComposerMap map 
)

Constructor for QgsComposerMapGrid.

Parameters
namefriendly display name for grid
mapQgsComposerMap the grid stack is attached to
QgsComposerMapGrid::~QgsComposerMapGrid ( )
virtual

Member Function Documentation

QgsComposerMapGrid::AnnotationDirection QgsComposerMapGrid::annotationDirection ( const BorderSide  border) const

Gets the direction for drawing frame annotations.

Parameters
borderside of map for annotations
Returns
direction for frame annotations
See also
setAnnotationDirection
bool QgsComposerMapGrid::annotationEnabled ( ) const
inline

Gets whether annotations are shown for the grid.

Returns
true if annotations are drawn for the grid
See also
setAnnotationEnabled
QFont QgsComposerMapGrid::annotationFont ( ) const
inline

Gets the font used for drawing grid annotations.

Returns
font for annotations
See also
setAnnotationFont
QColor QgsComposerMapGrid::annotationFontColor ( ) const
inline

Gets the font color used for drawing grid annotations.

Returns
font color for annotations
See also
setAnnotationFontColor
AnnotationFormat QgsComposerMapGrid::annotationFormat ( ) const
inline

Gets the format for drawing grid annotations.

Returns
format for grid annotations
See also
setAnnotationFormat
double QgsComposerMapGrid::annotationFrameDistance ( ) const
inline

Gets the distance between the map frame and annotations.

Units are in millimetres.

Returns
margin between map frame and annotations
See also
setAnnotationFrameDistance
QgsComposerMapGrid::AnnotationPosition QgsComposerMapGrid::annotationPosition ( const BorderSide  border) const

Gets the position for the grid annotations on a specified side of the map frame.

Parameters
borderside of map for annotations
Returns
position that grid annotations are drawn in
See also
setAnnotationPosition
int QgsComposerMapGrid::annotationPrecision ( ) const
inline

Returns the coordinate precision for grid annotations.

Returns
number of decimal places shown when drawing grid annotations
See also
setAnnotationPrecision
QPainter::CompositionMode QgsComposerMapGrid::blendMode ( ) const
inline

Retrieves the blending mode used for drawing the grid.

Returns
blending mode for grid
See also
setBlendMode
const QgsComposerMap* QgsComposerMapGrid::composerMap ( ) const
inline

Get composer map for the grid.

Returns
composer map
See also
setComposerMap
double QgsComposerMapGrid::crossLength ( ) const
inline

Retrieves the length of the cross segments drawn for the grid.

This is only used for grids with QgsComposerMapGrid::Cross styles

Returns
cross length in millimetres
See also
setCrossLength
QgsCoordinateReferenceSystem QgsComposerMapGrid::crs ( ) const
inline

Retrieves the CRS for the grid.

Returns
coordinate reference system for grid
See also
setCrs
void QgsComposerMapGrid::drawGrid ( QPainter *  painter) const

Draws a grid.

Parameters
painterdestination QPainter
bool QgsComposerMapGrid::enabled ( ) const
inline

Returns whether the grid will be drawn.

Returns
true if grid will be drawn on the map
See also
setEnabled
QColor QgsComposerMapGrid::frameFillColor1 ( ) const
inline

Retrieves the first fill color for the grid frame.

Returns
first fill color for grid frame
See also
setFrameFillColor1
framePenColor
frameFillColor2
QColor QgsComposerMapGrid::frameFillColor2 ( ) const
inline

Retrieves the second fill color for the grid frame.

Returns
second fill color for grid frame
See also
setFrameFillColor2
framePenColor
frameFillColor1
QColor QgsComposerMapGrid::framePenColor ( ) const
inline

Retrieves the color of the outline drawn in the grid frame.

Returns
color of grid frame outline
See also
setFramePenColor
framePenSize
frameFillColor1
frameFillColor2
double QgsComposerMapGrid::framePenSize ( ) const
inline

Retrieves the width of the outline drawn in the grid frame.

Returns
width of grid frame outline
See also
setFramePenSize
framePenColor
QgsComposerMapGrid::FrameSideFlags QgsComposerMapGrid::frameSideFlags ( ) const

Returns the flags which control which sides of the map item the grid frame is drawn on.

Returns
flags for side of map grid is drawn on
See also
setFrameSideFlags
setFrameSideFlag
testFrameSideFlag
FrameStyle QgsComposerMapGrid::frameStyle ( ) const
inline

Gets the grid frame style.

Returns
style for grid frame
See also
setFrameStyle
double QgsComposerMapGrid::frameWidth ( ) const
inline

Gets the grid frame width.

This property controls how wide the grid frame is. The size of the line outlines drawn in the frame can be retrieved via the framePenSize method.

Returns
width of grid frame in millimetres
See also
setFrameWidth
QString QgsComposerMapGrid::id ( ) const
inline

Get the unique id for the grid.

Returns
unique id
See also
name
double QgsComposerMapGrid::intervalX ( ) const
inline

Gets the interval between grid lines in the x-direction.

The units are retrieved through the units() method.

Returns
interval between horizontal grid lines
See also
setIntervalX
intervalY
double QgsComposerMapGrid::intervalY ( ) const
inline

Gets the interval between grid lines in the y-direction.

The units are retrieved through the units() method.

Returns
interval between vertical grid lines
See also
setIntervalY
intervalX
const QgsLineSymbolV2* QgsComposerMapGrid::lineSymbol ( ) const
inline

Gets the line symbol used for drawing grid lines.

This is only used for grids with QgsComposerMapGrid::Solid or QgsComposerMapGrid::Cross styles.

Returns
line symbol for grid lines
See also
setLineSymbol
markerSymbol
style
QgsLineSymbolV2* QgsComposerMapGrid::lineSymbol ( )
inline

Gets the line symbol used for drawing grid lines.

This is only used for grids with QgsComposerMapGrid::Solid or QgsComposerMapGrid::Cross styles.

Returns
line symbol for grid lines
See also
setLineSymbol
markerSymbol
style
const QgsMarkerSymbolV2* QgsComposerMapGrid::markerSymbol ( ) const
inline

Gets the marker symbol used for drawing grid points.

This is only used for grids with a QgsComposerMapGrid::Markers style.

Returns
marker symbol for grid intersection points
See also
setMarkerSymbol
lineSymbol
style
QgsMarkerSymbolV2* QgsComposerMapGrid::markerSymbol ( )
inline

Gets the marker symbol used for drawing grid points.

This is only used for grids with a QgsComposerMapGrid::Markers style.

Returns
marker symbol for grid intersection points
See also
setMarkerSymbol
lineSymbol
style
double QgsComposerMapGrid::maxExtension ( ) const

Calculates the maximum distance the grid extends beyond the QgsComposerMap's item rect.

Returns
maximum extension in millimetres
QString QgsComposerMapGrid::name ( ) const
inline

Get friendly display name for the grid.

Returns
display name
See also
setName
double QgsComposerMapGrid::offsetX ( ) const
inline

Gets the offset for grid lines in the x-direction.

The units are retrieved through the units() method.

Returns
offset for horizontal grid lines
See also
setOffsetX
offsetY
double QgsComposerMapGrid::offsetY ( ) const
inline

Gets the offset for grid lines in the y-direction.

The units are retrieved through the units() method.

Returns
offset for vertical grid lines
See also
setOffsetY
offsetX
bool QgsComposerMapGrid::readXML ( const QDomElement &  itemElem,
const QDomDocument &  doc 
)

Sets grid state from a DOM document.

Parameters
itemElemis DOM node corresponding to a 'ComposerMapGrid' tag
docis DOM document
See also
writeXML
void QgsComposerMapGrid::setAnnotationDirection ( const AnnotationDirection  direction,
const BorderSide  border 
)

Sets the direction for drawing frame annotations.

Parameters
directiondirection for frame annotations
borderside of map for annotations
See also
annotationDirection
void QgsComposerMapGrid::setAnnotationDirection ( const AnnotationDirection  direction)

Sets the direction for drawing all frame annotations.

Parameters
directiondirection for frame annotations
See also
annotationDirection
void QgsComposerMapGrid::setAnnotationEnabled ( const bool  enabled)
inline

Sets whether annotations should be shown for the grid.

Parameters
enabledset to true to draw annotations for the grid
See also
annotationEnabled
void QgsComposerMapGrid::setAnnotationFont ( const QFont &  font)
inline

Sets the font used for drawing grid annotations.

Parameters
fontfont for annotations
See also
annotationFont
void QgsComposerMapGrid::setAnnotationFontColor ( const QColor &  color)
inline

Sets the font color used for drawing grid annotations.

Parameters
colorfont color for annotations
See also
annotationFontColor
void QgsComposerMapGrid::setAnnotationFormat ( const AnnotationFormat  format)
inline

Sets the format for drawing grid annotations.

Parameters
formatformat for grid annotations
See also
annotationFormat
void QgsComposerMapGrid::setAnnotationFrameDistance ( const double  distance)
inline

Sets the distance between the map frame and annotations.

Units are in millimetres.

Parameters
distancemargin between map frame and annotations
See also
annotationFrameDistance
void QgsComposerMapGrid::setAnnotationPosition ( const AnnotationPosition  position,
const BorderSide  border 
)

Sets the position for the grid annotations on a specified side of the map frame.

Parameters
positionposition to draw grid annotations
borderside of map for annotations
See also
annotationPosition
void QgsComposerMapGrid::setAnnotationPrecision ( const int  precision)
inline

Sets the coordinate precision for grid annotations.

Parameters
precisionnumber of decimal places to show when drawing grid annotations
See also
annotationPrecision
void QgsComposerMapGrid::setBlendMode ( const QPainter::CompositionMode  mode)
inline

Sets the blending mode used for drawing the grid.

Parameters
modeblending mode for grid
See also
blendMode
void QgsComposerMapGrid::setComposerMap ( QgsComposerMap map)

Sets composer map for the grid.

Parameters
mapcomposer map
See also
composerMap
void QgsComposerMapGrid::setCrossLength ( const double  length)
inline

Sets the length of the cross segments drawn for the grid.

This is only used for grids with QgsComposerMapGrid::Cross styles

Parameters
lengthcross length in millimetres
See also
crossLength
void QgsComposerMapGrid::setCrs ( const QgsCoordinateReferenceSystem crs)
inline

Sets the CRS for the grid.

Parameters
crscoordinate reference system for grid
See also
crs
void QgsComposerMapGrid::setEnabled ( const bool  enabled)
inline

Controls whether the grid will be drawn.

Parameters
enabledset to true to enable drawing of the grid
See also
enabled
void QgsComposerMapGrid::setFrameFillColor1 ( const QColor &  color)
inline

Sets the first fill color used for the grid frame.

Parameters
colorfirst fill color for grid frame
See also
frameFillColor1
setFramePenColor
setFrameFillColor2
void QgsComposerMapGrid::setFrameFillColor2 ( const QColor &  color)
inline

Sets the second fill color used for the grid frame.

Parameters
colorsecond fill color for grid frame
See also
frameFillColor2
setFramePenColor
setFrameFillColor1
void QgsComposerMapGrid::setFramePenColor ( const QColor &  color)
inline

Sets the color of the outline drawn in the grid frame.

Parameters
colorcolor of grid frame outline
See also
framePenColor
setFramePenSize
setFrameFillColor1
setFrameFillColor2
void QgsComposerMapGrid::setFramePenSize ( const double  width)
inline

Sets the width of the outline drawn in the grid frame.

Parameters
widthwidth of grid frame outline
See also
framePenSize
setFramePenColor
void QgsComposerMapGrid::setFrameSideFlag ( const FrameSideFlag  flag,
bool  on = true 
)

Sets whether the grid frame is drawn for a certain side of the map item.

Parameters
flagflag for grid frame side
onset to true to draw grid frame on that side of the map
See also
setFrameSideFlags
frameSideFlags
testFrameSideFlag
void QgsComposerMapGrid::setFrameSideFlags ( const FrameSideFlags  flags)

Sets flags for grid frame sides.

Setting these flags controls which sides of the map item the grid frame is drawn on.

Parameters
flagsflags for grid frame sides
See also
setFrameSideFlag
frameSideFlags
testFrameSideFlag
void QgsComposerMapGrid::setFrameStyle ( const FrameStyle  style)
inline

Sets the grid frame style.

Parameters
stylestyle for grid frame
See also
frameStyle
void QgsComposerMapGrid::setFrameWidth ( const double  width)
inline

Sets the grid frame width.

This property controls how wide the grid frame is. The size of the line outlines drawn in the frame is controlled through the setFramePenSize method.

Parameters
widthwidth of grid frame in millimetres
See also
frameWidth
void QgsComposerMapGrid::setGridLineColor ( const QColor &  color)

Sets color of grid lines.

This is only used for grids with QgsComposerMapGrid::Solid or QgsComposerMapGrid::Cross styles. For more control over grid line appearance, use setLineSymbol instead.

Parameters
colorcolor of grid lines
See also
setLineSymbol
setGridLineWidth
void QgsComposerMapGrid::setGridLineWidth ( const double  width)

Sets width of grid lines.

This is only used for grids with QgsComposerMapGrid::Solid or QgsComposerMapGrid::Cross styles. For more control over grid line appearance, use setLineSymbol instead.

Parameters
widthgrid line width
See also
setLineSymbol
setGridLineColor
void QgsComposerMapGrid::setIntervalX ( const double  interval)
inline

Sets the interval between grid lines in the x-direction.

The units are controlled through the setUnits method

Parameters
intervalinterval between horizontal grid lines
See also
setIntervalY
intervalX
void QgsComposerMapGrid::setIntervalY ( const double  interval)
inline

Sets the interval between grid lines in the y-direction.

The units are controlled through the setUnits method

Parameters
intervalinterval between vertical grid lines
See also
setIntervalX
intervalY
void QgsComposerMapGrid::setLineSymbol ( QgsLineSymbolV2 symbol)

Sets the line symbol used for drawing grid lines.

This is only used for grids with QgsComposerMapGrid::Solid or QgsComposerMapGrid::Cross styles.

Parameters
symbolline symbol for grid lines
See also
lineSymbol
setMarkerSymbol
setStyle
void QgsComposerMapGrid::setMarkerSymbol ( QgsMarkerSymbolV2 symbol)

Sets the marker symbol used for drawing grid points.

This is only used for grids with a QgsComposerMapGrid::Markers style.

Parameters
symbolmarker symbol for grid intersection points
See also
markerSymbol
setLineSymbol
setStyle
void QgsComposerMapGrid::setName ( const QString &  name)
inline

Sets the friendly display name for the grid.

Parameters
namedisplay name
See also
name
void QgsComposerMapGrid::setOffsetX ( const double  offset)
inline

Sets the offset for grid lines in the x-direction.

The units are controlled through the setUnits method

Parameters
offsetoffset for horizontal grid lines
See also
setOffsetY
offsetX
void QgsComposerMapGrid::setOffsetY ( const double  offset)
inline

Sets the offset for grid lines in the y-direction.

The units are controlled through the setUnits method

Parameters
offsetoffset for vertical grid lines
See also
setOffsetX
offsetY
void QgsComposerMapGrid::setStyle ( const GridStyle  style)
inline

Sets the grid style, which controls how the grid is drawn over the map's contents.

Parameters
styledesired grid style
See also
style
void QgsComposerMapGrid::setUnits ( const GridUnit  unit)
inline

Sets the units to use for grid measurements such as the interval and offset for grid lines.

Parameters
unitunit for grid measurements
See also
units
GridStyle QgsComposerMapGrid::style ( ) const
inline

Gets the grid's style, which controls how the grid is drawn over the map's contents.

Returns
current grid style
See also
setStyle
bool QgsComposerMapGrid::testFrameSideFlag ( const FrameSideFlag  flag) const

Tests whether the grid frame should be drawn on a specified side of the map item.

Parameters
flagflag for grid frame side
Returns
true if grid frame should be drawn for that side of the map
See also
setFrameSideFlags
setFrameSideFlag
frameSideFlags
GridUnit QgsComposerMapGrid::units ( ) const
inline

Gets the units used for grid measurements such as the interval and offset for grid lines.

Returns
for grid measurements
See also
setUnits
bool QgsComposerMapGrid::writeXML ( QDomElement &  elem,
QDomDocument &  doc 
) const

Stores grid state in DOM element.

Parameters
elemis DOM element corresponding to a 'ComposerMap' tag
docDOM document
See also
readXML

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