Class: QgsProjectionSelectionWidget¶
-
class
qgis.gui.
QgsProjectionSelectionWidget
(parent: QWidget = None)¶ Bases:
PyQt5.QtWidgets.QWidget
Constructor for QgsProjectionSelectionWidget
A widget for selecting a projection.
New in version 2.7: Enums
Methods
Returns the currently selected CRS for the widget
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 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.
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
()¶
-
changeEvent
()¶
-
childEvent
()¶
-
cleared
¶ Emitted when the not set option is selected.
New in version 3.0: [signal]
-
closeEvent
()¶
-
connectNotify
()¶
-
contextMenuEvent
()¶
-
create
()¶
-
crs
(self) → QgsCoordinateReferenceSystem¶ Returns the currently selected CRS for the widget
- Returns
current CRS
-
crsChanged
¶ Emitted when the selected CRS is changed [signal]
-
customEvent
()¶
-
destroy
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
enterEvent
()¶
-
event
()¶
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
hideEvent
()¶
-
initPainter
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
()¶
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
()¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
optionVisible
(self, option: QgsProjectionSelectionWidget.CrsOption) → bool¶ Returns whether the specified CRS option is visible in the widget.
See also
New in version 3.0.
-
paintEvent
()¶
-
receivers
()¶
-
resizeEvent
()¶
-
selectCrs
(self)¶ Opens the dialog for selecting a new CRS
-
sender
()¶
-
senderSignalIndex
()¶
-
setCrs
(self, crs: QgsCoordinateReferenceSystem)¶ Sets the current CRS for the widget
- Parameters
crs – new CRS
-
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 – 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.
-
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.
-
setOptionVisible
(self, option: QgsProjectionSelectionWidget.CrsOption, visible: bool)¶ Sets whether a predefined CRS option should be shown in the widget.
- Parameters
option – CRS option to show/hide
visible – whether the option should be shown
See also
-
showEvent
()¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateMicroFocus
()¶
-
wheelEvent
()¶
-