Class: QgsProjectionSelectionTreeWidget¶
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 compact
QgsProjectionSelectionWidget widget.
See also
See also
QgsProjectionSelectionTreeWidget¶
Class Hierarchy¶
Base classes¶
- class qgis.gui.QgsProjectionSelectionTreeWidget[source]¶
Bases:
QWidget- __init__(parent: QWidget | None = None, filters: QgsCoordinateReferenceSystemProxyModel.Filters | QgsCoordinateReferenceSystemProxyModel.Filter = QgsCoordinateReferenceSystemProxyModel.FilterHorizontal | QgsCoordinateReferenceSystemProxyModel.FilterCompound)
Constructor for QgsProjectionSelectionTreeWidget, with the specified
parentwidget.Since QGIS 3.34, the optional
filterargument 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. Thefiltercan be altered to also include vertical CRS if desired.- Parameters:
parent (Optional[QWidget] = None)
filters (Union[QgsCoordinateReferenceSystemProxyModel.Filters, QgsCoordinateReferenceSystemProxyModel.Filter] = QgsCoordinateReferenceSystemProxyModel.FilterHorizontal|QgsCoordinateReferenceSystemProxyModel.FilterCompound)
- crs(self) QgsCoordinateReferenceSystem[source]¶
Returns the CRS currently selected in the widget.
See also
- Return type:
- signal crsSelected[source]¶
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.
- filters(self) QgsCoordinateReferenceSystemProxyModel.Filters[source]¶
Returns the filters set on the available CRS.
See also
Added in version 3.34.
- Return type:
- hasValidSelection(self) bool[source]¶
Returns
Trueif 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
- signal hasValidSelectionChanged[source]¶
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.
- signal initialized[source]¶
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.
- previewRect(self) QgsRectangle[source]¶
The initial “preview” rectangle for the bounds overview map.
See also
- Return type:
- signal projectionDoubleClicked[source]¶
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.
- pushProjectionToFront(self)[source]¶
Marks the current selected projection for push to front of recent projections list.
Deprecated since version 3.40: Has no effect since QGIS 3.20.
- setCrs(self, crs: QgsCoordinateReferenceSystem)[source]¶
Sets the initial
crsto show within the dialog.See also
- Parameters:
- setFilters(self, filters: QgsCoordinateReferenceSystemProxyModel.Filters | QgsCoordinateReferenceSystemProxyModel.Filter)[source]¶
Sets
filtersfor the available CRS.See also
Added in version 3.34.
- Parameters:
filters (Union[QgsCoordinateReferenceSystemProxyModel.Filters, QgsCoordinateReferenceSystemProxyModel.Filter])
- setNotSetText(self, text: str | None)[source]¶
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().Added in version 3.16.
- Parameters:
text (Optional[str])
- setOgcWmsCrsFilter(self, crsFilter: Iterable[str | None])[source]¶
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[Optional[str]]) – a list of the authority:id strings for Coordinate Reference Systems to include in the widget.
- setPreviewRect(self, rect: QgsRectangle)[source]¶
Sets the initial “preview” rectangle for the bounds overview map.
See also
- Parameters:
rect (QgsRectangle)
- setShowBoundsMap(self, show: bool)[source]¶
Sets whether to show the bounds preview map.
See also
- Parameters:
show (bool)
- setShowNoProjection(self, show: bool)[source]¶
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[source]¶
Returns whether the bounds preview map is shown.
See also
- Return type:
bool
- showNoProjection(self) bool[source]¶
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