QGIS API Documentation
3.24.2-Tisler (13c1a02865)
|
Contains settings and properties relating to how a QgsProject should be displayed inside map canvas, e.g. More...
#include <qgsprojectviewsettings.h>
Signals | |
void | mapScalesChanged () |
Emitted when the list of custom project map scales changes. More... | |
void | presetFullExtentChanged () |
Emitted whenever the presetFullExtent() is changed. More... | |
Public Member Functions | |
QgsProjectViewSettings (QgsProject *project=nullptr) | |
Constructor for QgsProjectViewSettings for the specified project. More... | |
QgsReferencedRectangle | defaultViewExtent () const |
Returns the default view extent, which should be used as the initial map extent when this project is opened. More... | |
QgsReferencedRectangle | fullExtent () const |
Returns the full extent of the project, which represents the maximal limits of the project. More... | |
QVector< double > | mapScales () const |
Returns the list of custom project map scales. More... | |
QgsReferencedRectangle | presetFullExtent () const |
Returns the project's preset full extent. More... | |
bool | readXml (const QDomElement &element, const QgsReadWriteContext &context) |
Reads the settings's state from a DOM element. More... | |
void | reset () |
Resets the settings to a default state. More... | |
void | setDefaultViewExtent (const QgsReferencedRectangle &extent) |
Sets the default view extent, which should be used as the initial map extent when this project is opened. More... | |
void | setMapScales (const QVector< double > &scales) |
Sets the list of custom project map scales. More... | |
void | setPresetFullExtent (const QgsReferencedRectangle &extent) |
Sets the project's preset full extent. More... | |
void | setUseProjectScales (bool enabled) |
Sets whether project mapScales() are enabled. More... | |
bool | useProjectScales () const |
Returns true if project mapScales() are enabled. More... | |
QDomElement | writeXml (QDomDocument &doc, const QgsReadWriteContext &context) const |
Returns a DOM element representing the settings. More... | |
Contains settings and properties relating to how a QgsProject should be displayed inside map canvas, e.g.
map scales and default view extent for the project.
Definition at line 35 of file qgsprojectviewsettings.h.
QgsProjectViewSettings::QgsProjectViewSettings | ( | QgsProject * | project = nullptr | ) |
Constructor for QgsProjectViewSettings for the specified project.
Ownership is transferred to the project.
Definition at line 24 of file qgsprojectviewsettings.cpp.
QgsReferencedRectangle QgsProjectViewSettings::defaultViewExtent | ( | ) | const |
Returns the default view extent, which should be used as the initial map extent when this project is opened.
Definition at line 48 of file qgsprojectviewsettings.cpp.
QgsReferencedRectangle QgsProjectViewSettings::fullExtent | ( | ) | const |
Returns the full extent of the project, which represents the maximal limits of the project.
The returned extent will be in the project's CRS.
If the presetFullExtent() is non null, this will be returned as the full extent. Otherwise the full extent will be calculated based on the extent of all layers in the project.
Definition at line 72 of file qgsprojectviewsettings.cpp.
QVector< double > QgsProjectViewSettings::mapScales | ( | ) | const |
Returns the list of custom project map scales.
The scales list consists of a list of scale denominator values, e.g. 1000 for a 1:1000 scale.
Definition at line 104 of file qgsprojectviewsettings.cpp.
|
signal |
Emitted when the list of custom project map scales changes.
QgsReferencedRectangle QgsProjectViewSettings::presetFullExtent | ( | ) | const |
Returns the project's preset full extent.
This extent represents the maximal limits of the project. The full extent defaults to a null rectangle, which indicates that the maximal extent should be calculated based on the layers in the project.
Definition at line 58 of file qgsprojectviewsettings.cpp.
|
signal |
Emitted whenever the presetFullExtent() is changed.
bool QgsProjectViewSettings::readXml | ( | const QDomElement & | element, |
const QgsReadWriteContext & | context | ||
) |
Reads the settings's state from a DOM element.
Definition at line 123 of file qgsprojectviewsettings.cpp.
void QgsProjectViewSettings::reset | ( | ) |
Resets the settings to a default state.
Definition at line 31 of file qgsprojectviewsettings.cpp.
void QgsProjectViewSettings::setDefaultViewExtent | ( | const QgsReferencedRectangle & | extent | ) |
Sets the default view extent, which should be used as the initial map extent when this project is opened.
Definition at line 53 of file qgsprojectviewsettings.cpp.
void QgsProjectViewSettings::setMapScales | ( | const QVector< double > & | scales | ) |
Sets the list of custom project map scales.
The scales list consists of a list of scale denominator values, e.g. 1000 for a 1:1000 scale.
Definition at line 90 of file qgsprojectviewsettings.cpp.
void QgsProjectViewSettings::setPresetFullExtent | ( | const QgsReferencedRectangle & | extent | ) |
Sets the project's preset full extent.
This extent represents the maximal limits of the project. Setting the full extent to a null rectangle indicates that the maximal extent should be calculated based on the layers in the project.
Definition at line 63 of file qgsprojectviewsettings.cpp.
void QgsProjectViewSettings::setUseProjectScales | ( | bool | enabled | ) |
Sets whether project mapScales() are enabled.
When project map scales are enabled these scales will replace the default QGIS map scales list while working with this project.
Definition at line 109 of file qgsprojectviewsettings.cpp.
bool QgsProjectViewSettings::useProjectScales | ( | ) | const |
Returns true
if project mapScales() are enabled.
When project map scales are enabled these scales will replace the default QGIS map scales list while working with this project.
Definition at line 118 of file qgsprojectviewsettings.cpp.
QDomElement QgsProjectViewSettings::writeXml | ( | QDomDocument & | doc, |
const QgsReadWriteContext & | context | ||
) | const |
Returns a DOM element representing the settings.
Definition at line 181 of file qgsprojectviewsettings.cpp.