QGIS API Documentation 3.41.0-Master (181b2f43d8e)
|
Contains settings relating to the appearance, spacing and offset for layout grids. More...
#include <qgslayoutgridsettings.h>
Public Types | |
enum | Style { StyleLines , StyleDots , StyleCrosses } |
Style for drawing the page/snapping grid. More... | |
Public Member Functions | |
QgsLayoutGridSettings (QgsLayout *layout) | |
Constructor for QgsLayoutGridSettings. | |
QgsLayout * | layout () override |
Returns the layout the object belongs to. | |
void | loadFromSettings () |
Loads grid settings from the application layout settings. | |
QgsLayoutPoint | offset () const |
Returns the offset of the page/snap grid. | |
QPen | pen () const |
Returns the pen used for drawing page/snap grids. | |
bool | readXml (const QDomElement &gridElement, const QDomDocument &document, const QgsReadWriteContext &context) override |
Sets the grid's state from a DOM element. | |
QgsLayoutMeasurement | resolution () const |
Returns the page/snap grid resolution. | |
void | setOffset (const QgsLayoutPoint &offset) |
Sets the offset of the page/snap grid. | |
void | setPen (const QPen &pen) |
Sets the pen used for drawing page/snap grids. | |
void | setResolution (QgsLayoutMeasurement resolution) |
Sets the page/snap grid resolution. | |
void | setStyle (const Style style) |
Sets the style used for drawing the page/snap grids. | |
QString | stringType () const override |
Returns the object type as a string. | |
Style | style () const |
Returns the style used for drawing the page/snap grids. | |
bool | writeXml (QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const override |
Stores the grid's state in a DOM element. | |
Public Member Functions inherited from QgsLayoutSerializableObject | |
QgsAbstractLayoutUndoCommand * | createCommand (const QString &text, int id, QUndoCommand *parent=nullptr) override |
Creates a new layout undo command with the specified text and parent. | |
Public Member Functions inherited from QgsLayoutUndoObjectInterface | |
virtual | ~QgsLayoutUndoObjectInterface ()=default |
Contains settings relating to the appearance, spacing and offset for layout grids.
Definition at line 34 of file qgslayoutgridsettings.h.
Style for drawing the page/snapping grid.
Enumerator | |
---|---|
StyleLines | Solid lines. |
StyleDots | Dots. |
StyleCrosses | Crosses. |
Definition at line 40 of file qgslayoutgridsettings.h.
QgsLayoutGridSettings::QgsLayoutGridSettings | ( | QgsLayout * | layout | ) |
Constructor for QgsLayoutGridSettings.
Definition at line 25 of file qgslayoutgridsettings.cpp.
|
overridevirtual |
Returns the layout the object belongs to.
Implements QgsLayoutSerializableObject.
Definition at line 34 of file qgslayoutgridsettings.cpp.
void QgsLayoutGridSettings::loadFromSettings | ( | ) |
Loads grid settings from the application layout settings.
Definition at line 53 of file qgslayoutgridsettings.cpp.
|
inline |
Returns the offset of the page/snap grid.
Definition at line 81 of file qgslayoutgridsettings.h.
|
inline |
Returns the pen used for drawing page/snap grids.
Definition at line 95 of file qgslayoutgridsettings.h.
|
overridevirtual |
Sets the grid's state from a DOM element.
gridElement is the DOM node corresponding to the grid.
Implements QgsLayoutSerializableObject.
Definition at line 106 of file qgslayoutgridsettings.cpp.
|
inline |
Returns the page/snap grid resolution.
Definition at line 67 of file qgslayoutgridsettings.h.
void QgsLayoutGridSettings::setOffset | ( | const QgsLayoutPoint & | offset | ) |
Sets the offset of the page/snap grid.
Definition at line 46 of file qgslayoutgridsettings.cpp.
|
inline |
Sets the pen used for drawing page/snap grids.
Definition at line 88 of file qgslayoutgridsettings.h.
void QgsLayoutGridSettings::setResolution | ( | QgsLayoutMeasurement | resolution | ) |
Sets the page/snap grid resolution.
Definition at line 39 of file qgslayoutgridsettings.cpp.
|
inline |
Sets the style used for drawing the page/snap grids.
Definition at line 102 of file qgslayoutgridsettings.h.
|
inlineoverridevirtual |
Returns the object type as a string.
This string must be a unique, single word, character only representation of the item type, eg "LayoutScaleBar"
Implements QgsLayoutSerializableObject.
Definition at line 52 of file qgslayoutgridsettings.h.
|
inline |
Returns the style used for drawing the page/snap grids.
Definition at line 109 of file qgslayoutgridsettings.h.
|
overridevirtual |
Stores the grid's state in a DOM element.
The parentElement should refer to the parent layout's DOM element.
Implements QgsLayoutSerializableObject.
Definition at line 91 of file qgslayoutgridsettings.cpp.