|
QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
|
An individual grid which is drawn above the map content in a QgsLayoutItemMap. More...
#include <qgslayoutitemmapgrid.h>

Signals | |
| void | crsChanged () |
| Emitted whenever the grid's CRS is changed. | |
| Signals inherited from QgsLayoutObject | |
| void | changed () |
| Emitted when the object's properties change. | |
Public Member Functions | |
| QgsLayoutItemMapGrid (const QString &name, QgsLayoutItemMap *map) | |
| Constructor for QgsLayoutItemMapGrid. | |
| ~QgsLayoutItemMapGrid () override | |
| bool | accept (QgsStyleEntityVisitorInterface *visitor) const override |
| Accepts the specified style entity visitor, causing it to visit all style entities associated with the map item. | |
| Qgis::MapGridAnnotationDirection | annotationDirection (Qgis::MapGridBorderSide border) const |
| Returns the direction for drawing frame annotations, on the specified side of the map. | |
| Qgis::MapGridComponentVisibility | annotationDisplay (Qgis::MapGridBorderSide border) const |
| Returns the display mode for the grid annotations on a specified side of the map frame. | |
| bool | annotationEnabled () const |
| Returns whether annotations are shown for the grid. | |
| QString | annotationExpression () const |
| Returns the expression used for drawing grid annotations. | |
| Q_DECL_DEPRECATED QFont | annotationFont () const |
| Returns the font used for drawing grid annotations. | |
| Q_DECL_DEPRECATED QColor | annotationFontColor () const |
| Returns the font color used for drawing grid annotations. | |
| Qgis::MapGridAnnotationFormat | annotationFormat () const |
| Returns the format for drawing grid annotations. | |
| double | annotationFrameDistance () const |
| Returns the distance between the map frame and annotations. | |
| Qgis::MapGridAnnotationPosition | annotationPosition (Qgis::MapGridBorderSide side) const |
| Returns the position for the grid annotations on a specified side of the map frame. | |
| int | annotationPrecision () const |
| Returns the coordinate precision for grid annotations, which is the number of decimal places shown when drawing grid annotations. | |
| QgsTextFormat | annotationTextFormat () const |
| Returns the text format used when rendering grid annotations. | |
| QPainter::CompositionMode | blendMode () const |
| Retrieves the blending mode used for drawing the grid. | |
| void | calculateMaxExtension (double &top, double &right, double &bottom, double &left) const |
| Calculates the maximum distance the grid extends beyond the QgsLayoutItemMap's item rect. | |
| void | copyProperties (const QgsLayoutItemMapGrid *other) |
| Copies properties from specified map grid. | |
| QgsExpressionContext | createExpressionContext () const override |
| This method needs to be reimplemented in all classes which implement this interface and return an expression context. | |
| double | crossLength () const |
| Retrieves the length (in layout units) of the cross segments drawn for the grid. | |
| QgsCoordinateReferenceSystem | crs () const |
| Retrieves the CRS for the grid. | |
| void | draw (QPainter *painter) override |
| Draws the item on to a destination painter. | |
| Qgis::MapGridComponentVisibility | frameDivisions (Qgis::MapGridBorderSide side) const |
| Returns the type of grid divisions which are used for frames on a specified side of the map. | |
| QColor | frameFillColor1 () const |
| Retrieves the first fill color for the grid frame. | |
| QColor | frameFillColor2 () const |
| Retrieves the second fill color for the grid frame. | |
| double | frameMargin () const |
| Sets the grid frame Margin (in layout units). | |
| QColor | framePenColor () const |
| Retrieves the color of the stroke drawn in the grid frame. | |
| double | framePenSize () const |
| Retrieves the width of the stroke drawn in the grid frame. | |
| Qgis::MapGridFrameSideFlags | frameSideFlags () const |
| Returns the flags which control which sides of the map item the grid frame is drawn on. | |
| Qgis::MapGridFrameStyle | frameStyle () const |
| Returns the grid frame style. | |
| double | frameWidth () const |
| Gets the grid frame width in layout units. | |
| Qgis::TextHorizontalAlignment | horizontalAlignment () const |
| Returns the horizontal alignment for annotation text. | |
| double | intervalX () const |
| Returns the interval between grid lines in the x-direction. | |
| double | intervalY () const |
| Returns the interval between grid lines in the y-direction. | |
| QgsLineSymbol * | lineSymbol () |
| Returns the line symbol used for drawing grid lines. | |
| const QgsLineSymbol * | lineSymbol () const |
| Returns the line symbol used for drawing grid lines. | |
| QgsMarkerSymbol * | markerSymbol () |
| Returns the marker symbol used for drawing grid points. | |
| const QgsMarkerSymbol * | markerSymbol () const |
| Returns the marker symbol used for drawing grid points. | |
| double | maxExtension () const |
| Calculates the maximum distance the grid extends beyond the QgsLayoutItemMap's item rect (in layout units). | |
| double | maximumIntervalWidth () const |
| Returns the maximum width (in millimeters) for grid segments. | |
| double | minimumIntervalWidth () const |
| Returns the minimum width (in millimeters) for grid segments. | |
| double | offsetX () const |
| Returns the offset for grid lines in the x-direction. | |
| double | offsetY () const |
| Returns the offset for grid lines in the y-direction. | |
| bool | readXml (const QDomElement &itemElem, const QDomDocument &doc, const QgsReadWriteContext &context) override |
| Sets the map item state from a DOM document, where element is the DOM node corresponding to a 'LayoutMapGrid' tag. | |
| void | refresh () override |
| Refreshes the object, causing a recalculation of any property overrides. | |
| bool | rotatedAnnotationsEnabled () const |
| Gets whether annotations rotation for rotated or reprojected grids is enabled. | |
| Qgis::MapGridTickLengthMode | rotatedAnnotationsLengthMode () const |
| Returns the annotation length calculation mode. | |
| double | rotatedAnnotationsMarginToCorner () const |
| Gets the margin to corners (in canvas units) below which outwards facing annotations are not drawn. | |
| double | rotatedAnnotationsMinimumAngle () const |
| Gets the minimum angle (in degrees) below which annotations are not drawn. | |
| bool | rotatedTicksEnabled () const |
| Gets whether ticks rotation for rotated or reprojected grids is enabled. | |
| Qgis::MapGridTickLengthMode | rotatedTicksLengthMode () const |
| Returns the grid frame style. | |
| double | rotatedTicksMarginToCorner () const |
| Gets the margin to corners (in canvas units) below which outwards facing ticks are not drawn. | |
| double | rotatedTicksMinimumAngle () const |
| Gets the minimum angle (in degrees) below which ticks are not drawn. | |
| void | setAnnotationDirection (Qgis::MapGridAnnotationDirection direction) |
| Sets the direction for drawing all frame annotations. | |
| void | setAnnotationDirection (Qgis::MapGridAnnotationDirection direction, Qgis::MapGridBorderSide side) |
| Sets the direction for drawing frame annotations for the specified map side. | |
| void | setAnnotationDisplay (Qgis::MapGridComponentVisibility display, Qgis::MapGridBorderSide border) |
| Sets what types of grid annotations should be drawn for a specified side of the map frame, or whether grid annotations should be disabled for the side. | |
| void | setAnnotationEnabled (const bool enabled) |
| Sets whether annotations should be shown for the grid. | |
| void | setAnnotationExpression (const QString &expression) |
| Sets the expression used for drawing grid annotations. | |
| Q_DECL_DEPRECATED void | setAnnotationFont (const QFont &font) |
| Sets the font used for drawing grid annotations. | |
| Q_DECL_DEPRECATED void | setAnnotationFontColor (const QColor &color) |
| Sets the font color used for drawing grid annotations. | |
| void | setAnnotationFormat (const Qgis::MapGridAnnotationFormat format) |
| Sets the format for drawing grid annotations. | |
| void | setAnnotationFrameDistance (const double distance) |
| Sets the distance between the map frame and annotations. | |
| void | setAnnotationPosition (Qgis::MapGridAnnotationPosition position, Qgis::MapGridBorderSide side) |
| Sets the position for the grid annotations on a specified side of the map frame. | |
| void | setAnnotationPrecision (const int precision) |
| Sets the coordinate precision for grid annotations. | |
| void | setAnnotationTextFormat (const QgsTextFormat &format) |
| Sets the text format to use when rendering grid annotations. | |
| void | setBlendMode (const QPainter::CompositionMode mode) |
| Sets the blending mode used for drawing the grid. | |
| void | setCrossLength (const double length) |
| Sets the length (in layout units) of the cross segments drawn for the grid. | |
| void | setCrs (const QgsCoordinateReferenceSystem &crs) |
| Sets the crs for the grid. | |
| void | setEnabled (bool enabled) override |
| Controls whether the item will be drawn. | |
| void | setFrameDivisions (Qgis::MapGridComponentVisibility divisions, Qgis::MapGridBorderSide side) |
| Sets what type of grid divisions should be used for frames on a specified side of the map. | |
| void | setFrameFillColor1 (const QColor &color) |
| Sets the first fill color used for the grid frame. | |
| void | setFrameFillColor2 (const QColor &color) |
| Sets the second fill color used for the grid frame. | |
| void | setFrameMargin (const double margin) |
| Sets the grid frame margin (in layout units). | |
| void | setFramePenColor (const QColor &color) |
| Sets the color of the stroke drawn in the grid frame. | |
| void | setFramePenSize (const double width) |
| Sets the width of the stroke drawn in the grid frame. | |
| void | setFrameSideFlag (Qgis::MapGridFrameSideFlag flag, bool on=true) |
| Sets whether the grid frame is drawn for a certain side of the map item. | |
| void | setFrameSideFlags (Qgis::MapGridFrameSideFlags flags) |
| Sets flags for grid frame sides. | |
| void | setFrameStyle (const Qgis::MapGridFrameStyle style) |
| Sets the grid frame style. | |
| void | setFrameWidth (const double width) |
| Sets the grid frame width (in layout units). | |
| void | setGridLineColor (const QColor &color) |
| Sets the color of grid lines. | |
| void | setGridLineWidth (double width) |
| Sets the width of grid lines (in layout units). | |
| void | setHorizontalAlignment (Qgis::TextHorizontalAlignment alignment) |
| Sets the horizontal alignment for annotation text. | |
| void | setIntervalX (double interval) |
| Sets the interval between grid lines in the x-direction. | |
| void | setIntervalY (double interval) |
| Sets the interval between grid lines in the y-direction. | |
| void | setLineSymbol (QgsLineSymbol *symbol) |
| Sets the line symbol used for drawing grid lines. | |
| void | setMarkerSymbol (QgsMarkerSymbol *symbol) |
| Sets the marker symbol used for drawing grid points. | |
| void | setMaximumIntervalWidth (double width) |
| Sets the maximum width (in millimeters) for grid segments. | |
| void | setMinimumIntervalWidth (double width) |
| Sets the minimum width (in millimeters) for grid segments. | |
| void | setOffsetX (double offset) |
| Sets the offset for grid lines in the x-direction. | |
| void | setOffsetY (double offset) |
| Sets the offset for grid lines in the y-direction. | |
| void | setRotatedAnnotationsEnabled (const bool state) |
| Enable/disable annotations rotation for rotated or reprojected grids. | |
| void | setRotatedAnnotationsLengthMode (const Qgis::MapGridTickLengthMode mode) |
| Sets the annotation length calculation mode. | |
| void | setRotatedAnnotationsMarginToCorner (const double margin) |
| Sets the margin to corners (in canvas units) below which outwards facing annotations are not drawn. | |
| void | setRotatedAnnotationsMinimumAngle (const double angle) |
| Sets the minimum angle (in degrees) below which annotations are not drawn. | |
| void | setRotatedTicksEnabled (const bool state) |
| Enable/disable ticks rotation for rotated or reprojected grids. | |
| void | setRotatedTicksLengthMode (const Qgis::MapGridTickLengthMode mode) |
| Sets the tick length calculation mode. | |
| void | setRotatedTicksMarginToCorner (const double margin) |
| Sets the margin to corners (in canvas units) below which outwards facing ticks are not drawn. | |
| void | setRotatedTicksMinimumAngle (const double angle) |
| Sets the minimum angle (in degrees) below which ticks are not drawn. | |
| void | setStyle (Qgis::MapGridStyle style) |
| Sets the grid style, which controls how the grid is drawn over the map's contents. | |
| void | setUnits (Qgis::MapGridUnit unit) |
| Sets the unit to use for grid measurements such as the interval and offset for grid lines. | |
| Qgis::MapGridStyle | style () const |
| Returns the grid's style, which controls how the grid is drawn over the map's contents. | |
| bool | testFrameSideFlag (Qgis::MapGridFrameSideFlag flag) const |
| Tests whether the grid frame should be drawn on a specified side of the map item. | |
| Qgis::MapGridUnit | units () const |
| Returns the units used for grid measurements such as the interval and offset for grid lines. | |
| bool | usesAdvancedEffects () const override |
Returns true if the item is drawn using advanced effects, such as blend modes. | |
| bool | writeXml (QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context) const override |
| Stores map item state in a DOM element, where element is the DOM element corresponding to a 'LayoutMap' tag. | |
| Public Member Functions inherited from QgsLayoutItemMapItem | |
| QgsLayoutItemMapItem (const QString &name, QgsLayoutItemMap *map) | |
| Constructor for QgsLayoutItemMapItem, attached to the specified map. | |
| QgsExpressionContext | createExpressionContext () const override |
| This method needs to be reimplemented in all classes which implement this interface and return an expression context. | |
| bool | enabled () const |
| Returns whether the item will be drawn. | |
| virtual void | finalizeRestoreFromXml () |
| Called after all pending items have been restored from XML. | |
| QString | id () const |
| Returns the unique id for the map item. | |
| const QgsLayoutItemMap * | map () const |
| Returns the layout item map for the item. | |
| virtual QgsMapLayer * | mapLayer () |
| Returns the internal map layer used by this item, if available. | |
| QString | name () const |
| Returns the friendly display name for the item. | |
| void | setMap (QgsLayoutItemMap *map) |
| Sets the corresponding layout map for the item. | |
| void | setName (const QString &name) |
| Sets the friendly display name for the item. | |
| void | setStackingLayer (QgsMapLayer *layer) |
| Sets the item's stacking layer, which specifies where the in the map's stack the item should be rendered. | |
| void | setStackingPosition (StackingPosition position) |
| Sets the item's stacking position, which specifies where the in the map's stack the item should be rendered. | |
| QgsMapLayer * | stackingLayer () const |
| Returns the item's stacking layer, which specifies where the in the map's stack the item should be rendered. | |
| StackingPosition | stackingPosition () const |
| Returns the item's stacking position, which specifies where the in the map's stack the item should be rendered. | |
| Public Member Functions inherited from QgsLayoutObject | |
| QgsLayoutObject (QgsLayout *layout) | |
| Constructor for QgsLayoutObject, with the specified parent layout. | |
| QgsExpressionContext | createExpressionContext () const override |
| Creates an expression context relating to the objects' current state. | |
| QStringList | customProperties () const |
| Returns list of keys stored in custom properties for the object. | |
| QVariant | customProperty (const QString &key, const QVariant &defaultValue=QVariant()) const |
| Read a custom property from the object. | |
| QgsPropertyCollection & | dataDefinedProperties () |
| Returns a reference to the object's property collection, used for data defined overrides. | |
| const QgsPropertyCollection & | dataDefinedProperties () const |
| Returns a reference to the object's property collection, used for data defined overrides. | |
| QgsLayout * | layout () |
| Returns the layout the object is attached to. | |
| const QgsLayout * | layout () const |
| Returns the layout the object is attached to. | |
| void | removeCustomProperty (const QString &key) |
| Remove a custom property from the object. | |
| void | setCustomProperty (const QString &key, const QVariant &value) |
| Set a custom property for the object. | |
| void | setDataDefinedProperties (const QgsPropertyCollection &collection) |
| Sets the objects's property collection, used for data defined overrides. | |
| Public Member Functions inherited from QgsExpressionContextGenerator | |
| virtual | ~QgsExpressionContextGenerator ()=default |
Friends | |
| class | QgsLayoutItemMap |
| class | TestQgsLayoutMapGrid |
An individual grid which is drawn above the map content in a QgsLayoutItemMap.
Definition at line 138 of file qgslayoutitemmapgrid.h.
| QgsLayoutItemMapGrid::QgsLayoutItemMapGrid | ( | const QString & | name, |
| QgsLayoutItemMap * | map ) |
Constructor for QgsLayoutItemMapGrid.
| name | friendly display name for grid |
| map | QgsLayoutItemMap the grid is attached to |
Definition at line 194 of file qgslayoutitemmapgrid.cpp.
|
overridedefault |
|
overridevirtual |
Accepts the specified style entity visitor, causing it to visit all style entities associated with the map item.
Returns true if the visitor should continue visiting other objects, or false if visiting should be canceled.
Reimplemented from QgsLayoutItemMapItem.
Definition at line 2710 of file qgslayoutitemmapgrid.cpp.
| Qgis::MapGridAnnotationDirection QgsLayoutItemMapGrid::annotationDirection | ( | Qgis::MapGridBorderSide | border | ) | const |
Returns the direction for drawing frame annotations, on the specified side of the map.
Definition at line 2824 of file qgslayoutitemmapgrid.cpp.
| Qgis::MapGridComponentVisibility QgsLayoutItemMapGrid::annotationDisplay | ( | Qgis::MapGridBorderSide | border | ) | const |
Returns the display mode for the grid annotations on a specified side of the map frame.
This property also specifies whether annotations have been disabled from a side of the map frame.
| border | side of map for annotations |
Definition at line 2479 of file qgslayoutitemmapgrid.cpp.
|
inline |
Returns whether annotations are shown for the grid.
Definition at line 445 of file qgslayoutitemmapgrid.h.
|
inline |
Returns the expression used for drawing grid annotations.
This is only used when annotationFormat() is QgsLayoutItemMapGrid::CustomFormat.
Definition at line 597 of file qgslayoutitemmapgrid.h.
| QFont QgsLayoutItemMapGrid::annotationFont | ( | ) | const |
Returns the font used for drawing grid annotations.
Shortcut for annotationTextFormat().font().
Definition at line 2437 of file qgslayoutitemmapgrid.cpp.
| QColor QgsLayoutItemMapGrid::annotationFontColor | ( | ) | const |
Returns the font color used for drawing grid annotations.
Shortcut for annotationTextFormat().color() and annotationTextFormat().opacity().
Definition at line 2447 of file qgslayoutitemmapgrid.cpp.
|
inline |
Returns the format for drawing grid annotations.
Definition at line 583 of file qgslayoutitemmapgrid.h.
|
inline |
Returns the distance between the map frame and annotations.
Units are in layout units.
Definition at line 552 of file qgslayoutitemmapgrid.h.
| Qgis::MapGridAnnotationPosition QgsLayoutItemMapGrid::annotationPosition | ( | Qgis::MapGridBorderSide | side | ) | const |
Returns the position for the grid annotations on a specified side of the map frame.
Definition at line 2802 of file qgslayoutitemmapgrid.cpp.
|
inline |
Returns the coordinate precision for grid annotations, which is the number of decimal places shown when drawing grid annotations.
Definition at line 507 of file qgslayoutitemmapgrid.h.
|
inline |
Returns the text format used when rendering grid annotations.
Definition at line 461 of file qgslayoutitemmapgrid.h.
|
inline |
Retrieves the blending mode used for drawing the grid.
Definition at line 177 of file qgslayoutitemmapgrid.h.
| void QgsLayoutItemMapGrid::calculateMaxExtension | ( | double & | top, |
| double & | right, | ||
| double & | bottom, | ||
| double & | left ) const |
Calculates the maximum distance the grid extends beyond the QgsLayoutItemMap's item rect.
This method calculates the distance for each side of the map item separately.
Definition at line 2505 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::copyProperties | ( | const QgsLayoutItemMapGrid * | other | ) |
Copies properties from specified map grid.
Definition at line 2963 of file qgslayoutitemmapgrid.cpp.
|
overridevirtual |
This method needs to be reimplemented in all classes which implement this interface and return an expression context.
Implements QgsExpressionContextGenerator.
Definition at line 2700 of file qgslayoutitemmapgrid.cpp.
|
inline |
Retrieves the length (in layout units) of the cross segments drawn for the grid.
This is only used for grids with QgsLayoutItemMapGrid::Cross styles.
Definition at line 353 of file qgslayoutitemmapgrid.h.
|
inline |
Retrieves the CRS for the grid.
Definition at line 165 of file qgslayoutitemmapgrid.h.
|
signal |
Emitted whenever the grid's CRS is changed.
|
overridevirtual |
Draws the item on to a destination painter.
Implements QgsLayoutItemMapItem.
Definition at line 642 of file qgslayoutitemmapgrid.cpp.
| Qgis::MapGridComponentVisibility QgsLayoutItemMapGrid::frameDivisions | ( | Qgis::MapGridBorderSide | side | ) | const |
Returns the type of grid divisions which are used for frames on a specified side of the map.
Definition at line 2877 of file qgslayoutitemmapgrid.cpp.
|
inline |
Retrieves the first fill color for the grid frame.
Definition at line 856 of file qgslayoutitemmapgrid.h.
|
inline |
Retrieves the second fill color for the grid frame.
Definition at line 872 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the grid frame Margin (in layout units).
This property controls distance between the map frame and the grid frame.
Definition at line 808 of file qgslayoutitemmapgrid.h.
|
inline |
Retrieves the color of the stroke drawn in the grid frame.
Definition at line 840 of file qgslayoutitemmapgrid.h.
|
inline |
Retrieves the width of the stroke drawn in the grid frame.
Definition at line 822 of file qgslayoutitemmapgrid.h.
| Qgis::MapGridFrameSideFlags QgsLayoutItemMapGrid::frameSideFlags | ( | ) | const |
Returns the flags which control which sides of the map item the grid frame is drawn on.
Definition at line 2695 of file qgslayoutitemmapgrid.cpp.
|
inline |
Returns the grid frame style.
Definition at line 613 of file qgslayoutitemmapgrid.h.
|
inline |
Gets the grid frame width in layout units.
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.
Definition at line 680 of file qgslayoutitemmapgrid.h.
| Qgis::TextHorizontalAlignment QgsLayoutItemMapGrid::horizontalAlignment | ( | ) | const |
Returns the horizontal alignment for annotation text.
Definition at line 2759 of file qgslayoutitemmapgrid.cpp.
|
inline |
Returns the interval between grid lines in the x-direction.
The units are retrieved through the units() method.
Definition at line 229 of file qgslayoutitemmapgrid.h.
|
inline |
Returns the interval between grid lines in the y-direction.
The units are retrieved through the units() method.
Definition at line 245 of file qgslayoutitemmapgrid.h.
| QgsLineSymbol * QgsLayoutItemMapGrid::lineSymbol | ( | ) |
Returns the line symbol used for drawing grid lines.
This is only used for grids with QgsLayoutItemMapGrid::Solid or QgsLayoutItemMapGrid::Cross styles.
Definition at line 2402 of file qgslayoutitemmapgrid.cpp.
| const QgsLineSymbol * QgsLayoutItemMapGrid::lineSymbol | ( | ) | const |
Returns the line symbol used for drawing grid lines.
This is only used for grids with QgsLayoutItemMapGrid::Solid or QgsLayoutItemMapGrid::Cross styles.
Definition at line 2397 of file qgslayoutitemmapgrid.cpp.
| QgsMarkerSymbol * QgsLayoutItemMapGrid::markerSymbol | ( | ) |
Returns the marker symbol used for drawing grid points.
This is only used for grids with a QgsLayoutItemMapGrid::Markers style.
Definition at line 2417 of file qgslayoutitemmapgrid.cpp.
| const QgsMarkerSymbol * QgsLayoutItemMapGrid::markerSymbol | ( | ) | const |
Returns the marker symbol used for drawing grid points.
This is only used for grids with a QgsLayoutItemMapGrid::Markers style.
Definition at line 2412 of file qgslayoutitemmapgrid.cpp.
| double QgsLayoutItemMapGrid::maxExtension | ( | ) | const |
Calculates the maximum distance the grid extends beyond the QgsLayoutItemMap's item rect (in layout units).
Definition at line 2495 of file qgslayoutitemmapgrid.cpp.
|
inline |
Returns the maximum width (in millimeters) for grid segments.
This property is only effective if the units() is set to DynamicPageSizeBased.
Definition at line 310 of file qgslayoutitemmapgrid.h.
|
inline |
Returns the minimum width (in millimeters) for grid segments.
This property is only effective if the units() is set to DynamicPageSizeBased.
Definition at line 288 of file qgslayoutitemmapgrid.h.
|
inline |
Returns the offset for grid lines in the x-direction.
The units are retrieved through the units() method.
Definition at line 261 of file qgslayoutitemmapgrid.h.
|
inline |
Returns the offset for grid lines in the y-direction.
The units are retrieved through the units() method.
Definition at line 277 of file qgslayoutitemmapgrid.h.
|
overridevirtual |
Sets the map item state from a DOM document, where element is the DOM node corresponding to a 'LayoutMapGrid' tag.
Reimplemented from QgsLayoutItemMapItem.
Definition at line 338 of file qgslayoutitemmapgrid.cpp.
|
overridevirtual |
Refreshes the object, causing a recalculation of any property overrides.
Reimplemented from QgsLayoutObject.
Definition at line 2728 of file qgslayoutitemmapgrid.cpp.
|
inline |
Gets whether annotations rotation for rotated or reprojected grids is enabled.
Definition at line 750 of file qgslayoutitemmapgrid.h.
|
inline |
Returns the annotation length calculation mode.
Definition at line 764 of file qgslayoutitemmapgrid.h.
|
inline |
Gets the margin to corners (in canvas units) below which outwards facing annotations are not drawn.
Definition at line 792 of file qgslayoutitemmapgrid.h.
|
inline |
Gets the minimum angle (in degrees) below which annotations are not drawn.
Definition at line 778 of file qgslayoutitemmapgrid.h.
|
inline |
Gets whether ticks rotation for rotated or reprojected grids is enabled.
Definition at line 694 of file qgslayoutitemmapgrid.h.
|
inline |
Returns the grid frame style.
Definition at line 708 of file qgslayoutitemmapgrid.h.
|
inline |
Gets the margin to corners (in canvas units) below which outwards facing ticks are not drawn.
Definition at line 736 of file qgslayoutitemmapgrid.h.
|
inline |
Gets the minimum angle (in degrees) below which ticks are not drawn.
Definition at line 722 of file qgslayoutitemmapgrid.h.
| void QgsLayoutItemMapGrid::setAnnotationDirection | ( | Qgis::MapGridAnnotationDirection | direction | ) |
Sets the direction for drawing all frame annotations.
Definition at line 2769 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setAnnotationDirection | ( | Qgis::MapGridAnnotationDirection | direction, |
| Qgis::MapGridBorderSide | side ) |
Sets the direction for drawing frame annotations for the specified map side.
Definition at line 2660 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setAnnotationDisplay | ( | Qgis::MapGridComponentVisibility | display, |
| Qgis::MapGridBorderSide | border ) |
Sets what types of grid annotations should be drawn for a specified side of the map frame, or whether grid annotations should be disabled for the side.
| display | display mode for annotations |
| border | side of map for annotations |
Definition at line 2452 of file qgslayoutitemmapgrid.cpp.
|
inline |
Sets whether annotations should be shown for the grid.
Definition at line 439 of file qgslayoutitemmapgrid.h.
| void QgsLayoutItemMapGrid::setAnnotationExpression | ( | const QString & | expression | ) |
Sets the expression used for drawing grid annotations.
This is only used when annotationFormat() is QgsLayoutItemMapGrid::CustomFormat.
Definition at line 2845 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setAnnotationFont | ( | const QFont & | font | ) |
Sets the font used for drawing grid annotations.
Shortcut for annotationTextFormat().setFont().
Definition at line 2422 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setAnnotationFontColor | ( | const QColor & | color | ) |
Sets the font color used for drawing grid annotations.
Shortcut for annotationTextFormat().setColor() and annotationTextFormat().setOpacity().
Definition at line 2442 of file qgslayoutitemmapgrid.cpp.
|
inline |
Sets the format for drawing grid annotations.
Definition at line 577 of file qgslayoutitemmapgrid.h.
| void QgsLayoutItemMapGrid::setAnnotationFrameDistance | ( | const double | distance | ) |
Sets the distance between the map frame and annotations.
Units are layout units.
Definition at line 2818 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setAnnotationPosition | ( | Qgis::MapGridAnnotationPosition | position, |
| Qgis::MapGridBorderSide | side ) |
Sets the position for the grid annotations on a specified side of the map frame.
Definition at line 2777 of file qgslayoutitemmapgrid.cpp.
|
inline |
Sets the coordinate precision for grid annotations.
The precision indicates the number of decimal places to show when drawing grid annotations.
Definition at line 500 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the text format to use when rendering grid annotations.
Definition at line 453 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the blending mode used for drawing the grid.
Definition at line 171 of file qgslayoutitemmapgrid.h.
| void QgsLayoutItemMapGrid::setCrossLength | ( | const double | length | ) |
Sets the length (in layout units) of the cross segments drawn for the grid.
This is only used for grids with QgsLayoutItemMapGrid::Cross styles.
Definition at line 2654 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setCrs | ( | const QgsCoordinateReferenceSystem & | crs | ) |
|
overridevirtual |
Controls whether the item will be drawn.
Set enabled to true to enable drawing of the item.
Reimplemented from QgsLayoutItemMapItem.
Definition at line 2562 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setFrameDivisions | ( | Qgis::MapGridComponentVisibility | divisions, |
| Qgis::MapGridBorderSide | side ) |
Sets what type of grid divisions should be used for frames on a specified side of the map.
Definition at line 2851 of file qgslayoutitemmapgrid.cpp.
|
inline |
Sets the first fill color used for the grid frame.
Definition at line 848 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the second fill color used for the grid frame.
Definition at line 864 of file qgslayoutitemmapgrid.h.
| void QgsLayoutItemMapGrid::setFrameMargin | ( | const double | margin | ) |
Sets the grid frame margin (in layout units).
This property controls distance between the map frame and the grid frame.
Definition at line 2747 of file qgslayoutitemmapgrid.cpp.
|
inline |
Sets the color of the stroke drawn in the grid frame.
Definition at line 831 of file qgslayoutitemmapgrid.h.
| void QgsLayoutItemMapGrid::setFramePenSize | ( | const double | width | ) |
Sets the width of the stroke drawn in the grid frame.
Definition at line 2753 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setFrameSideFlag | ( | Qgis::MapGridFrameSideFlag | flag, |
| bool | on = true ) |
Sets whether the grid frame is drawn for a certain side of the map item.
| flag | flag for grid frame side |
| on | set to true to draw grid frame on that side of the map |
Definition at line 2690 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setFrameSideFlags | ( | Qgis::MapGridFrameSideFlags | flags | ) |
Sets flags for grid frame sides.
Setting these flags controls which sides of the map item the grid frame is drawn on.
Definition at line 2685 of file qgslayoutitemmapgrid.cpp.
|
inline |
Sets the grid frame style.
Definition at line 607 of file qgslayoutitemmapgrid.h.
| void QgsLayoutItemMapGrid::setFrameWidth | ( | const double | width | ) |
Sets the grid frame width (in layout units).
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.
Definition at line 2741 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setGridLineColor | ( | const QColor & | color | ) |
Sets the color of grid lines.
This is only used for grids with QgsLayoutItemMapGrid::Solid or QgsLayoutItemMapGrid::Cross styles. For more control over grid line appearance, use setLineSymbol instead.
Definition at line 247 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setGridLineWidth | ( | double | width | ) |
Sets the width of grid lines (in layout units).
This is only used for grids with QgsLayoutItemMapGrid::Solid or QgsLayoutItemMapGrid::Cross styles. For more control over grid line appearance, use setLineSymbol instead.
Definition at line 239 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setHorizontalAlignment | ( | Qgis::TextHorizontalAlignment | alignment | ) |
Sets the horizontal alignment for annotation text.
Definition at line 2764 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setIntervalX | ( | double | interval | ) |
Sets the interval between grid lines in the x-direction.
The units are controlled through the setUnits method
Definition at line 2578 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setIntervalY | ( | double | interval | ) |
Sets the interval between grid lines in the y-direction.
The units are controlled through the setUnits method
Definition at line 2589 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setLineSymbol | ( | QgsLineSymbol * | symbol | ) |
Sets the line symbol used for drawing grid lines.
This is only used for grids with QgsLayoutItemMapGrid::Solid or QgsLayoutItemMapGrid::Cross styles. Ownership of symbol is transferred to the grid.
Definition at line 2392 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setMarkerSymbol | ( | QgsMarkerSymbol * | symbol | ) |
Sets the marker symbol used for drawing grid points.
This is only used for grids with a QgsLayoutItemMapGrid::Markers style. Ownership of symbol is transferred to the grid.
Definition at line 2407 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setMaximumIntervalWidth | ( | double | width | ) |
Sets the maximum width (in millimeters) for grid segments.
This property is only effective if the units() is set to DynamicPageSizeBased.
Definition at line 2633 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setMinimumIntervalWidth | ( | double | width | ) |
Sets the minimum width (in millimeters) for grid segments.
This property is only effective if the units() is set to DynamicPageSizeBased.
Definition at line 2622 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setOffsetX | ( | double | offset | ) |
Sets the offset for grid lines in the x-direction.
The units are controlled through the setUnits method.
Definition at line 2600 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setOffsetY | ( | double | offset | ) |
Sets the offset for grid lines in the y-direction.
The units are controlled through the setUnits method.
Definition at line 2611 of file qgslayoutitemmapgrid.cpp.
|
inline |
Enable/disable annotations rotation for rotated or reprojected grids.
Definition at line 743 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the annotation length calculation mode.
Definition at line 757 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the margin to corners (in canvas units) below which outwards facing annotations are not drawn.
Definition at line 785 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the minimum angle (in degrees) below which annotations are not drawn.
Definition at line 771 of file qgslayoutitemmapgrid.h.
|
inline |
Enable/disable ticks rotation for rotated or reprojected grids.
Definition at line 687 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the tick length calculation mode.
Definition at line 701 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the margin to corners (in canvas units) below which outwards facing ticks are not drawn.
Definition at line 729 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the minimum angle (in degrees) below which ticks are not drawn.
Definition at line 715 of file qgslayoutitemmapgrid.h.
| void QgsLayoutItemMapGrid::setStyle | ( | Qgis::MapGridStyle | style | ) |
Sets the grid style, which controls how the grid is drawn over the map's contents.
Definition at line 2644 of file qgslayoutitemmapgrid.cpp.
| void QgsLayoutItemMapGrid::setUnits | ( | Qgis::MapGridUnit | unit | ) |
Sets the unit to use for grid measurements such as the interval and offset for grid lines.
Definition at line 2568 of file qgslayoutitemmapgrid.cpp.
|
inline |
Returns the grid's style, which controls how the grid is drawn over the map's contents.
Definition at line 339 of file qgslayoutitemmapgrid.h.
| bool QgsLayoutItemMapGrid::testFrameSideFlag | ( | Qgis::MapGridFrameSideFlag | flag | ) | const |
Tests whether the grid frame should be drawn on a specified side of the map item.
| flag | flag for grid frame side |
true if grid frame should be drawn for that side of the map Definition at line 2736 of file qgslayoutitemmapgrid.cpp.
|
inline |
Returns the units used for grid measurements such as the interval and offset for grid lines.
Definition at line 213 of file qgslayoutitemmapgrid.h.
|
overridevirtual |
Returns true if the item is drawn using advanced effects, such as blend modes.
Reimplemented from QgsLayoutItemMapItem.
Definition at line 469 of file qgslayoutitemmapgrid.cpp.
|
overridevirtual |
Stores map item state in a DOM element, where element is the DOM element corresponding to a 'LayoutMap' tag.
Reimplemented from QgsLayoutItemMapItem.
Definition at line 255 of file qgslayoutitemmapgrid.cpp.
|
friend |
Definition at line 1201 of file qgslayoutitemmapgrid.h.
|
friend |
Definition at line 1198 of file qgslayoutitemmapgrid.h.