QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgscoordinateoperationwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscoordinateoperationwidget.h
3 ------------------------------
4 begin : December 2019
5 copyright : (C) 2019 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSCOORDINATEOPERATIONWIDGET_H
19#define QGSCOORDINATEOPERATIONWIDGET_H
20
21#include "ui_qgscoordinateoperationwidgetbase.h"
22
23#include "qgis_gui.h"
25
34class GUI_EXPORT QgsCoordinateOperationWidget : public QWidget, private Ui::QgsCoordinateOperationWidgetBase
35{
36 Q_OBJECT
37 public:
40 {
43
46
48 QString proj;
49
51 bool isAvailable = true;
52
54 bool allowFallback = true;
55 };
56
60 QgsCoordinateOperationWidget( QWidget *parent = nullptr );
61
63
70 QgsCoordinateReferenceSystem sourceCrs() const { return mSourceCrs; }
71
78 QgsCoordinateReferenceSystem destinationCrs() const { return mDestinationCrs; }
79
86 void setSourceCrs( const QgsCoordinateReferenceSystem &crs );
87
94 void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
95
100 void setMapCanvas( QgsMapCanvas *canvas );
101
105 void setShowMakeDefault( bool show );
106
110 bool makeDefaultSelected() const;
111
115 bool hasSelection() const;
116
120 QList<QgsCoordinateOperationWidget::OperationDetails> availableOperations() const;
121
125 QgsCoordinateOperationWidget::OperationDetails defaultOperation() const;
126
131 QgsCoordinateOperationWidget::OperationDetails selectedOperation() const;
132
137 void setSelectedOperation( const QgsCoordinateOperationWidget::OperationDetails &operation );
138
145 void setSelectedOperationUsingContext( const QgsCoordinateTransformContext &context );
146
152 void setShowFallbackOption( bool visible );
153
154 signals:
155
160
165
166 private slots:
167
168 void tableCurrentItemChanged( QTableWidgetItem *, QTableWidgetItem * );
169
170 void showSupersededToggled( bool toggled );
171
172 void installGrid();
173
174 private:
175 enum Roles
176 {
177 TransformIdRole = Qt::UserRole + 1,
178 ProjRole,
179 AvailableRole,
180 BoundsRole,
181 MissingGridsRole,
182 MissingGridPackageNamesRole,
183 MissingGridUrlsRole
184 };
185
186 bool gridShiftTransformation( const QString &itemText ) const;
188 bool testGridShiftFileAvailability( QTableWidgetItem *item ) const;
189 void loadAvailableOperations();
190
194 QString formatScope( const QString &scope );
195
196 QList<QgsDatumTransform::TransformDetails> mDatumTransforms;
197
199 QgsCoordinateReferenceSystem mDestinationCrs;
200 OperationDetails mPreviousOp;
201 int mBlockSignals = 0;
202};
203
204#endif // QGSCOORDINATEOPERATIONWIDGET_H
QgsCoordinateReferenceSystem sourceCrs() const
Returns the source CRS for the operations shown in the widget.
void operationChanged()
Emitted when the operation selected in the dialog is changed.
void operationDoubleClicked()
Emitted when an operation is double-clicked in the widget.
QgsCoordinateOperationWidget(QWidget *parent=nullptr)
Constructor for QgsCoordinateOperationWidget.
QgsCoordinateReferenceSystem destinationCrs() const
Returns the destination CRS for the operations shown in the widget.
Represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Map canvas is a class for displaying all GIS data types on a canvas.
bool allowFallback
true if fallback transforms can be used
QString proj
Proj coordinate operation description, for Proj >= 6.0 builds only.