QGIS API Documentation
3.2.0-Bonn (bc43194)
|
A generic dialog to prompt the user for a Coordinate Reference System. More...
#include <qgsprojectionselectiondialog.h>
Public Slots | |
void | setCrs (const QgsCoordinateReferenceSystem &crs) |
Sets the initial crs to show within the dialog. More... | |
void | setOgcWmsCrsFilter (const QSet< QString > &crsFilter) |
filters this dialog by the given CRSs More... | |
Public Member Functions | |
QgsProjectionSelectionDialog (QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags) | |
Constructor for QgsProjectionSelectionDialog. More... | |
QgsCoordinateReferenceSystem | crs () const |
Returns the CRS currently selected in the widget. More... | |
void | setMessage (const QString &message) |
Sets a message to show in the dialog. More... | |
void | setShowNoProjection (bool show) |
Sets whether a "no/invalid" projection option should be shown. More... | |
bool | showNoProjection () const |
Returns whether the "no/invalid" projection option is shown. More... | |
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:
If you wish to embed the projection selector into an existing dialog the you probably want to look at QgsProjectionSelectionWidget instead.
Definition at line 51 of file qgsprojectionselectiondialog.h.
QgsProjectionSelectionDialog::QgsProjectionSelectionDialog | ( | QWidget * | parent = nullptr , |
Qt::WindowFlags | fl = QgsGuiUtils::ModalDialogFlags |
||
) |
Constructor for QgsProjectionSelectionDialog.
Definition at line 26 of file qgsprojectionselectiondialog.cpp.
QgsCoordinateReferenceSystem QgsProjectionSelectionDialog::crs | ( | ) | const |
Returns the CRS currently selected in the widget.
Definition at line 73 of file qgsprojectionselectiondialog.cpp.
|
slot |
Sets the initial crs to show within the dialog.
Definition at line 78 of file qgsprojectionselectiondialog.cpp.
void QgsProjectionSelectionDialog::setMessage | ( | const QString & | message | ) |
Sets a message to show in the dialog.
If an empty string is passed, the message will be a generic 'define the CRS for this layer'.
Definition at line 41 of file qgsprojectionselectiondialog.cpp.
|
slot |
filters this dialog by the given CRSs
Sets this dialog to filter the available projections to those listed by the given Coordinate Reference Systems.
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. |
Definition at line 83 of file qgsprojectionselectiondialog.cpp.
void QgsProjectionSelectionDialog::setShowNoProjection | ( | bool | show | ) |
Sets whether a "no/invalid" projection option should be shown.
If this option is selected, calling crs() will return an invalid QgsCoordinateReferenceSystem.
Definition at line 63 of file qgsprojectionselectiondialog.cpp.
bool QgsProjectionSelectionDialog::showNoProjection | ( | ) | const |
Returns whether the "no/invalid" projection option is shown.
If this option is selected, calling crs() will return an invalid QgsCoordinateReferenceSystem.
Definition at line 68 of file qgsprojectionselectiondialog.cpp.