QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
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. More... | |
QgsLayout * | layout () override |
Returns the layout the object belongs to. More... | |
void | loadFromSettings () |
Loads grid settings from the application layout settings. More... | |
QgsLayoutPoint | offset () const |
Returns the offset of the page/snap grid. More... | |
QPen | pen () const |
Returns the pen used for drawing page/snap grids. More... | |
bool | readXml (const QDomElement &gridElement, const QDomDocument &document, const QgsReadWriteContext &context) override |
Sets the grid's state from a DOM element. More... | |
QgsLayoutMeasurement | resolution () const |
Returns the page/snap grid resolution. More... | |
void | setOffset (const QgsLayoutPoint &offset) |
Sets the offset of the page/snap grid. More... | |
void | setPen (const QPen &pen) |
Sets the pen used for drawing page/snap grids. More... | |
void | setResolution (QgsLayoutMeasurement resolution) |
Sets the page/snap grid resolution. More... | |
void | setStyle (const Style style) |
Sets the style used for drawing the page/snap grids. More... | |
QString | stringType () const override |
Returns the object type as a string. More... | |
Style | style () const |
Returns the style used for drawing the page/snap grids. More... | |
bool | writeXml (QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const override |
Stores the grid's state in a DOM element. More... | |
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. More... | |
Public Member Functions inherited from QgsLayoutUndoObjectInterface | |
virtual | ~QgsLayoutUndoObjectInterface ()=default |
Destructor for QgsLayoutUndoObjectInterface. More... | |
Contains settings relating to the appearance, spacing and offset for layout grids.
Definition at line 35 of file qgslayoutgridsettings.h.
Style for drawing the page/snapping grid.
Enumerator | |
---|---|
StyleLines | Solid lines. |
StyleDots | Dots. |
StyleCrosses | Crosses. |
Definition at line 41 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 82 of file qgslayoutgridsettings.h.
|
inline |
Returns the pen used for drawing page/snap grids.
Definition at line 96 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 68 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 89 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 103 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 53 of file qgslayoutgridsettings.h.
|
inline |
Returns the style used for drawing the page/snap grids.
Definition at line 110 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.