mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
262 lines
7.5 KiB
Plaintext
262 lines
7.5 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/qgsprojectionselectiondialog.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
class QgsCrsSelectionWidget : QgsPanelWidget
|
|
{
|
|
%Docstring(signature="appended")
|
|
A generic widget allowing users to pick a Coordinate Reference System (or define their own).
|
|
|
|
.. versionadded:: 3.24
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsprojectionselectiondialog.h"
|
|
%End
|
|
public:
|
|
|
|
QgsCrsSelectionWidget( QWidget *parent /TransferThis/ = 0 );
|
|
%Docstring
|
|
Constructor for QgsCrsSelectionWidget, with the specified ``parent`` widget.
|
|
%End
|
|
|
|
~QgsCrsSelectionWidget();
|
|
|
|
QgsCoordinateReferenceSystem crs() const;
|
|
%Docstring
|
|
Returns the CRS currently selected in the widget.
|
|
|
|
.. seealso:: :py:func:`setCrs`
|
|
%End
|
|
|
|
void setMessage( const QString &message );
|
|
%Docstring
|
|
Sets a ``message`` to show in the dialog.
|
|
%End
|
|
|
|
void setShowNoCrs( bool show );
|
|
%Docstring
|
|
Sets whether a "no/invalid" CRS option should be shown. If this
|
|
option is selected, calling :py:func:`~QgsCrsSelectionWidget.crs` will return an invalid :py:class:`QgsCoordinateReferenceSystem`.
|
|
|
|
.. seealso:: :py:func:`showNoCrs`
|
|
%End
|
|
|
|
bool showNoCrs() const;
|
|
%Docstring
|
|
Returns whether the "no/invalid" CRS option is shown. If this
|
|
option is selected, calling :py:func:`~QgsCrsSelectionWidget.crs` will return an invalid :py:class:`QgsCoordinateReferenceSystem`.
|
|
|
|
.. seealso:: :py:func:`setShowNoCrs`
|
|
%End
|
|
|
|
void setNotSetText( const QString &text, const QString &description = QString() );
|
|
%Docstring
|
|
Sets the text to show for the not set option. Note that this option is not shown
|
|
by default and must be set visible by calling :py:func:`~QgsCrsSelectionWidget.setShowNoCrs`.
|
|
|
|
The ``description`` argument can be used to specify a detailed description which
|
|
is shown when the option is selected.
|
|
%End
|
|
|
|
bool hasValidSelection() const;
|
|
%Docstring
|
|
Returns ``True`` if the widget has a valid CRS defined.
|
|
%End
|
|
|
|
public slots:
|
|
|
|
void setCrs( const QgsCoordinateReferenceSystem &crs );
|
|
%Docstring
|
|
Sets the ``crs`` to show within the widget.
|
|
|
|
.. seealso:: :py:func:`crs`
|
|
%End
|
|
|
|
void setOgcWmsCrsFilter( const QSet<QString> &crsFilter );
|
|
%Docstring
|
|
filters this dialog by the given CRSs
|
|
|
|
Sets this dialog to filter the available CRSs to those listed
|
|
by the given Coordinate Reference Systems.
|
|
|
|
:param crsFilter: a list of OGC Coordinate Reference Systems to filter the
|
|
list of CRS by. This is useful in (e.g.) WMS situations
|
|
where you just want to offer what the WMS server can support.
|
|
|
|
.. warning::
|
|
|
|
This function's behavior is undefined if it is called after the dialog is shown.
|
|
%End
|
|
|
|
signals:
|
|
|
|
void crsChanged();
|
|
%Docstring
|
|
Emitted when the CRS defined in the widget is changed.
|
|
%End
|
|
|
|
void crsDoubleClicked( const QgsCoordinateReferenceSystem &crs );
|
|
%Docstring
|
|
Emitted when a CRS entry in the widget is double-clicked.
|
|
%End
|
|
|
|
void hasValidSelectionChanged( bool isValid );
|
|
%Docstring
|
|
Emitted when the widget has a valid selection or not.
|
|
%End
|
|
|
|
};
|
|
|
|
|
|
|
|
class QgsProjectionSelectionDialog : QDialog
|
|
{
|
|
%Docstring(signature="appended")
|
|
A generic dialog to prompt the user for a Coordinate Reference System.
|
|
|
|
Typically you will use this when you want to prompt the user for
|
|
a coordinate system identifier e.g. from a plugin you might do this
|
|
to get an epsg code:
|
|
|
|
.. code-block:: python
|
|
|
|
crs = QgsCoordinateReferenceSystem()
|
|
mySelector = QgsProjectionSelectionDialog( iface.mainWindow() )
|
|
mySelector.setCrs( crs )
|
|
if mySelector.exec():
|
|
mCrs = mySelector.crs()
|
|
|
|
If you wish to embed the projection selector into an existing dialog
|
|
the you probably want to look at :py:class:`QgsProjectionSelectionWidget` instead.
|
|
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsprojectionselectiondialog.h"
|
|
%End
|
|
public:
|
|
|
|
QgsProjectionSelectionDialog( QWidget *parent /TransferThis/ = 0,
|
|
Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
|
|
%Docstring
|
|
Constructor for QgsProjectionSelectionDialog.
|
|
%End
|
|
|
|
QgsCoordinateReferenceSystem crs() const;
|
|
%Docstring
|
|
Returns the CRS currently selected in the widget.
|
|
|
|
.. seealso:: :py:func:`setCrs`
|
|
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
void setMessage( const QString &message );
|
|
%Docstring
|
|
Sets a ``message`` to show in the dialog.
|
|
|
|
.. seealso:: :py:func:`showNoCrsForLayerMessage`
|
|
%End
|
|
|
|
void showNoCrsForLayerMessage();
|
|
%Docstring
|
|
When called, the dialog will show a default "layer has no CRS set" message above the projection selector.
|
|
|
|
.. seealso:: :py:func:`setMessage`
|
|
|
|
.. versionadded:: 3.16
|
|
%End
|
|
|
|
void setShowNoProjection( bool show );
|
|
%Docstring
|
|
Sets whether a "no/invalid" projection option should be shown. If this
|
|
option is selected, calling :py:func:`~QgsProjectionSelectionDialog.crs` will return an invalid :py:class:`QgsCoordinateReferenceSystem`.
|
|
|
|
.. seealso:: :py:func:`showNoProjection`
|
|
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
bool showNoProjection() const;
|
|
%Docstring
|
|
Returns whether the "no/invalid" projection option is shown. If this
|
|
option is selected, calling :py:func:`~QgsProjectionSelectionDialog.crs` will return an invalid :py:class:`QgsCoordinateReferenceSystem`.
|
|
|
|
.. seealso:: :py:func:`setShowNoProjection`
|
|
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
void setNotSetText( const QString &text, const QString &description = QString() );
|
|
%Docstring
|
|
Sets the text to show for the not set option. Note that this option is not shown
|
|
by default and must be set visible by calling :py:func:`~QgsProjectionSelectionDialog.setShowNoProjection`.
|
|
|
|
Since QGIS 3.24, the ``description`` argument can be used to specify a detailed description which
|
|
is shown when the option is selected.
|
|
|
|
.. versionadded:: 3.16
|
|
%End
|
|
|
|
void setRequireValidSelection();
|
|
%Docstring
|
|
Sets the dialog to require a valid selection only, preventing users from accepting the
|
|
dialog if no selection is present.
|
|
|
|
.. versionadded:: 3.18
|
|
%End
|
|
|
|
bool hasValidSelection() const;
|
|
%Docstring
|
|
Returns ``True`` if the dialog has a valid CRS defined.
|
|
|
|
.. versionadded:: 3.24
|
|
%End
|
|
|
|
public slots:
|
|
|
|
void setCrs( const QgsCoordinateReferenceSystem &crs );
|
|
%Docstring
|
|
Sets the initial ``crs`` to show within the dialog.
|
|
|
|
.. seealso:: :py:func:`crs`
|
|
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
void setOgcWmsCrsFilter( const QSet<QString> &crsFilter );
|
|
%Docstring
|
|
filters this dialog by the given CRSs
|
|
|
|
Sets this dialog to filter the available projections to those listed
|
|
by the given Coordinate Reference Systems.
|
|
|
|
:param crsFilter: a list of OGC Coordinate Reference Systems to filter the
|
|
list of projections by. This is useful in (e.g.) WMS situations
|
|
where you just want to offer what the WMS server can support.
|
|
|
|
.. warning::
|
|
|
|
This function's behavior is undefined if it is called after the dialog is shown.
|
|
%End
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/qgsprojectionselectiondialog.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|