QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
proj
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
22
#include "qgis_gui.h"
23
#include "
qgis_sip.h
"
24
#include "
qgscoordinatereferencesystem.h
"
25
#include "
qgsguiutils.h
"
26
27
#include <QDialog>
28
#include <QSet>
29
30
class
QDialogButtonBox;
31
class
QgsRectangle
;
32
40
class
GUI_EXPORT
QgsCrsSelectionWidget
:
public
QgsPanelWidget
,
private
Ui::QgsGenericProjectionSelectorBase
41
{
42
Q_OBJECT
43
public
:
51
QgsCrsSelectionWidget
(
52
QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
,
53
QgsCoordinateReferenceSystemProxyModel::Filters
filters
=
QgsCoordinateReferenceSystemProxyModel::FilterHorizontal
|
QgsCoordinateReferenceSystemProxyModel::FilterCompound
54
);
55
56
~QgsCrsSelectionWidget
()
override
;
57
62
QgsCoordinateReferenceSystem
crs
()
const
;
63
67
void
setMessage
(
const
QString &message );
68
74
void
setShowNoCrs
(
bool
show );
75
81
bool
showNoCrs
()
const
;
82
90
void
setNotSetText
(
const
QString &text,
const
QString &description = QString() );
91
95
bool
hasValidSelection
()
const
;
96
103
QgsCoordinateReferenceSystemProxyModel::Filters
filters
()
const
;
104
111
void
setFilters
(
QgsCoordinateReferenceSystemProxyModel::Filters
filters
);
112
120
void
setAllowTopocentricCrs
(
bool
allow );
121
127
void
setPreviewRect
(
const
QgsRectangle
&rect );
128
129
public
slots:
130
135
void
setCrs
(
const
QgsCoordinateReferenceSystem
&
crs
);
136
149
void
setOgcWmsCrsFilter
(
const
QSet<QString> &crsFilter );
150
151
signals:
152
156
void
crsChanged
();
157
161
void
crsDoubleClicked
(
const
QgsCoordinateReferenceSystem
&
crs
);
162
166
void
hasValidSelectionChanged
(
bool
isValid );
167
168
private
:
172
enum class
CrsType
173
{
174
Predefined,
175
Custom,
176
Topocentric,
177
};
178
179
QString mNotSetText;
180
bool
mShowNoCrsOption =
false
;
181
bool
mDeferredInvalidCrsSet =
false
;
182
bool
mAllowTopocentricCrs =
true
;
183
int
mBlockSignals = 0;
184
};
185
186
207
class
GUI_EXPORT
QgsProjectionSelectionDialog
:
public
QDialog
208
{
209
Q_OBJECT
210
public
:
218
QgsProjectionSelectionDialog
(
219
QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
,
220
Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags,
221
QgsCoordinateReferenceSystemProxyModel::Filters
filters
=
QgsCoordinateReferenceSystemProxyModel::FilterHorizontal
|
QgsCoordinateReferenceSystemProxyModel::FilterCompound
222
);
223
228
QgsCoordinateReferenceSystem
crs
()
const
;
229
235
void
setMessage
(
const
QString &message );
236
243
void
showNoCrsForLayerMessage
();
244
250
void
setShowNoProjection
(
bool
show );
251
257
bool
showNoProjection
()
const
;
258
268
void
setNotSetText
(
const
QString &text,
const
QString &description = QString() );
269
276
void
setRequireValidSelection
();
277
283
bool
hasValidSelection
()
const
;
284
291
QgsCoordinateReferenceSystemProxyModel::Filters
filters
()
const
;
292
299
void
setFilters
(
QgsCoordinateReferenceSystemProxyModel::Filters
filters
);
300
307
void
setAllowTopocentricCrs
(
bool
allow );
308
309
public
slots:
310
315
void
setCrs
(
const
QgsCoordinateReferenceSystem
&
crs
);
316
329
void
setOgcWmsCrsFilter
(
const
QSet<QString> &crsFilter );
330
331
private
slots:
332
333
void
showHelp();
334
335
private
:
336
QDialogButtonBox *mButtonBox =
nullptr
;
337
QgsCrsSelectionWidget
*mCrsWidget =
nullptr
;
338
339
bool
mRequireValidSelection =
false
;
340
};
341
342
#endif
// #ifndef QGSLAYERCRSSELECTOR_H
QgsCoordinateReferenceSystemProxyModel::Filters
QFlags< Filter > Filters
Definition
qgscoordinatereferencesystemmodel.h:347
QgsCoordinateReferenceSystemProxyModel::FilterCompound
@ FilterCompound
Include compound CRS.
Definition
qgscoordinatereferencesystemmodel.h:344
QgsCoordinateReferenceSystemProxyModel::FilterHorizontal
@ FilterHorizontal
Include horizontal CRS (excludes compound CRS containing a horizontal component).
Definition
qgscoordinatereferencesystemmodel.h:342
QgsCoordinateReferenceSystem
Represents a coordinate reference system (CRS).
Definition
qgscoordinatereferencesystem.h:216
QgsCrsSelectionWidget
A generic widget allowing users to pick a Coordinate Reference System (or define their own).
Definition
qgsprojectionselectiondialog.h:41
QgsCrsSelectionWidget::showNoCrs
bool showNoCrs() const
Returns whether the "no/invalid" CRS option is shown.
Definition
qgsprojectionselectiondialog.cpp:203
QgsCrsSelectionWidget::crs
QgsCoordinateReferenceSystem crs() const
Returns the CRS currently selected in the widget.
Definition
qgsprojectionselectiondialog.cpp:267
QgsCrsSelectionWidget::setAllowTopocentricCrs
void setAllowTopocentricCrs(bool allow)
Sets whether the topocentric CRS type option is shown in the widget's CRS type combobox.
Definition
qgsprojectionselectiondialog.cpp:254
QgsCrsSelectionWidget::hasValidSelectionChanged
void hasValidSelectionChanged(bool isValid)
Emitted when the widget has a valid selection or not.
QgsCrsSelectionWidget::QgsCrsSelectionWidget
QgsCrsSelectionWidget(QWidget *parent=nullptr, QgsCoordinateReferenceSystemProxyModel::Filters filters=QgsCoordinateReferenceSystemProxyModel::FilterHorizontal|QgsCoordinateReferenceSystemProxyModel::FilterCompound)
Constructor for QgsCrsSelectionWidget, with the specified parent widget.
Definition
qgsprojectionselectiondialog.cpp:41
QgsCrsSelectionWidget::filters
QgsCoordinateReferenceSystemProxyModel::Filters filters() const
Returns the filters set on the available CRS.
Definition
qgsprojectionselectiondialog.cpp:244
QgsCrsSelectionWidget::setFilters
void setFilters(QgsCoordinateReferenceSystemProxyModel::Filters filters)
Sets filters for the available CRS.
Definition
qgsprojectionselectiondialog.cpp:249
QgsCrsSelectionWidget::crsDoubleClicked
void crsDoubleClicked(const QgsCoordinateReferenceSystem &crs)
Emitted when a CRS entry in the widget is double-clicked.
QgsCrsSelectionWidget::setShowNoCrs
void setShowNoCrs(bool show)
Sets whether a "no/invalid" CRS option should be shown.
Definition
qgsprojectionselectiondialog.cpp:172
QgsCrsSelectionWidget::crsChanged
void crsChanged()
Emitted when the CRS defined in the widget is changed.
QgsCrsSelectionWidget::setMessage
void setMessage(const QString &message)
Sets a message to show in the dialog.
Definition
qgsprojectionselectiondialog.cpp:166
QgsCrsSelectionWidget::hasValidSelection
bool hasValidSelection() const
Returns true if the widget has a valid CRS defined.
Definition
qgsprojectionselectiondialog.cpp:220
QgsCrsSelectionWidget::setNotSetText
void setNotSetText(const QString &text, const QString &description=QString())
Sets the text to show for the not set option.
Definition
qgsprojectionselectiondialog.cpp:208
QgsCrsSelectionWidget::setOgcWmsCrsFilter
void setOgcWmsCrsFilter(const QSet< QString > &crsFilter)
filters this dialog by the given CRSs
Definition
qgsprojectionselectiondialog.cpp:339
QgsCrsSelectionWidget::setPreviewRect
void setPreviewRect(const QgsRectangle &rect)
Sets the visible area to use when showing a preview of the CRS in the widget.
Definition
qgsprojectionselectiondialog.cpp:344
QgsCrsSelectionWidget::setCrs
void setCrs(const QgsCoordinateReferenceSystem &crs)
Sets the crs to show within the widget.
Definition
qgsprojectionselectiondialog.cpp:289
QgsPanelWidget::QgsPanelWidget
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
Definition
qgspanelwidget.cpp:30
QgsProjectionSelectionDialog::showNoCrsForLayerMessage
void showNoCrsForLayerMessage()
When called, the dialog will show a default "layer has no CRS set" message above the projection selec...
Definition
qgsprojectionselectiondialog.cpp:382
QgsProjectionSelectionDialog::setShowNoProjection
void setShowNoProjection(bool show)
Sets whether a "no/invalid" projection option should be shown.
Definition
qgsprojectionselectiondialog.cpp:394
QgsProjectionSelectionDialog::showNoProjection
bool showNoProjection() const
Returns whether the "no/invalid" projection option is shown.
Definition
qgsprojectionselectiondialog.cpp:399
QgsProjectionSelectionDialog::filters
QgsCoordinateReferenceSystemProxyModel::Filters filters() const
Returns the filters set on the available CRS.
Definition
qgsprojectionselectiondialog.cpp:422
QgsProjectionSelectionDialog::hasValidSelection
bool hasValidSelection() const
Returns true if the dialog has a valid CRS defined.
Definition
qgsprojectionselectiondialog.cpp:417
QgsProjectionSelectionDialog::setNotSetText
void setNotSetText(const QString &text, const QString &description=QString())
Sets the text to show for the not set option.
Definition
qgsprojectionselectiondialog.cpp:404
QgsProjectionSelectionDialog::setCrs
void setCrs(const QgsCoordinateReferenceSystem &crs)
Sets the initial crs to show within the dialog.
Definition
qgsprojectionselectiondialog.cpp:442
QgsProjectionSelectionDialog::setMessage
void setMessage(const QString &message)
Sets a message to show in the dialog.
Definition
qgsprojectionselectiondialog.cpp:377
QgsProjectionSelectionDialog::crs
QgsCoordinateReferenceSystem crs() const
Returns the CRS currently selected in the widget.
Definition
qgsprojectionselectiondialog.cpp:437
QgsProjectionSelectionDialog::QgsProjectionSelectionDialog
QgsProjectionSelectionDialog(QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags, QgsCoordinateReferenceSystemProxyModel::Filters filters=QgsCoordinateReferenceSystemProxyModel::FilterHorizontal|QgsCoordinateReferenceSystemProxyModel::FilterCompound)
Constructor for QgsProjectionSelectionDialog.
Definition
qgsprojectionselectiondialog.cpp:354
QgsProjectionSelectionDialog::setRequireValidSelection
void setRequireValidSelection()
Sets the dialog to require a valid selection only, preventing users from accepting the dialog if no s...
Definition
qgsprojectionselectiondialog.cpp:409
QgsProjectionSelectionDialog::setOgcWmsCrsFilter
void setOgcWmsCrsFilter(const QSet< QString > &crsFilter)
filters this dialog by the given CRSs
Definition
qgsprojectionselectiondialog.cpp:450
QgsProjectionSelectionDialog::setFilters
void setFilters(QgsCoordinateReferenceSystemProxyModel::Filters filters)
Sets filters for the available CRS.
Definition
qgsprojectionselectiondialog.cpp:427
QgsProjectionSelectionDialog::setAllowTopocentricCrs
void setAllowTopocentricCrs(bool allow)
Sets whether the topocentric CRS type option is shown in the dialog.
Definition
qgsprojectionselectiondialog.cpp:432
QgsRectangle
A rectangle specified with double values.
Definition
qgsrectangle.h:47
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgscoordinatereferencesystem.h
qgsguiutils.h
Generated on
for QGIS API Documentation by
1.17.0