QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | List of all members
QgsCrsSelectionWidget Class Reference

A generic widget allowing users to pick a Coordinate Reference System (or define their own). More...

#include <qgsprojectionselectiondialog.h>

Inheritance diagram for QgsCrsSelectionWidget:
Inheritance graph
[legend]

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 QgsPanelWidgetfindParentPanel (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.
 

Detailed Description

A generic widget allowing users to pick a Coordinate Reference System (or define their own).

Since
QGIS 3.24

Definition at line 39 of file qgsprojectionselectiondialog.h.

Constructor & Destructor Documentation

◆ QgsCrsSelectionWidget()

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.

◆ ~QgsCrsSelectionWidget()

QgsCrsSelectionWidget::~QgsCrsSelectionWidget ( )
override

Definition at line 113 of file qgsprojectionselectiondialog.cpp.

Member Function Documentation

◆ crs()

QgsCoordinateReferenceSystem QgsCrsSelectionWidget::crs ( ) const

Returns the CRS currently selected in the widget.

See also
setCrs()

Definition at line 203 of file qgsprojectionselectiondialog.cpp.

◆ crsChanged

void QgsCrsSelectionWidget::crsChanged ( )
signal

Emitted when the CRS defined in the widget is changed.

◆ crsDoubleClicked

void QgsCrsSelectionWidget::crsDoubleClicked ( const QgsCoordinateReferenceSystem crs)
signal

Emitted when a CRS entry in the widget is double-clicked.

◆ filters()

QgsCoordinateReferenceSystemProxyModel::Filters QgsCrsSelectionWidget::filters ( ) const

Returns the filters set on the available CRS.

See also
setFilters()
Since
QGIS 3.36

Definition at line 193 of file qgsprojectionselectiondialog.cpp.

◆ hasValidSelection()

bool QgsCrsSelectionWidget::hasValidSelection ( ) const

Returns true if the widget has a valid CRS defined.

Definition at line 174 of file qgsprojectionselectiondialog.cpp.

◆ hasValidSelectionChanged

void QgsCrsSelectionWidget::hasValidSelectionChanged ( bool  isValid)
signal

Emitted when the widget has a valid selection or not.

◆ setCrs

void QgsCrsSelectionWidget::setCrs ( const QgsCoordinateReferenceSystem crs)
slot

Sets the crs to show within the widget.

See also
crs()

Definition at line 220 of file qgsprojectionselectiondialog.cpp.

◆ setFilters()

void QgsCrsSelectionWidget::setFilters ( QgsCoordinateReferenceSystemProxyModel::Filters  filters)

Sets filters for the available CRS.

See also
filters()
Since
QGIS 3.36

Definition at line 198 of file qgsprojectionselectiondialog.cpp.

◆ setMessage()

void QgsCrsSelectionWidget::setMessage ( const QString &  message)

Sets a message to show in the dialog.

Definition at line 119 of file qgsprojectionselectiondialog.cpp.

◆ setNotSetText()

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.

◆ setOgcWmsCrsFilter

void QgsCrsSelectionWidget::setOgcWmsCrsFilter ( const QSet< QString > &  crsFilter)
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.

Parameters
crsFiltera 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.
Warning
This function's behavior is undefined if it is called after the dialog is shown.

Definition at line 251 of file qgsprojectionselectiondialog.cpp.

◆ setShowNoCrs()

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.

See also
showNoCrs()

Definition at line 126 of file qgsprojectionselectiondialog.cpp.

◆ showNoCrs()

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.

See also
setShowNoCrs()

Definition at line 157 of file qgsprojectionselectiondialog.cpp.


The documentation for this class was generated from the following files: