Class: QgsLayoutGridSettings¶
Contains settings relating to the appearance, spacing and offset for layout grids.
Class Hierarchy¶
Base classes¶
An interface for layout objects which can be stored and read from DOM elements.  | 
|
Interface for layout objects which support undo/redo commands.  | 
Methods
Loads grid settings from the application layout settings.  | 
|
Returns the offset of the page/snap grid.  | 
|
Returns the pen used for drawing page/snap grids.  | 
|
Sets the grid's state from a DOM element.  | 
|
Returns the page/snap grid resolution.  | 
|
Sets the offset of the page/snap grid.  | 
|
Sets the pen used for drawing page/snap grids.  | 
|
Sets the page/snap grid resolution.  | 
|
Sets the style used for drawing the page/snap grids.  | 
|
Returns the style used for drawing the page/snap grids.  | 
|
Stores the grid's state in a DOM element.  | 
Attributes
- class qgis.core.QgsLayoutGridSettings[source]¶
 Bases:
QgsLayoutSerializableObject- __init__(layout: QgsLayout | None)
 Constructor for QgsLayoutGridSettings.
- Parameters:
 layout (Optional[QgsLayout])
- __init__(a0: QgsLayoutGridSettings)
 - Parameters:
 
- class Style¶
 Bases:
int
- StyleCrosses = 2¶
 
- StyleDots = 1¶
 
- StyleLines = 0¶
 
- offset(self) QgsLayoutPoint[source]¶
 Returns the offset of the page/snap grid.
See also
See also
- Return type:
 
- pen(self) QPen[source]¶
 Returns the pen used for drawing page/snap grids.
See also
See also
- Return type:
 QPen
- readXml(self, gridElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool[source]¶
 Sets the grid’s state from a DOM element. gridElement is the DOM node corresponding to the grid.
See also
- Parameters:
 gridElement (QDomElement)
document (QDomDocument)
context (QgsReadWriteContext)
- Return type:
 bool
- resolution(self) QgsLayoutMeasurement[source]¶
 Returns the page/snap grid resolution.
See also
See also
- Return type:
 
- setOffset(self, offset: QgsLayoutPoint)[source]¶
 Sets the
offsetof the page/snap grid.See also
See also
- Parameters:
 offset (QgsLayoutPoint)
- setPen(self, pen: QPen | QColor | Qt.GlobalColor)[source]¶
 Sets the
penused for drawing page/snap grids.See also
See also
- Parameters:
 pen (Union[QPen, Union[QColor, Qt.GlobalColor]])
- setResolution(self, resolution: QgsLayoutMeasurement)[source]¶
 Sets the page/snap grid
resolution.See also
See also
- Parameters:
 resolution (QgsLayoutMeasurement)
- setStyle(self, style: QgsLayoutGridSettings.Style)[source]¶
 Sets the
styleused for drawing the page/snap grids.See also
See also
- Parameters:
 style (QgsLayoutGridSettings.Style)
- style(self) QgsLayoutGridSettings.Style[source]¶
 Returns the style used for drawing the page/snap grids.
See also
See also
- Return type:
 
- writeXml(self, parentElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool[source]¶
 Stores the grid’s state in a DOM element. The
parentElementshould refer to the parent layout’s DOM element.See also
- Parameters:
 parentElement (QDomElement)
document (QDomDocument)
context (QgsReadWriteContext)
- Return type:
 bool