16#ifndef QGSEXTENTWIDGET_H
17#define QGSEXTENTWIDGET_H
19#include "ui_qgsextentgroupboxwidget.h"
30#include <QRegularExpression>
50class GUI_EXPORT
QgsExtentWidget :
public QWidget,
private Ui::QgsExtentGroupBoxWidget
153 void setMapCanvas(
QgsMapCanvas *canvas,
bool drawOnCanvasOption =
true );
159 QSize
ratio()
const {
return mRatio; }
164 QString extentLayerName()
const;
169 bool isValid()
const;
178 void setNullValueAllowed(
bool allowed,
const QString ¬SetText = QString() );
185 void setOutputExtentFromOriginal();
190 void setOutputExtentFromCurrent();
200 void setOutputExtentFromLayer(
const QgsMapLayer *layer );
205 void setOutputExtentFromDrawOnCanvas();
246 void dropEvent( QDropEvent *event )
override;
247 void showEvent( QShowEvent *event )
override;
251 void layerMenuAboutToShow();
252 void layoutMenuAboutToShow();
253 void bookmarkMenuAboutToShow();
256 void mapToolDeactivated();
260 void setOutputExtentFromLineEdit();
261 void setOutputExtentFromCondensedLineEdit();
275 QMenu *mMenu =
nullptr;
277 QMenu *mLayerMenu =
nullptr;
278 QMenu *mLayoutMenu =
nullptr;
279 QMenu *mBookmarkMenu =
nullptr;
284 QList<QAction *> mLayerMenuActions;
285 QAction *mUseCanvasExtentAction =
nullptr;
286 QAction *mUseCurrentExtentAction =
nullptr;
287 QAction *mDrawOnCanvasAction =
nullptr;
289 QPointer<const QgsMapLayer> mExtentLayer;
290 QString mExtentLayerName;
292 std::unique_ptr<QgsMapToolExtent> mMapToolExtent;
293 QPointer<QgsMapTool> mMapToolPrevious =
nullptr;
297 bool mIsValid =
false;
298 bool mHasFixedOutputCrs =
false;
300 QRegularExpression mCondensedRe;
302 bool mFirstShow =
true;
303 bool mBlockDrawOnCanvas =
false;
305 void setValid(
bool valid );
307 void setExtentToLayerExtent(
const QString &layerId );
309 QgsMapLayer *mapLayerFromMimeData(
const QMimeData *data )
const;
A QSortFilterProxyModel subclass for sorting the entries in a QgsBookmarkManagerModel.
Represents a coordinate reference system (CRS).
Map canvas is a class for displaying all GIS data types on a canvas.
A proxy model which provides an easy to use model to display the list of layers in widgets.
Base class for all map layer types.
A rectangle specified with double values.