Class: QgsProjectionSelectionWidget¶
- class qgis.gui.QgsProjectionSelectionWidget¶
Bases:
PyQt5.QtWidgets.QWidget
A widget for selecting a projection.
New in version 2.7.
QgsProjectionSelectionWidget(parent: QWidget = None) Constructor for QgsProjectionSelectionWidget
Methods
Returns the currently selected CRS for the widget
Returns the title for the CRS selector dialog window.
- param event
- param event
- param event
Returns whether the specified CRS option is visible in the widget.
Opens the dialog for selecting a new CRS
Sets the current CRS for the widget
Sets the
title
for the CRS selector dialog window.Sets the layer CRS for the widget.
Sets a
message
to show in the dialog.Sets the text to show for the not set option.
Sets whether a predefined CRS option should be shown in the widget.
Sets whether the widget will
show
warnings to users when they select a CRS which has low accuracy.Sets the original source
ensemble
datum name.Returns
True
if the widget will show a warning to users when they select a CRS which has low accuracy.Returns the original source ensemble datum name.
Signals
Emitted when the not set option is selected.
Emitted when the selected CRS is changed [signal]
Attributes
- CrsNotSet = 5¶
- class CrsOption¶
Bases:
int
- CurrentCrs = 2¶
- DefaultCrs = 3¶
- LayerCrs = 0¶
- ProjectCrs = 1¶
- RecentCrs = 4¶
- actionEvent(self, QActionEvent)¶
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- cleared¶
Emitted when the not set option is selected.
New in version 3.0: [signal]
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- crs(self) QgsCoordinateReferenceSystem ¶
Returns the currently selected CRS for the widget
- Return type
- Returns
current CRS
- crsChanged¶
Emitted when the selected CRS is changed [signal]
- customEvent(self, QEvent)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- dialogTitle(self) str ¶
Returns the title for the CRS selector dialog window.
See also
New in version 3.24.
- Return type
str
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, event: QDragEnterEvent)¶
- Parameters
event (QDragEnterEvent) –
- dragLeaveEvent(self, event: QDragLeaveEvent)¶
- Parameters
event (QDragLeaveEvent) –
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, event: QDropEvent)¶
- Parameters
event (QDropEvent) –
- enterEvent(self, QEvent)¶
- event(self, QEvent) bool ¶
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, QHideEvent)¶
- initPainter(self, QPainter)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- leaveEvent(self, QEvent)¶
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], sip.voidptr) Tuple[bool, int] ¶
- optionVisible(self, option: QgsProjectionSelectionWidget.CrsOption) bool ¶
Returns whether the specified CRS option is visible in the widget.
See also
New in version 3.0.
- Parameters
option (QgsProjectionSelectionWidget.CrsOption) –
- Return type
bool
- paintEvent(self, QPaintEvent)¶
- receivers(self, PYQT_SIGNAL) int ¶
- resizeEvent(self, QResizeEvent)¶
- selectCrs(self)¶
Opens the dialog for selecting a new CRS
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setCrs(self, crs: QgsCoordinateReferenceSystem)¶
Sets the current CRS for the widget
- Parameters
crs (QgsCoordinateReferenceSystem) – new CRS
- setDialogTitle(self, title: str)¶
Sets the
title
for the CRS selector dialog window.See also
New in version 3.24.
- Parameters
title (str) –
- setLayerCrs(self, crs: QgsCoordinateReferenceSystem)¶
Sets the layer CRS for the widget. If set, this will be added as an option to the preset CRSes shown in the widget.
- Parameters
crs (QgsCoordinateReferenceSystem) – layer CRS
- setMessage(self, text: str)¶
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’.New in version 3.0.
- Parameters
text (str) –
- setNotSetText(self, text: str)¶
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
setOptionVisible()
.New in version 3.0.
- Parameters
text (str) –
- setOptionVisible(self, option: QgsProjectionSelectionWidget.CrsOption, visible: bool)¶
Sets whether a predefined CRS option should be shown in the widget.
- Parameters
option (QgsProjectionSelectionWidget.CrsOption) – CRS option to show/hide
visible (bool) – whether the option should be shown
See also
- setShowAccuracyWarnings(self, show: bool)¶
Sets whether the widget will
show
warnings to users when they select a CRS which has low accuracy.See also
New in version 3.20.
- Parameters
show (bool) –
- setSourceEnsemble(self, ensemble: str)¶
Sets the original source
ensemble
datum name.If set, CRS accuracy warnings will not be shown when the selected CRS in the widget has a matching ensemble datum, regardless of the ensemble’s accuracy.
See also
New in version 3.20.
- Parameters
ensemble (str) –
- showAccuracyWarnings(self) bool ¶
Returns
True
if the widget will show a warning to users when they select a CRS which has low accuracy.See also
New in version 3.20.
- Return type
bool
- showEvent(self, QShowEvent)¶
- sourceEnsemble(self) str ¶
Returns the original source ensemble datum name.
If set, CRS accuracy warnings will not be shown when the selected CRS in the widget has a matching ensemble datum, regardless of the ensemble’s accuracy.
See also
New in version 3.20.
- Return type
str
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶