QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
|
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. More... | |
QgsRectangle | previewRect () const |
The initial "preview" rectangle for the bounds overview map. More... | |
Q_DECL_DEPRECATED void | pushProjectionToFront () |
Marks the current selected projection for push to front of recent projections list. More... | |
void | setCrs (const QgsCoordinateReferenceSystem &crs) |
Sets the initial crs to show within the dialog. More... | |
void | setOgcWmsCrsFilter (const QSet< QString > &crsFilter) |
filters this widget by the given CRSs More... | |
void | setPreviewRect (const QgsRectangle &rect) |
Sets the initial "preview" rectangle for the bounds overview map. More... | |
Signals | |
void | crsSelected () |
Emitted when a projection is selected in the widget. More... | |
void | hasValidSelectionChanged (bool isValid) |
Emitted when the selection in the tree is changed from a valid selection to an invalid selection, or vice-versa. More... | |
void | initialized () |
Notifies others that the widget is now fully initialized, including deferred selection of projection. More... | |
void | projectionDoubleClicked () |
Emitted when a projection is double clicked in the list. More... | |
Public Member Functions | |
QgsProjectionSelectionTreeWidget (QWidget *parent=nullptr) | |
Constructor for QgsProjectionSelectionTreeWidget. More... | |
~QgsProjectionSelectionTreeWidget () override | |
QgsCoordinateReferenceSystem | crs () const |
Returns the CRS currently selected in the widget. More... | |
bool | hasValidSelection () const |
Returns true if the current selection in the widget is a valid choice. More... | |
void | setNotSetText (const QString &text) |
Sets the text to show for the not set option. More... | |
void | setShowBoundsMap (bool show) |
Sets whether to show the bounds preview map. More... | |
void | setShowNoProjection (bool show) |
Sets whether a "no/invalid" projection option should be shown. More... | |
bool | showBoundsMap () const |
Returns whether the bounds preview map is shown. More... | |
bool | showNoProjection () const |
Returns whether the "no/invalid" projection option is shown. More... | |
Protected Member Functions | |
bool | eventFilter (QObject *obj, QEvent *ev) override |
void | resizeEvent (QResizeEvent *event) override |
void | showEvent (QShowEvent *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 39 of file qgsprojectionselectiontreewidget.h.
QgsProjectionSelectionTreeWidget::QgsProjectionSelectionTreeWidget | ( | QWidget * | parent = nullptr | ) |
Constructor for QgsProjectionSelectionTreeWidget.
Definition at line 40 of file qgsprojectionselectiontreewidget.cpp.
|
override |
Definition at line 128 of file qgsprojectionselectiontreewidget.cpp.
|
slot |
Clear the list of recent projections.
Definition at line 1119 of file qgsprojectionselectiontreewidget.cpp.
QgsCoordinateReferenceSystem QgsProjectionSelectionTreeWidget::crs | ( | ) | const |
Returns the CRS currently selected in the widget.
Definition at line 468 of file qgsprojectionselectiontreewidget.cpp.
|
signal |
Emitted when a projection is selected in the widget.
|
overrideprotected |
Definition at line 181 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 504 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.
|
slot |
The initial "preview" rectangle for the bounds overview map.
Definition at line 367 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 905 of file qgsprojectionselectiontreewidget.cpp.
|
overrideprotected |
Definition at line 139 of file qgsprojectionselectiontreewidget.cpp.
|
slot |
Sets the initial crs to show within the dialog.
Definition at line 332 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 494 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 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. |
Definition at line 526 of file qgsprojectionselectiontreewidget.cpp.
|
slot |
Sets the initial "preview" rectangle for the bounds overview map.
Definition at line 362 of file qgsprojectionselectiontreewidget.cpp.
void QgsProjectionSelectionTreeWidget::setShowBoundsMap | ( | bool | show | ) |
Sets whether to show the bounds preview map.
Definition at line 483 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 473 of file qgsprojectionselectiontreewidget.cpp.
bool QgsProjectionSelectionTreeWidget::showBoundsMap | ( | ) | const |
Returns whether the bounds preview map is shown.
Definition at line 499 of file qgsprojectionselectiontreewidget.cpp.
|
overrideprotected |
Definition at line 151 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 489 of file qgsprojectionselectiontreewidget.cpp.