QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsextentgroupbox.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsextentgroupbox.h
3 ---------------------
4 begin : March 2014
5 copyright : (C) 2014 by Martin Dobias
6 email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSEXTENTGROUPBOX_H
17#define QGSEXTENTGROUPBOX_H
18
19#include "qgis_gui.h"
20#include "qgis_sip.h"
23#include "qgsrectangle.h"
24
26class QgsMapLayer;
27class QgsExtentWidget;
28class QgsMapCanvas;
29
44{
45 Q_OBJECT
46 Q_PROPERTY( QString titleBase READ titleBase WRITE setTitleBase )
47
48 public:
49 // TODO QGIS 4.0 -- use QgsExtentWidget enum instead
50
60
64 explicit QgsExtentGroupBox( QWidget *parent SIP_TRANSFERTHIS = nullptr );
65
71 void setOriginalExtent( const QgsRectangle &originalExtent, const QgsCoordinateReferenceSystem &originalCrs );
72
78 QgsRectangle originalExtent() const;
79
85 QgsCoordinateReferenceSystem originalCrs() const;
86
93 void setCurrentExtent( const QgsRectangle &currentExtent, const QgsCoordinateReferenceSystem &currentCrs );
94
101 QgsRectangle currentExtent() const;
102
109 QgsCoordinateReferenceSystem currentCrs() const;
110
116 void setOutputCrs( const QgsCoordinateReferenceSystem &outputCrs );
117
122 QgsRectangle outputExtent() const;
123
128 QgsCoordinateReferenceSystem outputCrs() const;
129
133 QgsExtentGroupBox::ExtentState extentState() const;
134
139 void setTitleBase( const QString &title );
140
145 QString titleBase() const;
146
152 void setMapCanvas( QgsMapCanvas *canvas, bool drawOnCanvasOption = true );
153
158 QSize ratio() const;
159
160 public slots:
161
165 void setOutputExtentFromOriginal();
166
170 void setOutputExtentFromCurrent();
171
175 void setOutputExtentFromUser( const QgsRectangle &extent, const QgsCoordinateReferenceSystem &crs );
176
180 void setOutputExtentFromLayer( const QgsMapLayer *layer );
181
185 void setOutputExtentFromDrawOnCanvas();
186
192 void setRatio( QSize ratio );
193
194 signals:
195
199 void extentChanged( const QgsRectangle &r );
200
206
207 private slots:
208
209 void groupBoxClicked();
210
211 void widgetExtentChanged();
212
213 void validationChanged( bool valid );
214
215 private:
216 void updateTitle();
217
218 QgsExtentWidget *mWidget = nullptr;
219
221 QString mTitleBase;
222};
223
224#endif // QGSEXTENTGROUPBOX_H
QgsCollapsibleGroupBox(QWidget *parent=nullptr, QgsSettings *settings=nullptr)
Represents a coordinate reference system (CRS).
Collapsible group box for configuration of extent, typically for a save operation.
ExtentState
Available states for the current extent selection in the widget.
@ UserExtent
Extent manually entered/modified by the user.
@ CurrentExtent
Map canvas extent.
@ ProjectLayerExtent
Extent taken from a layer within the project.
@ DrawOnCanvas
Extent taken from a rectangled drawn onto the map canvas.
@ OriginalExtent
Layer's extent.
QgsExtentGroupBox(QWidget *parent=nullptr)
Constructor for QgsExtentGroupBox.
void extentLayerChanged(QgsMapLayer *layer)
Emitted when the extent layer is changed.
void extentChanged(const QgsRectangle &r)
Emitted when the widget's extent is changed.
void setTitleBase(const QString &title)
Sets the base part of title of the group box (will be appended with extent state).
A widget for configuration of a map extent.
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
Definition qgsmaplayer.h:80
A rectangle specified with double values.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53