16 #ifndef QGSEXTENTWIDGET_H
17 #define QGSEXTENTWIDGET_H
24 #include "ui_qgsextentgroupboxwidget.h"
31 #include <QRegularExpression>
50 class GUI_EXPORT
QgsExtentWidget :
public QWidget,
private Ui::QgsExtentGroupBoxWidget
152 void setMapCanvas(
QgsMapCanvas *canvas,
bool drawOnCanvasOption =
true );
158 QSize
ratio()
const {
return mRatio; }
163 QString extentLayerName()
const;
168 bool isValid()
const;
177 void setNullValueAllowed(
bool allowed,
const QString ¬SetText = QString() );
184 void setOutputExtentFromOriginal();
189 void setOutputExtentFromCurrent();
199 void setOutputExtentFromLayer(
const QgsMapLayer *layer );
204 void setOutputExtentFromDrawOnCanvas();
238 void dragEnterEvent( QDragEnterEvent *event )
override;
239 void dragLeaveEvent( QDragLeaveEvent *event )
override;
240 void dropEvent( QDropEvent *event )
override;
244 void layerMenuAboutToShow();
250 void setOutputExtentFromLineEdit();
251 void setOutputExtentFromCondensedLineEdit();
263 QMenu *mMenu =
nullptr;
264 QMenu *mLayerMenu =
nullptr;
266 QList< QAction * > mLayerMenuActions;
267 QAction *mUseCanvasExtentAction =
nullptr;
268 QAction *mUseCurrentExtentAction =
nullptr;
269 QAction *mDrawOnCanvasAction =
nullptr;
271 QPointer< const QgsMapLayer > mExtentLayer;
272 QString mExtentLayerName;
274 std::unique_ptr< QgsMapToolExtent > mMapToolExtent;
275 QPointer< QgsMapTool > mMapToolPrevious =
nullptr;
279 bool mIsValid =
false;
280 bool mHasFixedOutputCrs =
false;
282 QRegularExpression mCondensedRe;
283 void setValid(
bool valid );
285 void setExtentToLayerExtent(
const QString &layerId );
287 QgsMapLayer *mapLayerFromMimeData(
const QMimeData *data )
const;
This class represents a coordinate reference system (CRS).
Map canvas is a class for displaying all GIS data types on a canvas.
The QgsMapLayerModel class is a model to display layers in widgets.
Base class for all map layer types.
A rectangle specified with double values.
const QgsCoordinateReferenceSystem & outputCrs
const QgsCoordinateReferenceSystem & crs