QGIS API Documentation  3.6.0-Noosa (5873452)
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
QgsProjectionSelectionTreeWidget Class Reference

A widget for selecting a coordinate reference system from a tree. More...

#include <qgsprojectionselectiontreewidget.h>

Inheritance diagram for QgsProjectionSelectionTreeWidget:
Inheritance graph
[legend]

Public Slots

QgsRectangle previewRect () const
 The initial "preview" rectangle for the bounds overview map. More...
 
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 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 setShowBoundsMap (bool show)
 Sets whether to show the bounnds 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

void resizeEvent (QResizeEvent *event) override
 
void showEvent (QShowEvent *event) override
 

Detailed Description

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
QgsProjectionSelectionDialog.
QgsProjectionSelectionWidget
Since
QGIS 3.0

Definition at line 41 of file qgsprojectionselectiontreewidget.h.

Constructor & Destructor Documentation

◆ QgsProjectionSelectionTreeWidget()

QgsProjectionSelectionTreeWidget::QgsProjectionSelectionTreeWidget ( QWidget *  parent = nullptr)

Constructor for QgsProjectionSelectionTreeWidget.

Definition at line 35 of file qgsprojectionselectiontreewidget.cpp.

◆ ~QgsProjectionSelectionTreeWidget()

QgsProjectionSelectionTreeWidget::~QgsProjectionSelectionTreeWidget ( )
override

Definition at line 102 of file qgsprojectionselectiontreewidget.cpp.

Member Function Documentation

◆ crs()

QgsCoordinateReferenceSystem QgsProjectionSelectionTreeWidget::crs ( ) const

Returns the CRS currently selected in the widget.

See also
setCrs()
Since
QGIS 3.0

Definition at line 474 of file qgsprojectionselectiontreewidget.cpp.

◆ crsSelected

void QgsProjectionSelectionTreeWidget::crsSelected ( )
signal

Emitted when a projection is selected in the widget.

◆ hasValidSelection()

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 508 of file qgsprojectionselectiontreewidget.cpp.

◆ initialized

void QgsProjectionSelectionTreeWidget::initialized ( )
signal

Notifies others that the widget is now fully initialized, including deferred selection of projection.

Since
QGIS 2.4

◆ previewRect

QgsRectangle QgsProjectionSelectionTreeWidget::previewRect ( ) const
slot

The initial "preview" rectangle for the bounds overview map.

See also
previewRect()
Since
QGIS 3.0

Definition at line 328 of file qgsprojectionselectiontreewidget.cpp.

◆ projectionDoubleClicked

void QgsProjectionSelectionTreeWidget::projectionDoubleClicked ( )
signal

Emitted when a projection is double clicked in the list.

Since
QGIS 2.14

◆ pushProjectionToFront

void QgsProjectionSelectionTreeWidget::pushProjectionToFront ( )
slot

Marks the current selected projection for push to front of recent projections list.

Definition at line 908 of file qgsprojectionselectiontreewidget.cpp.

◆ resizeEvent()

void QgsProjectionSelectionTreeWidget::resizeEvent ( QResizeEvent *  event)
overrideprotected

Definition at line 152 of file qgsprojectionselectiontreewidget.cpp.

◆ setCrs

void QgsProjectionSelectionTreeWidget::setCrs ( const QgsCoordinateReferenceSystem crs)
slot

Sets the initial crs to show within the dialog.

See also
crs()
Since
QGIS 3.0

Definition at line 306 of file qgsprojectionselectiontreewidget.cpp.

◆ setOgcWmsCrsFilter

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

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

Definition at line 528 of file qgsprojectionselectiontreewidget.cpp.

◆ setPreviewRect

void QgsProjectionSelectionTreeWidget::setPreviewRect ( const QgsRectangle rect)
slot

Sets the initial "preview" rectangle for the bounds overview map.

See also
previewRect()
Since
QGIS 3.0

Definition at line 319 of file qgsprojectionselectiontreewidget.cpp.

◆ setShowBoundsMap()

void QgsProjectionSelectionTreeWidget::setShowBoundsMap ( bool  show)

Sets whether to show the bounnds preview map.

See also
showBoundsMap()
Since
QGIS 3.0

Definition at line 491 of file qgsprojectionselectiontreewidget.cpp.

◆ setShowNoProjection()

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.

See also
showNoProjection()
Since
QGIS 3.0

Definition at line 486 of file qgsprojectionselectiontreewidget.cpp.

◆ showBoundsMap()

bool QgsProjectionSelectionTreeWidget::showBoundsMap ( ) const

Returns whether the bounds preview map is shown.

See also
setShowBoundsMap()
Since
QGIS 3.0

Definition at line 503 of file qgsprojectionselectiontreewidget.cpp.

◆ showEvent()

void QgsProjectionSelectionTreeWidget::showEvent ( QShowEvent *  event)
overrideprotected

Definition at line 163 of file qgsprojectionselectiontreewidget.cpp.

◆ showNoProjection()

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.

See also
setShowNoProjection()
Since
QGIS 3.0

Definition at line 498 of file qgsprojectionselectiontreewidget.cpp.


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