QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
|
A generic widget allowing users to pick a Coordinate Reference System (or define their own). More...
#include <qgsprojectionselectiondialog.h>
Public Slots | |
void | setCrs (const QgsCoordinateReferenceSystem &crs) |
Sets the crs to show within the widget. | |
void | setOgcWmsCrsFilter (const QSet< QString > &crsFilter) |
filters this dialog by the given CRSs | |
Public Slots inherited from QgsPanelWidget | |
void | acceptPanel () |
Accept the panel. | |
void | openPanel (QgsPanelWidget *panel) |
Open a panel or dialog depending on dock mode setting If dock mode is true this method will emit the showPanel signal for connected slots to handle the open event. | |
Signals | |
void | crsChanged () |
Emitted when the CRS defined in the widget is changed. | |
void | crsDoubleClicked (const QgsCoordinateReferenceSystem &crs) |
Emitted when a CRS entry in the widget is double-clicked. | |
void | hasValidSelectionChanged (bool isValid) |
Emitted when the widget has a valid selection or not. | |
Signals inherited from QgsPanelWidget | |
void | panelAccepted (QgsPanelWidget *panel) |
Emitted when the panel is accepted by the user. | |
void | showPanel (QgsPanelWidget *panel) |
Emit when you require a panel to be show in the interface. | |
void | widgetChanged () |
Emitted when the widget state changes. | |
Public Member Functions | |
QgsCrsSelectionWidget (QWidget *parent=nullptr, QgsCoordinateReferenceSystemProxyModel::Filters filters=QgsCoordinateReferenceSystemProxyModel::FilterHorizontal|QgsCoordinateReferenceSystemProxyModel::FilterCompound) | |
Constructor for QgsCrsSelectionWidget, with the specified parent widget. | |
~QgsCrsSelectionWidget () 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 widget has a valid CRS defined. | |
void | setFilters (QgsCoordinateReferenceSystemProxyModel::Filters filters) |
Sets filters for the available CRS. | |
void | setMessage (const QString &message) |
Sets a message to show in the dialog. | |
void | setNotSetText (const QString &text, const QString &description=QString()) |
Sets the text to show for the not set option. | |
void | setShowNoCrs (bool show) |
Sets whether a "no/invalid" CRS option should be shown. | |
bool | showNoCrs () const |
Returns whether the "no/invalid" CRS option is shown. | |
Public Member Functions inherited from QgsPanelWidget | |
QgsPanelWidget (QWidget *parent=nullptr) | |
Base class for any widget that can be shown as a inline panel. | |
virtual bool | applySizeConstraintsToStack () const |
Returns true if the size constraints and hints for the panel widget should be applied to the parent QgsPanelWidgetStack which this panel is shown in. | |
bool | autoDelete () |
The the auto delete property on the widget. | |
void | connectChildPanel (QgsPanelWidget *panel) |
Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user. | |
void | connectChildPanels (const QList< QgsPanelWidget * > &panels) |
Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user. | |
bool | dockMode () |
Returns the dock mode state. | |
virtual QMenu * | menuButtonMenu () |
Returns the menu to use for the menu button for this panel, or nullptr if no menu button is required. | |
virtual QString | menuButtonTooltip () const |
Returns the (translated) tooltip text to use for the menu button for this panel. | |
QString | panelTitle () |
The title of the panel. | |
void | setAutoDelete (bool autoDelete) |
The the auto delete property on the widget. | |
virtual void | setDockMode (bool dockMode) |
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs. | |
void | setPanelTitle (const QString &panelTitle) |
Set the title of the panel when shown in the interface. | |
Additional Inherited Members | |
Static Public Member Functions inherited from QgsPanelWidget | |
static QgsPanelWidget * | findParentPanel (QWidget *widget) |
Traces through the parents of a widget to find if it is contained within a QgsPanelWidget widget. | |
Protected Member Functions inherited from QgsPanelWidget | |
void | keyPressEvent (QKeyEvent *event) override |
Overridden key press event to handle the esc event on the widget. | |
A generic widget allowing users to pick a Coordinate Reference System (or define their own).
Definition at line 39 of file qgsprojectionselectiondialog.h.
QgsCrsSelectionWidget::QgsCrsSelectionWidget | ( | QWidget * | parent = nullptr , |
QgsCoordinateReferenceSystemProxyModel::Filters | filters = QgsCoordinateReferenceSystemProxyModel::FilterHorizontal | QgsCoordinateReferenceSystemProxyModel::FilterCompound |
||
) |
Constructor for QgsCrsSelectionWidget, with the specified parent widget.
Since QGIS 3.36, 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 32 of file qgsprojectionselectiondialog.cpp.
|
override |
Definition at line 113 of file qgsprojectionselectiondialog.cpp.
QgsCoordinateReferenceSystem QgsCrsSelectionWidget::crs | ( | ) | const |
Returns the CRS currently selected in the widget.
Definition at line 203 of file qgsprojectionselectiondialog.cpp.
|
signal |
Emitted when the CRS defined in the widget is changed.
|
signal |
Emitted when a CRS entry in the widget is double-clicked.
QgsCoordinateReferenceSystemProxyModel::Filters QgsCrsSelectionWidget::filters | ( | ) | const |
Returns the filters set on the available CRS.
Definition at line 193 of file qgsprojectionselectiondialog.cpp.
bool QgsCrsSelectionWidget::hasValidSelection | ( | ) | const |
Returns true
if the widget has a valid CRS defined.
Definition at line 174 of file qgsprojectionselectiondialog.cpp.
|
signal |
Emitted when the widget has a valid selection or not.
|
slot |
Sets the crs to show within the widget.
Definition at line 220 of file qgsprojectionselectiondialog.cpp.
void QgsCrsSelectionWidget::setFilters | ( | QgsCoordinateReferenceSystemProxyModel::Filters | filters | ) |
Sets filters for the available CRS.
Definition at line 198 of file qgsprojectionselectiondialog.cpp.
void QgsCrsSelectionWidget::setMessage | ( | const QString & | message | ) |
Sets a message to show in the dialog.
Definition at line 119 of file qgsprojectionselectiondialog.cpp.
void QgsCrsSelectionWidget::setNotSetText | ( | const QString & | text, |
const QString & | description = QString() |
||
) |
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 setShowNoCrs().
The description argument can be used to specify a detailed description which is shown when the option is selected.
Definition at line 162 of file qgsprojectionselectiondialog.cpp.
|
slot |
filters this dialog by the given CRSs
Sets this dialog to filter the available CRSs to those listed by the given Coordinate Reference Systems.
crsFilter | a list of OGC Coordinate Reference Systems to filter the list of CRS by. This is useful in (e.g.) WMS situations where you just want to offer what the WMS server can support. |
Definition at line 251 of file qgsprojectionselectiondialog.cpp.
void QgsCrsSelectionWidget::setShowNoCrs | ( | bool | show | ) |
Sets whether a "no/invalid" CRS option should be shown.
If this option is selected, calling crs() will return an invalid QgsCoordinateReferenceSystem.
Definition at line 126 of file qgsprojectionselectiondialog.cpp.
bool QgsCrsSelectionWidget::showNoCrs | ( | ) | const |
Returns whether the "no/invalid" CRS option is shown.
If this option is selected, calling crs() will return an invalid QgsCoordinateReferenceSystem.
Definition at line 157 of file qgsprojectionselectiondialog.cpp.