Subgroup: Projection

Class: QgsProjectionSelectionDialog

class qgis.gui.QgsProjectionSelectionDialog(parent: QWidget = None, fl: Union[Qt.WindowFlags, Qt.WindowType] = QgsGuiUtils.ModalDialogFlags)

Bases: PyQt5.QtWidgets.QDialog

Constructor for QgsProjectionSelectionDialog.

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.

actionEvent()
changeEvent()
childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
crs(self) → QgsCoordinateReferenceSystem

Returns the CRS currently selected in the widget.

New in version 3.0.

See also

setCrs()

customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
eventFilter()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
initPainter()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
resizeEvent()
sender()
senderSignalIndex()
setCrs(self, crs: QgsCoordinateReferenceSystem)

Sets the initial crs to show within the dialog.

New in version 3.0.

See also

crs()

setMessage(self, message: 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’.

setOgcWmsCrsFilter(self, crsFilter: Iterable[str])

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.

setShowNoProjection(self, show: bool)

Sets whether a “no/invalid” projection option should be shown. If this option is selected, calling crs() will return an invalid QgsCoordinateReferenceSystem.

New in version 3.0.

sharedPainter()
showEvent()
showNoProjection(self) → bool

Returns whether the “no/invalid” projection option is shown. If this option is selected, calling crs() will return an invalid QgsCoordinateReferenceSystem.

New in version 3.0.

tabletEvent()
timerEvent()
updateMicroFocus()
wheelEvent()