QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
qgsprojectionselectiontreewidget.h
Go to the documentation of this file.
1/***************************************************************************
2 * qgsprojectionselector.h *
3 * Copyright (C) 2005 by Tim Sutton *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 ***************************************************************************/
11#ifndef QGSCRSSELECTOR_H
12#define QGSCRSSELECTOR_H
13
14#include "ui_qgsprojectionselectorbase.h"
15
16#include <QSet>
17#include <QStringList>
18
19#include "qgis_sip.h"
20#include "qgis_gui.h"
23
24class QResizeEvent;
25
40class GUI_EXPORT QgsProjectionSelectionTreeWidget : public QWidget, private Ui::QgsProjectionSelectorBase
41{
42 Q_OBJECT
43
44 public:
45
53 QgsProjectionSelectionTreeWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr,
55
57
64
71 void setShowNoProjection( bool show );
72
78 void setShowBoundsMap( bool show );
79
86 bool showNoProjection() const;
87
93 void setNotSetText( const QString &text );
94
100 bool showBoundsMap() const;
101
108 bool hasValidSelection() const;
109
115 QgsRectangle previewRect() const;
116
123 QgsCoordinateReferenceSystemProxyModel::Filters filters() const;
124
131 void setFilters( QgsCoordinateReferenceSystemProxyModel::Filters filters );
132
133 public slots:
134
140 void setCrs( const QgsCoordinateReferenceSystem &crs );
141
147 void setPreviewRect( const QgsRectangle &rect );
148
158 void setOgcWmsCrsFilter( const QSet<QString> &crsFilter );
159
165 Q_DECL_DEPRECATED void pushProjectionToFront() SIP_DEPRECATED;
166
172 void clearRecentCrs();
173
174 signals:
175
180
185 Q_DECL_DEPRECATED void initialized() SIP_DEPRECATED;
186
191 void projectionDoubleClicked();
192
198 void hasValidSelectionChanged( bool isValid );
199
200 protected:
201
202 // Used to manage column sizes
203 void resizeEvent( QResizeEvent *event ) override;
204
205 // Used to catch key presses on the recent projections list
206 bool eventFilter( QObject *obj, QEvent *ev ) override;
207
208 private:
209
210 void loadUnknownCrs( const QgsCoordinateReferenceSystem &crs );
211
212 void selectCrsByAuthId( const QString &authid );
213
214 enum Roles
215 {
216 RoleDeprecated = Qt::UserRole,
217 RoleWkt,
218 RoleProj
219 };
220
221 QgsCoordinateReferenceSystemProxyModel *mCrsModel = nullptr;
222
224 void insertRecent( const QgsCoordinateReferenceSystem &crs );
225
226 enum Columns { NameColumn, AuthidColumn, QgisCrsIdColumn, ClearColumn };
227
229 QList< QgsCoordinateReferenceSystem > mRecentProjections;
230
231 bool mShowMap = true;
232
233 bool mBlockSignals = false;
234
235 private slots:
236
237 void updateBoundsPreview();
238
240 void lstCoordinateSystemsDoubleClicked( const QModelIndex &index );
241 void lstRecent_itemDoubleClicked( QTreeWidgetItem *current, int column );
242 void lstCoordinateSystemsSelectionChanged( const QItemSelection &selected, const QItemSelection &deselected );
243 void lstRecent_currentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem *prev );
244 void filterRecentCrsList();
245
246 void removeRecentCrsItem( QTreeWidgetItem *item );
247};
248
249#endif
A sort/filter proxy model for coordinate reference systems.
@ FilterHorizontal
Include horizontal CRS (excludes compound CRS containing a horizontal component)
This class represents a coordinate reference system (CRS).
A widget for selecting a coordinate reference system from a tree.
void crsSelected()
Emitted when a projection is selected in the widget.
Q_DECL_DEPRECATED void initialized()
Notifies others that the widget is now fully initialized, including deferred selection of projection.
A rectangle specified with double values.
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
const QgsCoordinateReferenceSystem & crs