Class: QgsProjectionSelectionTreeWidget¶
- class qgis.gui.QgsProjectionSelectionTreeWidget¶
Bases:
PyQt5.QtWidgets.QWidget
A widget for selecting a coordinate reference system from a tree.
This widget implements a tree view of projections, as seen in the
QgsProjectionSelectionDialog
dialog. In most cases it is more suitable to use the compactQgsProjectionSelectionWidget
widget.See also
See also
QgsProjectionSelectionTreeWidget(parent: QWidget = None, filters: Union[QgsCoordinateReferenceSystemProxyModel.Filters, QgsCoordinateReferenceSystemProxyModel.Filter] = QgsCoordinateReferenceSystemProxyModel.FilterHorizontal|QgsCoordinateReferenceSystemProxyModel.FilterCompound) Constructor for
QgsProjectionSelectionTreeWidget
, with the specifiedparent
widget.Since QGIS 3.34, the optional
filter
argument can be used to specify filters on the systems shown in the widget. The default is to show all horizontal and compound CRS in order to match the behavior of older QGIS releases. Thefilter
can be altered to also include vertical CRS if desired.Methods
Clear the list of recent projections.
Returns the CRS currently selected in the widget.
- param obj:
Returns the filters set on the available CRS.
Returns
True
if the current selection in the widget is a valid choice.The initial "preview" rectangle for the bounds overview map.
Marks the current selected projection for push to front of recent projections list.
- param event:
Sets the initial
crs
to show within the dialog.Sets
filters
for the available CRS.Sets the text to show for the not set option.
Filters this widget by the given CRSs.
Sets the initial "preview" rectangle for the bounds overview map.
Sets whether to show the bounds preview map.
Sets whether a "no/invalid" projection option should be shown.
Returns whether the bounds preview map is shown.
Returns whether the "no/invalid" projection option is shown.
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- actionEvent(self, QActionEvent)¶
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- clearRecentCrs(self)¶
Clear the list of recent projections.
New in version 3.32.
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- crs(self) QgsCoordinateReferenceSystem ¶
Returns the CRS currently selected in the widget.
See also
- Return type:
- crsSelected¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- customEvent(self, QEvent)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, QDropEvent)¶
- enterEvent(self, QEvent)¶
- event(self, QEvent) bool ¶
- eventFilter(self, obj: QObject, ev: QEvent) bool ¶
- Parameters:
obj (QObject) –
ev (QEvent) –
- Return type:
bool
- filters(self) QgsCoordinateReferenceSystemProxyModel.Filters ¶
Returns the filters set on the available CRS.
See also
New in version 3.34.
- Return type:
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- hasValidSelection(self) bool ¶
Returns
True
if the current selection in the widget is a valid choice. Valid selections include any projection and also the “no/invalid projection” option (ifsetShowNoProjection()
was called). Invalid selections are the group headers (such as “Geographic Coordinate Systems”)- Return type:
bool
- hasValidSelectionChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- hideEvent(self, QHideEvent)¶
- initPainter(self, QPainter)¶
- initialized¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- 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], PyQt5.sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, QPaintEvent)¶
- previewRect(self) QgsRectangle ¶
The initial “preview” rectangle for the bounds overview map.
See also
- Return type:
- projectionDoubleClicked¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- pushProjectionToFront(self)¶
Marks the current selected projection for push to front of recent projections list.
Deprecated since version Has: no effect since QGIS 3.20
- receivers(self, PYQT_SIGNAL) int ¶
- resizeEvent(self, event: QResizeEvent)¶
- Parameters:
event (QResizeEvent) –
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setCrs(self, crs: QgsCoordinateReferenceSystem)¶
Sets the initial
crs
to show within the dialog.See also
- Parameters:
crs (QgsCoordinateReferenceSystem) –
- setFilters(self, filters: QgsCoordinateReferenceSystemProxyModel.Filters | QgsCoordinateReferenceSystemProxyModel.Filter)¶
Sets
filters
for the available CRS.See also
New in version 3.34.
- Parameters:
filters (Union[QgsCoordinateReferenceSystemProxyModel.Filters) –
- 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
setShowNoProjection()
.New in version 3.16.
- Parameters:
text (str) –
- setOgcWmsCrsFilter(self, crsFilter: Iterable[str])¶
Filters this widget by the given CRSs.
Sets this widget to filter the available projections to those listed by the given Coordinate Reference Systems.
- Parameters:
crsFilter (Iterable[str]) – a list of the authority:id strings for Coordinate Reference Systems to include in the widget.
- setPreviewRect(self, rect: QgsRectangle)¶
Sets the initial “preview” rectangle for the bounds overview map.
See also
- Parameters:
rect (QgsRectangle) –
- setShowBoundsMap(self, show: bool)¶
Sets whether to show the bounds preview map.
See also
- Parameters:
show (bool) –
- setShowNoProjection(self, show: bool)¶
Sets whether a “no/invalid” projection option should be shown. If this option is selected, calling
crs()
will return an invalidQgsCoordinateReferenceSystem
.See also
- Parameters:
show (bool) –
- showBoundsMap(self) bool ¶
Returns whether the bounds preview map is shown.
See also
- Return type:
bool
- showEvent(self, QShowEvent)¶
- showNoProjection(self) bool ¶
Returns whether the “no/invalid” projection option is shown. If this option is selected, calling
crs()
will return an invalidQgsCoordinateReferenceSystem
.See also
- Return type:
bool
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶