QGIS API Documentation
3.2.0-Bonn (bc43194)
|
An individual grid which is drawn above the map content in a QgsLayoutItemMap. More...
#include <qgslayoutitemmapgrid.h>
Public Member Functions | |
QgsLayoutItemMapGrid (const QString &name, QgsLayoutItemMap *map) | |
Constructor for QgsLayoutItemMapGrid. More... | |
AnnotationDirection | annotationDirection (BorderSide border) const |
Returns the direction for drawing frame annotations, on the specified side of the map. More... | |
DisplayMode | annotationDisplay (BorderSide border) const |
Returns the display mode for the grid annotations on a specified side of the map frame. More... | |
bool | annotationEnabled () const |
Returns whether annotations are shown for the grid. More... | |
QString | annotationExpression () const |
Returns the expression used for drawing grid annotations. More... | |
QFont | annotationFont () const |
Returns the font used for drawing grid annotations. More... | |
QColor | annotationFontColor () const |
Returns the font color used for drawing grid annotations. More... | |
AnnotationFormat | annotationFormat () const |
Returns the format for drawing grid annotations. More... | |
double | annotationFrameDistance () const |
Returns the distance between the map frame and annotations. More... | |
AnnotationPosition | annotationPosition (BorderSide side) const |
Returns the position for the grid annotations on a specified side of the map frame. More... | |
int | annotationPrecision () const |
Returns the coordinate precision for grid annotations, which is the number of decimal places shown when drawing grid annotations. More... | |
QPainter::CompositionMode | blendMode () const |
Retrieves the blending mode used for drawing the grid. More... | |
void | calculateMaxExtension (double &top, double &right, double &bottom, double &left) const |
Calculates the maximum distance the grid extends beyond the QgsLayoutItemMap's item rect. More... | |
QgsExpressionContext | createExpressionContext () const override |
This method needs to be reimplemented in all classes which implement this interface and return an expression context. More... | |
double | crossLength () const |
Retrieves the length (in layout units) of the cross segments drawn for the grid. More... | |
QgsCoordinateReferenceSystem | crs () const |
Retrieves the CRS for the grid. More... | |
void | draw (QPainter *painter) override |
Draws the item on to a destination painter. More... | |
DisplayMode | frameDivisions (BorderSide side) const |
Returns the type of grid divisions which are used for frames on a specified side of the map. More... | |
QColor | frameFillColor1 () const |
Retrieves the first fill color for the grid frame. More... | |
QColor | frameFillColor2 () const |
Retrieves the second fill color for the grid frame. More... | |
QColor | framePenColor () const |
Retrieves the color of the stroke drawn in the grid frame. More... | |
double | framePenSize () const |
Retrieves the width of the stroke drawn in the grid frame. More... | |
QgsLayoutItemMapGrid::FrameSideFlags | frameSideFlags () const |
Returns the flags which control which sides of the map item the grid frame is drawn on. More... | |
FrameStyle | frameStyle () const |
Returns the grid frame style. More... | |
double | frameWidth () const |
Gets the grid frame width in layout units. More... | |
double | intervalX () const |
Returns the interval between grid lines in the x-direction. More... | |
double | intervalY () const |
Returns the interval between grid lines in the y-direction. More... | |
const QgsLineSymbol * | lineSymbol () const |
Returns the line symbol used for drawing grid lines. More... | |
QgsLineSymbol * | lineSymbol () |
Returns the line symbol used for drawing grid lines. More... | |
const QgsMarkerSymbol * | markerSymbol () const |
Returns the marker symbol used for drawing grid points. More... | |
QgsMarkerSymbol * | markerSymbol () |
Returns the marker symbol used for drawing grid points. More... | |
double | maxExtension () const |
Calculates the maximum distance the grid extends beyond the QgsLayoutItemMap's item rect (in layout units). More... | |
double | offsetX () const |
Returns the offset for grid lines in the x-direction. More... | |
double | offsetY () const |
Returns the offset for grid lines in the y-direction. More... | |
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. More... | |
void | setAnnotationDirection (AnnotationDirection direction, BorderSide side) |
Sets the direction for drawing frame annotations for the specified map side. More... | |
void | setAnnotationDirection (AnnotationDirection direction) |
Sets the direction for drawing all frame annotations. More... | |
void | setAnnotationDisplay (DisplayMode display, BorderSide 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. More... | |
void | setAnnotationEnabled (const bool enabled) |
Sets whether annotations should be shown for the grid. More... | |
void | setAnnotationExpression (const QString &expression) |
Sets the expression used for drawing grid annotations. More... | |
void | setAnnotationFont (const QFont &font) |
Sets the font used for drawing grid annotations. More... | |
void | setAnnotationFontColor (const QColor &color) |
Sets the font color used for drawing grid annotations. More... | |
void | setAnnotationFormat (const AnnotationFormat format) |
Sets the format for drawing grid annotations. More... | |
void | setAnnotationFrameDistance (const double distance) |
Sets the distance between the map frame and annotations. More... | |
void | setAnnotationPosition (AnnotationPosition position, BorderSide side) |
Sets the position for the grid annotations on a specified side of the map frame. More... | |
void | setAnnotationPrecision (const int precision) |
Sets the coordinate precision for grid annotations. More... | |
void | setBlendMode (const QPainter::CompositionMode mode) |
Sets the blending mode used for drawing the grid. More... | |
void | setCrossLength (const double length) |
Sets the length (in layout units) of the cross segments drawn for the grid. More... | |
void | setCrs (const QgsCoordinateReferenceSystem &crs) |
Sets the crs for the grid. More... | |
void | setFrameDivisions (DisplayMode divisions, BorderSide side) |
Sets what type of grid divisions should be used for frames on a specified side of the map. More... | |
void | setFrameFillColor1 (const QColor &color) |
Sets the first fill color used for the grid frame. More... | |
void | setFrameFillColor2 (const QColor &color) |
Sets the second fill color used for the grid frame. More... | |
void | setFramePenColor (const QColor &color) |
Sets the color of the stroke drawn in the grid frame. More... | |
void | setFramePenSize (const double width) |
Sets the width of the stroke drawn in the grid frame. More... | |
void | setFrameSideFlag (QgsLayoutItemMapGrid::FrameSideFlag flag, bool on=true) |
Sets whether the grid frame is drawn for a certain side of the map item. More... | |
void | setFrameSideFlags (QgsLayoutItemMapGrid::FrameSideFlags flags) |
Sets flags for grid frame sides. More... | |
void | setFrameStyle (const FrameStyle style) |
Sets the grid frame style. More... | |
void | setFrameWidth (const double width) |
Sets the grid frame width (in layout units). More... | |
void | setGridLineColor (const QColor &color) |
Sets the color of grid lines. More... | |
void | setGridLineWidth (double width) |
Sets the width of grid lines (in layout units). More... | |
void | setIntervalX (double interval) |
Sets the interval between grid lines in the x-direction. More... | |
void | setIntervalY (double interval) |
Sets the interval between grid lines in the y-direction. More... | |
void | setLineSymbol (QgsLineSymbol *symbol) |
Sets the line symbol used for drawing grid lines. More... | |
void | setMarkerSymbol (QgsMarkerSymbol *symbol) |
Sets the marker symbol used for drawing grid points. More... | |
void | setOffsetX (double offset) |
Sets the offset for grid lines in the x-direction. More... | |
void | setOffsetY (double offset) |
Sets the offset for grid lines in the y-direction. More... | |
void | setStyle (GridStyle style) |
Sets the grid style, which controls how the grid is drawn over the map's contents. More... | |
void | setUnits (GridUnit unit) |
Sets the unit to use for grid measurements such as the interval and offset for grid lines. More... | |
GridStyle | style () const |
Returns the grid's style, which controls how the grid is drawn over the map's contents. More... | |
bool | testFrameSideFlag (FrameSideFlag flag) const |
Tests whether the grid frame should be drawn on a specified side of the map item. More... | |
GridUnit | units () const |
Returns the units used for grid measurements such as the interval and offset for grid lines. More... | |
bool | usesAdvancedEffects () const override |
Returns true if the item is drawn using advanced effects, such as blend modes. More... | |
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. More... | |
Public Member Functions inherited from QgsLayoutItemMapItem | |
QgsLayoutItemMapItem (const QString &name, QgsLayoutItemMap *map) | |
Constructor for QgsLayoutItemMapItem, attached to the specified map. More... | |
bool | enabled () const |
Returns whether the item will be drawn. More... | |
virtual void | finalizeRestoreFromXml () |
Called after all pending items have been restored from XML. More... | |
QString | id () const |
Returns the unique id for the map item. More... | |
const QgsLayoutItemMap * | map () const |
Returns the layout item map for the item. More... | |
QString | name () const |
Returns the friendly display name for the item. More... | |
void | setEnabled (bool enabled) |
Controls whether the item will be drawn. More... | |
void | setMap (QgsLayoutItemMap *map) |
Sets the corresponding layout map for the item. More... | |
void | setName (const QString &name) |
Sets the friendly display name for the item. More... | |
Public Member Functions inherited from QgsLayoutObject | |
QgsLayoutObject (QgsLayout *layout) | |
Constructor for QgsLayoutObject, with the specified parent layout. More... | |
QgsExpressionContext | createExpressionContext () const override |
Creates an expression context relating to the objects' current state. More... | |
QStringList | customProperties () const |
Returns 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... | |
QgsPropertyCollection & | dataDefinedProperties () |
Returns a reference to the object's property collection, used for data defined overrides. More... | |
const QgsPropertyCollection & | dataDefinedProperties () const |
Returns a reference to the object's property collection, used for data defined overrides. More... | |
const QgsLayout * | layout () const |
Returns the layout the object is attached to. More... | |
QgsLayout * | layout () |
Returns the layout the object is attached to. 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 | setDataDefinedProperties (const QgsPropertyCollection &collection) |
Sets the objects's property collection, used for data defined overrides. More... | |
Public Member Functions inherited from QgsExpressionContextGenerator | |
virtual | ~QgsExpressionContextGenerator ()=default |
Friends | |
class | TestQgsLayoutMapGrid |
Additional Inherited Members | |
Public Slots inherited from QgsLayoutObject | |
virtual void | refresh () |
Refreshes the object, causing a recalculation of any property overrides. More... | |
Signals inherited from QgsLayoutObject | |
void | changed () |
Emitted when the object's properties change. More... | |
Static Public Member Functions inherited from QgsLayoutObject | |
static const QgsPropertiesDefinition & | propertyDefinitions () |
Returns the layout object property definitions. More... | |
Protected Member Functions inherited from QgsLayoutObject | |
bool | readObjectPropertiesFromElement (const QDomElement &parentElement, const QDomDocument &document, const QgsReadWriteContext &context) |
Sets object properties from a DOM element. More... | |
bool | writeObjectPropertiesToElement (QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const |
Stores object properties within an XML DOM element. More... | |
Protected Attributes inherited from QgsLayoutItemMapItem | |
bool | mEnabled |
True if item is to be displayed on map. More... | |
QgsLayoutItemMap * | mMap = nullptr |
Associated map. More... | |
QString | mName |
Friendly display name. More... | |
QString | mUuid |
Unique id. More... | |
Protected Attributes inherited from QgsLayoutObject | |
QgsObjectCustomProperties | mCustomProperties |
Custom properties for object. More... | |
QgsPropertyCollection | mDataDefinedProperties |
QPointer< QgsLayout > | mLayout |
An individual grid which is drawn above the map content in a QgsLayoutItemMap.
Definition at line 139 of file qgslayoutitemmapgrid.h.
Annotation coordinate type.
Enumerator | |
---|---|
Longitude | Coordinate is a longitude value. |
Latitude | Coordinate is a latitude value. |
Definition at line 253 of file qgslayoutitemmapgrid.h.
Direction of grid annotations.
Definition at line 190 of file qgslayoutitemmapgrid.h.
Format for displaying grid annotations.
Definition at line 201 of file qgslayoutitemmapgrid.h.
Position for grid annotations.
Enumerator | |
---|---|
InsideMapFrame | Draw annotations inside the map frame. |
OutsideMapFrame | Draw annotations outside the map frame. |
Definition at line 181 of file qgslayoutitemmapgrid.h.
Border sides for annotations.
Enumerator | |
---|---|
Left | Left border. |
Right | Right border. |
Bottom | Bottom border. |
Top | Top border. |
Definition at line 217 of file qgslayoutitemmapgrid.h.
Display settings for grid annotations and frames.
Definition at line 170 of file qgslayoutitemmapgrid.h.
Flags for controlling which side of the map a frame is drawn on.
Enumerator | |
---|---|
FrameLeft | Left side of map. |
FrameRight | Right side of map. |
FrameTop | Top side of map. |
FrameBottom | Bottom side of map. |
Definition at line 241 of file qgslayoutitemmapgrid.h.
Style for grid frame.
Definition at line 228 of file qgslayoutitemmapgrid.h.
Grid drawing style.
Definition at line 159 of file qgslayoutitemmapgrid.h.
Unit for grid values.
Enumerator | |
---|---|
MapUnit | Grid units follow map units. |
MM | Grid units in millimeters. |
CM | Grid units in centimeters. |
Definition at line 149 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 158 of file qgslayoutitemmapgrid.cpp.
QgsLayoutItemMapGrid::AnnotationDirection QgsLayoutItemMapGrid::annotationDirection | ( | BorderSide | border | ) | const |
Returns the direction for drawing frame annotations, on the specified side of the map.
Definition at line 2229 of file qgslayoutitemmapgrid.cpp.
QgsLayoutItemMapGrid::DisplayMode QgsLayoutItemMapGrid::annotationDisplay | ( | const QgsLayoutItemMapGrid::BorderSide | 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 1985 of file qgslayoutitemmapgrid.cpp.
|
inline |
Returns whether annotations are shown for the grid.
Definition at line 514 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 642 of file qgslayoutitemmapgrid.h.
|
inline |
Returns the font used for drawing grid annotations.
Definition at line 526 of file qgslayoutitemmapgrid.h.
|
inline |
Returns the font color used for drawing grid annotations.
Definition at line 538 of file qgslayoutitemmapgrid.h.
|
inline |
Returns the format for drawing grid annotations.
Definition at line 628 of file qgslayoutitemmapgrid.h.
|
inline |
Returns the distance between the map frame and annotations.
Units are in layout units.
Definition at line 597 of file qgslayoutitemmapgrid.h.
QgsLayoutItemMapGrid::AnnotationPosition QgsLayoutItemMapGrid::annotationPosition | ( | const QgsLayoutItemMapGrid::BorderSide | border | ) | const |
Returns the position for the grid annotations on a specified side of the map frame.
Definition at line 2213 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 552 of file qgslayoutitemmapgrid.h.
|
inline |
Retrieves the blending mode used for drawing the grid.
Definition at line 292 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 2011 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 2163 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 422 of file qgslayoutitemmapgrid.h.
|
inline |
Retrieves the CRS for the grid.
Definition at line 280 of file qgslayoutitemmapgrid.h.
|
overridevirtual |
Draws the item on to a destination painter.
Implements QgsLayoutItemMapItem.
Definition at line 544 of file qgslayoutitemmapgrid.cpp.
QgsLayoutItemMapGrid::DisplayMode QgsLayoutItemMapGrid::frameDivisions | ( | const QgsLayoutItemMapGrid::BorderSide | border | ) | const |
Returns the type of grid divisions which are used for frames on a specified side of the map.
Definition at line 2276 of file qgslayoutitemmapgrid.cpp.
|
inline |
Retrieves the first fill color for the grid frame.
Definition at line 773 of file qgslayoutitemmapgrid.h.
|
inline |
Retrieves the second fill color for the grid frame.
Definition at line 789 of file qgslayoutitemmapgrid.h.
|
inline |
Retrieves the color of the stroke drawn in the grid frame.
Definition at line 757 of file qgslayoutitemmapgrid.h.
|
inline |
Retrieves the width of the stroke drawn in the grid frame.
Definition at line 739 of file qgslayoutitemmapgrid.h.
QgsLayoutItemMapGrid::FrameSideFlags QgsLayoutItemMapGrid::frameSideFlags | ( | ) | const |
Returns the flags which control which sides of the map item the grid frame is drawn on.
Definition at line 2158 of file qgslayoutitemmapgrid.cpp.
|
inline |
Returns the grid frame style.
Definition at line 658 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 725 of file qgslayoutitemmapgrid.h.
|
inline |
Returns the interval between grid lines in the x-direction.
The units are retrieved through the units() method.
Definition at line 342 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 358 of file qgslayoutitemmapgrid.h.
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 1933 of file qgslayoutitemmapgrid.cpp.
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 1938 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 1948 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 1953 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 2001 of file qgslayoutitemmapgrid.cpp.
|
inline |
Returns the offset for grid lines in the x-direction.
The units are retrieved through the units() method.
Definition at line 374 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 390 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 277 of file qgslayoutitemmapgrid.cpp.
void QgsLayoutItemMapGrid::setAnnotationDirection | ( | const QgsLayoutItemMapGrid::AnnotationDirection | direction, |
const QgsLayoutItemMapGrid::BorderSide | border | ||
) |
Sets the direction for drawing frame annotations for the specified map side.
Definition at line 2118 of file qgslayoutitemmapgrid.cpp.
void QgsLayoutItemMapGrid::setAnnotationDirection | ( | AnnotationDirection | direction | ) |
Sets the direction for drawing all frame annotations.
Definition at line 2178 of file qgslayoutitemmapgrid.cpp.
void QgsLayoutItemMapGrid::setAnnotationDisplay | ( | const QgsLayoutItemMapGrid::DisplayMode | display, |
const QgsLayoutItemMapGrid::BorderSide | 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 1958 of file qgslayoutitemmapgrid.cpp.
|
inline |
Sets whether annotations should be shown for the grid.
Definition at line 508 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the expression used for drawing grid annotations.
This is only used when annotationFormat() is QgsLayoutItemMapGrid::CustomFormat.
Definition at line 635 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the font used for drawing grid annotations.
Definition at line 520 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the font color used for drawing grid annotations.
Definition at line 532 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the format for drawing grid annotations.
Definition at line 622 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the distance between the map frame and annotations.
Units are layout units.
Definition at line 591 of file qgslayoutitemmapgrid.h.
void QgsLayoutItemMapGrid::setAnnotationPosition | ( | AnnotationPosition | position, |
BorderSide | side | ||
) |
Sets the position for the grid annotations on a specified side of the map frame.
Definition at line 2186 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 545 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the blending mode used for drawing the grid.
Definition at line 286 of file qgslayoutitemmapgrid.h.
|
inline |
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 415 of file qgslayoutitemmapgrid.h.
void QgsLayoutItemMapGrid::setCrs | ( | const QgsCoordinateReferenceSystem & | crs | ) |
void QgsLayoutItemMapGrid::setFrameDivisions | ( | const QgsLayoutItemMapGrid::DisplayMode | divisions, |
const QgsLayoutItemMapGrid::BorderSide | border | ||
) |
Sets what type of grid divisions should be used for frames on a specified side of the map.
Definition at line 2250 of file qgslayoutitemmapgrid.cpp.
|
inline |
Sets the first fill color used for the grid frame.
Definition at line 765 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the second fill color used for the grid frame.
Definition at line 781 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the color of the stroke drawn in the grid frame.
Definition at line 748 of file qgslayoutitemmapgrid.h.
|
inline |
Sets the width of the stroke drawn in the grid frame.
Definition at line 732 of file qgslayoutitemmapgrid.h.
void QgsLayoutItemMapGrid::setFrameSideFlag | ( | QgsLayoutItemMapGrid::FrameSideFlag | 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 2150 of file qgslayoutitemmapgrid.cpp.
void QgsLayoutItemMapGrid::setFrameSideFlags | ( | QgsLayoutItemMapGrid::FrameSideFlags | 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 2145 of file qgslayoutitemmapgrid.cpp.
|
inline |
Sets the grid frame style.
Definition at line 652 of file qgslayoutitemmapgrid.h.
|
inline |
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 717 of file qgslayoutitemmapgrid.h.
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 201 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 193 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 2068 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 2078 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 1928 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 1943 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 2088 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 2098 of file qgslayoutitemmapgrid.cpp.
void QgsLayoutItemMapGrid::setStyle | ( | const QgsLayoutItemMapGrid::GridStyle | style | ) |
Sets the grid style, which controls how the grid is drawn over the map's contents.
Definition at line 2108 of file qgslayoutitemmapgrid.cpp.
void QgsLayoutItemMapGrid::setUnits | ( | const QgsLayoutItemMapGrid::GridUnit | unit | ) |
Sets the unit to use for grid measurements such as the interval and offset for grid lines.
Definition at line 2058 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 408 of file qgslayoutitemmapgrid.h.
bool QgsLayoutItemMapGrid::testFrameSideFlag | ( | QgsLayoutItemMapGrid::FrameSideFlag | flag | ) | const |
Tests whether the grid frame should be drawn on a specified side of the map item.
flag | flag for grid frame side |
Definition at line 2173 of file qgslayoutitemmapgrid.cpp.
|
inline |
Returns the units used for grid measurements such as the interval and offset for grid lines.
Definition at line 326 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 376 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 209 of file qgslayoutitemmapgrid.cpp.
|
friend |
Definition at line 1001 of file qgslayoutitemmapgrid.h.