A generic dialog to prompt the user for a Coordinate Reference System.
More...
#include <qgsprojectionselectiondialog.h>
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:
mySelector.setCrs( crs )
if mySelector.exec():
mCrs = mySelector.crs()
This class represents a coordinate reference system (CRS).
A generic dialog to prompt the user for a Coordinate Reference System.
If you wish to embed the projection selector into an existing dialog the you probably want to look at QgsProjectionSelectionWidget instead.
- Since
- QGIS 3.0
Definition at line 170 of file qgsprojectionselectiondialog.h.
◆ QgsProjectionSelectionDialog()
QgsProjectionSelectionDialog::QgsProjectionSelectionDialog |
( |
QWidget * |
parent = nullptr , |
|
|
Qt::WindowFlags |
fl = QgsGuiUtils::ModalDialogFlags |
|
) |
| |
◆ crs()
◆ hasValidSelection()
bool QgsProjectionSelectionDialog::hasValidSelection |
( |
| ) |
const |
◆ setCrs
◆ setMessage()
void QgsProjectionSelectionDialog::setMessage |
( |
const QString & |
message | ) |
|
◆ setNotSetText()
void QgsProjectionSelectionDialog::setNotSetText |
( |
const QString & |
text, |
|
|
const QString & |
description = QString() |
|
) |
| |
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 setShowNoProjection().
Since QGIS 3.24, the description argument can be used to specify a detailed description which is shown when the option is selected.
- Since
- QGIS 3.16
Definition at line 295 of file qgsprojectionselectiondialog.cpp.
◆ setOgcWmsCrsFilter
void QgsProjectionSelectionDialog::setOgcWmsCrsFilter |
( |
const QSet< QString > & |
crsFilter | ) |
|
|
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.
- Parameters
-
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.
Definition at line 329 of file qgsprojectionselectiondialog.cpp.
◆ setRequireValidSelection()
void QgsProjectionSelectionDialog::setRequireValidSelection |
( |
| ) |
|
Sets the dialog to require a valid selection only, preventing users from accepting the dialog if no selection is present.
- Since
- QGIS 3.18
Definition at line 300 of file qgsprojectionselectiondialog.cpp.
◆ setShowNoProjection()
void QgsProjectionSelectionDialog::setShowNoProjection |
( |
bool |
show | ) |
|
◆ showNoCrsForLayerMessage()
void QgsProjectionSelectionDialog::showNoCrsForLayerMessage |
( |
| ) |
|
◆ showNoProjection()
bool QgsProjectionSelectionDialog::showNoProjection |
( |
| ) |
const |
The documentation for this class was generated from the following files: