QGIS API Documentation 3.39.0-Master (bca3cdb6021)
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:
43
51 QgsCrsSelectionWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr,
53
54 ~QgsCrsSelectionWidget() override;
55
61
65 void setMessage( const QString &message );
66
72 void setShowNoCrs( bool show );
73
79 bool showNoCrs() const;
80
88 void setNotSetText( const QString &text, const QString &description = QString() );
89
93 bool hasValidSelection() const;
94
102
109 void setFilters( QgsCoordinateReferenceSystemProxyModel::Filters filters );
110
111 public slots:
112
117 void setCrs( const QgsCoordinateReferenceSystem &crs );
118
131 void setOgcWmsCrsFilter( const QSet<QString> &crsFilter );
132
133 signals:
134
139
144
148 void hasValidSelectionChanged( bool isValid );
149
150 private:
151
155 enum class CrsType
156 {
157 Predefined,
158 Custom,
159 };
160
161 QString mNotSetText;
162 bool mShowNoCrsOption = false;
163 bool mDeferredInvalidCrsSet = false;
164 int mBlockSignals = 0;
165
166};
167
168
169
190class GUI_EXPORT QgsProjectionSelectionDialog : public QDialog
191{
192 Q_OBJECT
193 public:
194
202 QgsProjectionSelectionDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr,
203 Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags,
205
211
217 void setMessage( const QString &message );
218
225 void showNoCrsForLayerMessage();
226
232 void setShowNoProjection( bool show );
233
239 bool showNoProjection() const;
240
250 void setNotSetText( const QString &text, const QString &description = QString() );
251
258 void setRequireValidSelection();
259
265 bool hasValidSelection() const;
266
274
281 void setFilters( QgsCoordinateReferenceSystemProxyModel::Filters filters );
282
283 public slots:
284
289 void setCrs( const QgsCoordinateReferenceSystem &crs );
290
303 void setOgcWmsCrsFilter( const QSet<QString> &crsFilter );
304
305 private slots:
306
307 void showHelp();
308
309 private:
310
311 QDialogButtonBox *mButtonBox = nullptr;
312 QgsCrsSelectionWidget *mCrsWidget = nullptr;
313
314 bool mRequireValidSelection = false;
315};
316
317#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