QGIS/python/core/auto_generated/project/qgsprojectviewsettings.sip.in
Nyall Dawson f9415af325 Add API to QgsProjectViewSettings to allow setting default map rotation
Provides a stable means for scripts to set the map rotation
2022-08-16 12:22:05 +10:00

237 lines
7.6 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/project/qgsprojectviewsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsProjectViewSettings : QObject
{
%Docstring(signature="appended")
Contains settings and properties relating to how a :py:class:`QgsProject` should be displayed inside
map canvas, e.g. map scales and default view extent for the project.
.. versionadded:: 3.10.1
%End
%TypeHeaderCode
#include "qgsprojectviewsettings.h"
%End
public:
QgsProjectViewSettings( QgsProject *project = 0 );
%Docstring
Constructor for QgsProjectViewSettings for the specified ``project``.
Ownership is transferred to the ``project``.
%End
void reset();
%Docstring
Resets the settings to a default state.
%End
QgsReferencedRectangle defaultViewExtent() const;
%Docstring
Returns the default view extent, which should be used as the initial map extent
when this project is opened.
.. warning::
When a project is opened in the QGIS desktop application and saved, individual
map canvases will store their own previous view extent as custom project properties. Reloading
this saved version of the project will trigger the canvases to restore their individual last view
extents. Accordingly, in the QGIS desktop application, this setting only forms a default, initial
view used when the project is opened for the very first time.
.. seealso:: :py:func:`setDefaultViewExtent`
%End
void setDefaultViewExtent( const QgsReferencedRectangle &extent );
%Docstring
Sets the default view ``extent``, which should be used as the initial map extent
when this project is opened.
.. warning::
When a project is opened in the QGIS desktop application and saved, individual
map canvases will store their own previous view extent as custom project properties. Reloading
this saved version of the project will trigger the canvases to restore their individual last view
extents. Accordingly, in the QGIS desktop application, this setting only forms a default, initial
view used when the project is opened for the very first time.
.. seealso:: :py:func:`defaultViewExtent`
%End
QgsReferencedRectangle presetFullExtent() const;
%Docstring
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.
.. seealso:: :py:func:`setPresetFullExtent`
.. seealso:: :py:func:`fullExtent`
.. versionadded:: 3.18
%End
void setPresetFullExtent( const QgsReferencedRectangle &extent );
%Docstring
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.
.. seealso:: :py:func:`setPresetFullExtent`
.. seealso:: :py:func:`fullExtent`
.. versionadded:: 3.18
%End
QgsReferencedRectangle fullExtent() const;
%Docstring
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 :py:func:`~QgsProjectViewSettings.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.
.. seealso:: :py:func:`presetFullExtent`
.. seealso:: :py:func:`setPresetFullExtent`
%End
void setMapScales( const QVector<double> &scales );
%Docstring
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.
.. seealso:: :py:func:`mapScales`
.. seealso:: :py:func:`mapScalesChanged`
%End
QVector<double> mapScales() const;
%Docstring
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.
.. seealso:: :py:func:`setMapScales`
.. seealso:: :py:func:`mapScalesChanged`
%End
void setUseProjectScales( bool enabled );
%Docstring
Sets whether project :py:func:`~QgsProjectViewSettings.mapScales` are ``enabled``.
When project map scales are enabled these scales will replace the default QGIS map scales list
while working with this project.
.. seealso:: :py:func:`useProjectScales`
.. seealso:: :py:func:`setMapScales`
%End
bool useProjectScales() const;
%Docstring
Returns ``True`` if project :py:func:`~QgsProjectViewSettings.mapScales` are enabled.
When project map scales are enabled these scales will replace the default QGIS map scales list
while working with this project.
.. seealso:: :py:func:`setUseProjectScales`
.. seealso:: :py:func:`mapScales`
%End
double defaultRotation() const;
%Docstring
Returns the default map rotation (in clockwise degrees) for maps in the project.
.. warning::
When a project is opened in the QGIS desktop application and saved, individual
map canvases will store their own previous map rotations as custom project properties. Reloading
this saved version of the project will trigger the canvases to restore their individual rotations.
Accordingly, in the QGIS desktop application, this setting only forms a default, initial
view used when the project is opened for the very first time (or when new map canvases are opened in
that project.)
.. seealso:: :py:func:`setDefaultRotation`
.. versionadded:: 3.28
%End
void setDefaultRotation( double rotation );
%Docstring
Set the default ``rotation`` of maps in the project, in clockwise degrees.
.. warning::
When a project is opened in the QGIS desktop application and saved, individual
map canvases will store their own previous map rotations as custom project properties. Reloading
this saved version of the project will trigger the canvases to restore their individual rotations.
Accordingly, in the QGIS desktop application, this setting only forms a default, initial
view used when the project is opened for the very first time (or when new map canvases are opened in
that project.)
.. seealso:: :py:func:`defaultRotation`
.. versionadded:: 3.28
%End
bool readXml( const QDomElement &element, const QgsReadWriteContext &context );
%Docstring
Reads the settings's state from a DOM element.
.. seealso:: :py:func:`writeXml`
%End
QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
%Docstring
Returns a DOM element representing the settings.
.. seealso:: :py:func:`readXml`
%End
signals:
void mapScalesChanged();
%Docstring
Emitted when the list of custom project map scales changes.
.. seealso:: :py:func:`mapScales`
.. seealso:: :py:func:`setMapScales`
%End
void presetFullExtentChanged();
%Docstring
Emitted whenever the :py:func:`~QgsProjectViewSettings.presetFullExtent` is changed.
.. versionadded:: 3.18
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/project/qgsprojectviewsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/