QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
A widget for selecting a coordinate reference system from a tree. More...
#include <qgsprojectionselectiontreewidget.h>
Public Slots | |
void | clearRecentCrs () |
Clear the list of recent projections. | |
Q_DECL_DEPRECATED void | pushProjectionToFront () |
Marks the current selected projection for push to front of recent projections list. | |
void | setCrs (const QgsCoordinateReferenceSystem &crs) |
Sets the initial crs to show within the dialog. | |
void | setOgcWmsCrsFilter (const QSet< QString > &crsFilter) |
Filters this widget by the given CRSs. | |
void | setPreviewRect (const QgsRectangle &rect) |
Sets the initial "preview" rectangle for the bounds overview map. | |
Signals | |
void | crsSelected () |
Emitted when a projection is selected in the widget. | |
void | hasValidSelectionChanged (bool isValid) |
Emitted when the selection in the tree is changed from a valid selection to an invalid selection, or vice-versa. | |
Q_DECL_DEPRECATED void | initialized () |
Notifies others that the widget is now fully initialized, including deferred selection of projection. | |
void | projectionDoubleClicked () |
Emitted when a projection is double clicked in the list. | |
Public Member Functions | |
QgsProjectionSelectionTreeWidget (QWidget *parent=nullptr, QgsCoordinateReferenceSystemProxyModel::Filters filters=QgsCoordinateReferenceSystemProxyModel::FilterHorizontal|QgsCoordinateReferenceSystemProxyModel::FilterCompound) | |
Constructor for QgsProjectionSelectionTreeWidget, with the specified parent widget. | |
~QgsProjectionSelectionTreeWidget () override | |
QgsCoordinateReferenceSystem | crs () const |
Returns the CRS currently selected in the widget. | |
QgsCoordinateReferenceSystemProxyModel::Filters | filters () const |
Returns the filters set on the available CRS. | |
bool | hasValidSelection () const |
Returns true if the current selection in the widget is a valid choice. | |
QgsRectangle | previewRect () const |
The initial "preview" rectangle for the bounds overview map. | |
void | setFilters (QgsCoordinateReferenceSystemProxyModel::Filters filters) |
Sets filters for the available CRS. | |
void | setNotSetText (const QString &text) |
Sets the text to show for the not set option. | |
void | setShowBoundsMap (bool show) |
Sets whether to show the bounds preview map. | |
void | setShowNoProjection (bool show) |
Sets whether a "no/invalid" projection option should be shown. | |
bool | showBoundsMap () const |
Returns whether the bounds preview map is shown. | |
bool | showNoProjection () const |
Returns whether the "no/invalid" projection option is shown. | |
Protected Member Functions | |
bool | eventFilter (QObject *obj, QEvent *ev) override |
void | resizeEvent (QResizeEvent *event) override |
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.
Definition at line 74 of file qgsprojectionselectiontreewidget.h.
QgsProjectionSelectionTreeWidget::QgsProjectionSelectionTreeWidget | ( | QWidget * | parent = nullptr , |
QgsCoordinateReferenceSystemProxyModel::Filters | filters = QgsCoordinateReferenceSystemProxyModel::FilterHorizontal | QgsCoordinateReferenceSystemProxyModel::FilterCompound |
||
) |
Constructor for QgsProjectionSelectionTreeWidget, with the specified parent 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. The filter can be altered to also include vertical CRS if desired.
Definition at line 44 of file qgsprojectionselectiontreewidget.cpp.
|
override |
Definition at line 152 of file qgsprojectionselectiontreewidget.cpp.
|
slot |
Clear the list of recent projections.
Definition at line 570 of file qgsprojectionselectiontreewidget.cpp.
QgsCoordinateReferenceSystem QgsProjectionSelectionTreeWidget::crs | ( | ) | const |
Returns the CRS currently selected in the widget.
Definition at line 266 of file qgsprojectionselectiontreewidget.cpp.
|
signal |
Emitted when a projection is selected in the widget.
|
overrideprotected |
Definition at line 173 of file qgsprojectionselectiontreewidget.cpp.
QgsCoordinateReferenceSystemProxyModel::Filters QgsProjectionSelectionTreeWidget::filters | ( | ) | const |
Returns the filters set on the available CRS.
Definition at line 250 of file qgsprojectionselectiontreewidget.cpp.
bool QgsProjectionSelectionTreeWidget::hasValidSelection | ( | ) | const |
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 (if setShowNoProjection() was called). Invalid selections are the group headers (such as "Geographic Coordinate Systems")
Definition at line 323 of file qgsprojectionselectiontreewidget.cpp.
|
signal |
Emitted when the selection in the tree is changed from a valid selection to an invalid selection, or vice-versa.
|
signal |
Notifies others that the widget is now fully initialized, including deferred selection of projection.
QgsRectangle QgsProjectionSelectionTreeWidget::previewRect | ( | ) | const |
The initial "preview" rectangle for the bounds overview map.
Definition at line 245 of file qgsprojectionselectiontreewidget.cpp.
|
signal |
Emitted when a projection is double clicked in the list.
|
slot |
Marks the current selected projection for push to front of recent projections list.
Definition at line 476 of file qgsprojectionselectiontreewidget.cpp.
|
overrideprotected |
Definition at line 163 of file qgsprojectionselectiontreewidget.cpp.
|
slot |
Sets the initial crs to show within the dialog.
Definition at line 214 of file qgsprojectionselectiontreewidget.cpp.
void QgsProjectionSelectionTreeWidget::setFilters | ( | QgsCoordinateReferenceSystemProxyModel::Filters | filters | ) |
Sets filters for the available CRS.
Definition at line 255 of file qgsprojectionselectiontreewidget.cpp.
void QgsProjectionSelectionTreeWidget::setNotSetText | ( | const QString & | text | ) |
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().
Definition at line 313 of file qgsprojectionselectiontreewidget.cpp.
|
slot |
Filters this widget by the given CRSs.
Sets this widget to filter the available projections to those listed by the given Coordinate Reference Systems.
crsFilter | a list of the authority:id strings for Coordinate Reference Systems to include in the widget. |
Definition at line 339 of file qgsprojectionselectiontreewidget.cpp.
|
slot |
Sets the initial "preview" rectangle for the bounds overview map.
Definition at line 240 of file qgsprojectionselectiontreewidget.cpp.
void QgsProjectionSelectionTreeWidget::setShowBoundsMap | ( | bool | show | ) |
Sets whether to show the bounds preview map.
Definition at line 302 of file qgsprojectionselectiontreewidget.cpp.
void QgsProjectionSelectionTreeWidget::setShowNoProjection | ( | bool | show | ) |
Sets whether a "no/invalid" projection option should be shown.
If this option is selected, calling crs() will return an invalid QgsCoordinateReferenceSystem.
Definition at line 292 of file qgsprojectionselectiontreewidget.cpp.
bool QgsProjectionSelectionTreeWidget::showBoundsMap | ( | ) | const |
Returns whether the bounds preview map is shown.
Definition at line 318 of file qgsprojectionselectiontreewidget.cpp.
bool QgsProjectionSelectionTreeWidget::showNoProjection | ( | ) | const |
Returns whether the "no/invalid" projection option is shown.
If this option is selected, calling crs() will return an invalid QgsCoordinateReferenceSystem.
Definition at line 308 of file qgsprojectionselectiontreewidget.cpp.