QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgsprojectionselectiondialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsgenericprojectionselector.h
3 Set user defined projection using projection selector widget
4 -------------------
5 begin : May 28, 2004
6 copyright : (C) 2004 by Gary E.Sherman
7 email : sherman at mrcc.com
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18#ifndef QGSGENERICPROJECTIONSELECTOR_H
19#define QGSGENERICPROJECTIONSELECTOR_H
20#include "ui_qgsgenericprojectionselectorbase.h"
21#include "qgis_sip.h"
22#include "qgsguiutils.h"
23
24#include <QSet>
25#include <QDialog>
26
27#include "qgis_gui.h"
29
30class QDialogButtonBox;
31
39class GUI_EXPORT QgsCrsSelectionWidget : public QgsPanelWidget, private Ui::QgsGenericProjectionSelectorBase
40{
41 Q_OBJECT
42 public:
51
52 ~QgsCrsSelectionWidget() override;
53
59
63 void setMessage( const QString &message );
64
70 void setShowNoCrs( bool show );
71
77 bool showNoCrs() const;
78
86 void setNotSetText( const QString &text, const QString &description = QString() );
87
91 bool hasValidSelection() const;
92
100
107 void setFilters( QgsCoordinateReferenceSystemProxyModel::Filters filters );
108
109 public slots:
110
115 void setCrs( const QgsCoordinateReferenceSystem &crs );
116
129 void setOgcWmsCrsFilter( const QSet<QString> &crsFilter );
130
131 signals:
132
137
142
146 void hasValidSelectionChanged( bool isValid );
147
148 private:
152 enum class CrsType
153 {
154 Predefined,
155 Custom,
156 };
157
158 QString mNotSetText;
159 bool mShowNoCrsOption = false;
160 bool mDeferredInvalidCrsSet = false;
161 int mBlockSignals = 0;
162};
163
164
185class GUI_EXPORT QgsProjectionSelectionDialog : public QDialog
186{
187 Q_OBJECT
188 public:
197
203
209 void setMessage( const QString &message );
210
217 void showNoCrsForLayerMessage();
218
224 void setShowNoProjection( bool show );
225
231 bool showNoProjection() const;
232
242 void setNotSetText( const QString &text, const QString &description = QString() );
243
250 void setRequireValidSelection();
251
257 bool hasValidSelection() const;
258
266
273 void setFilters( QgsCoordinateReferenceSystemProxyModel::Filters filters );
274
275 public slots:
276
281 void setCrs( const QgsCoordinateReferenceSystem &crs );
282
295 void setOgcWmsCrsFilter( const QSet<QString> &crsFilter );
296
297 private slots:
298
299 void showHelp();
300
301 private:
302 QDialogButtonBox *mButtonBox = nullptr;
303 QgsCrsSelectionWidget *mCrsWidget = nullptr;
304
305 bool mRequireValidSelection = false;
306};
307
308#endif // #ifndef QGSLAYERCRSSELECTOR_H
@ FilterHorizontal
Include horizontal CRS (excludes compound CRS containing a horizontal component)
This class represents a coordinate reference system (CRS).
A generic widget allowing users to pick a Coordinate Reference System (or define their own).
void hasValidSelectionChanged(bool isValid)
Emitted when the widget has a valid selection or not.
void crsDoubleClicked(const QgsCoordinateReferenceSystem &crs)
Emitted when a CRS entry in the widget is double-clicked.
void crsChanged()
Emitted when the CRS defined in the widget is changed.
Base class for any widget that can be shown as a inline panel.
A generic dialog to prompt the user for a Coordinate Reference System.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
const QgsCoordinateReferenceSystem & crs