QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
qgsextentwidget.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsextentwidget.cpp
3  ---------------------
4  begin : March 2020
5  copyright : (C) 2020 by Nyall Dawson
6  email : nyall dot dawson 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 #include "qgsextentwidget.h"
17 
18 #include "qgslogger.h"
19 #include "qgscoordinatetransform.h"
20 #include "qgsmapcanvas.h"
21 #include "qgsmaplayermodel.h"
22 #include "qgsexception.h"
23 #include "qgsproject.h"
24 #include "qgsdoublevalidator.h"
25 
26 #include <QMenu>
27 #include <QAction>
28 #include <QRegularExpression>
29 
31  : QWidget( parent )
32 {
33  setupUi( this );
34  connect( mXMinLineEdit, &QLineEdit::textEdited, this, &QgsExtentWidget::setOutputExtentFromLineEdit );
35  connect( mXMaxLineEdit, &QLineEdit::textEdited, this, &QgsExtentWidget::setOutputExtentFromLineEdit );
36  connect( mYMinLineEdit, &QLineEdit::textEdited, this, &QgsExtentWidget::setOutputExtentFromLineEdit );
37  connect( mYMaxLineEdit, &QLineEdit::textEdited, this, &QgsExtentWidget::setOutputExtentFromLineEdit );
38 
39  mCondensedRe = QRegularExpression( QStringLiteral( "\\s*([\\d\\.\\-]+)\\s*,\\s*([\\d\\.\\-]+)\\s*,\\s*([\\d\\.\\-]+)\\s*,\\s*([\\d\\.\\-]+)\\s*(?:\\[(.*?)\\])?" ) );
40  mCondensedLineEdit->setValidator( new QRegularExpressionValidator( mCondensedRe, this ) );
41  mCondensedLineEdit->setShowClearButton( false );
42  connect( mCondensedLineEdit, &QgsFilterLineEdit::cleared, this, &QgsExtentWidget::clear );
43  connect( mCondensedLineEdit, &QLineEdit::textEdited, this, &QgsExtentWidget::setOutputExtentFromCondensedLineEdit );
44 
45  mLayerMenu = new QMenu( tr( "Calculate from Layer" ), this );
46  mButtonCalcFromLayer->setMenu( mLayerMenu );
47  connect( mLayerMenu, &QMenu::aboutToShow, this, &QgsExtentWidget::layerMenuAboutToShow );
48  mMapLayerModel = new QgsMapLayerModel( this );
49 
50  mMenu = new QMenu( this );
51  mUseCanvasExtentAction = new QAction( tr( "Use Map Canvas Extent" ), this );
52  connect( mUseCanvasExtentAction, &QAction::triggered, this, &QgsExtentWidget::setOutputExtentFromCurrent );
53 
54  mUseCurrentExtentAction = new QAction( tr( "Use Current Layer Extent" ), this );
55  connect( mUseCurrentExtentAction, &QAction::triggered, this, &QgsExtentWidget::setOutputExtentFromCurrent );
56 
57  mDrawOnCanvasAction = new QAction( tr( "Draw on Canvas" ), this );
58  connect( mDrawOnCanvasAction, &QAction::triggered, this, &QgsExtentWidget::setOutputExtentFromDrawOnCanvas );
59 
60  mMenu->addMenu( mLayerMenu );
61 
62  mCondensedToolButton->setMenu( mMenu );
63  mCondensedToolButton->setPopupMode( QToolButton::InstantPopup );
64 
65  mXMinLineEdit->setValidator( new QgsDoubleValidator( this ) );
66  mXMaxLineEdit->setValidator( new QgsDoubleValidator( this ) );
67  mYMinLineEdit->setValidator( new QgsDoubleValidator( this ) );
68  mYMaxLineEdit->setValidator( new QgsDoubleValidator( this ) );
69 
70  mOriginalExtentButton->setVisible( false );
71  mButtonDrawOnCanvas->setVisible( false );
72  mCurrentExtentButton->setVisible( false );
73 
74  connect( mCurrentExtentButton, &QAbstractButton::clicked, this, &QgsExtentWidget::setOutputExtentFromCurrent );
75  connect( mOriginalExtentButton, &QAbstractButton::clicked, this, &QgsExtentWidget::setOutputExtentFromOriginal );
76  connect( mButtonDrawOnCanvas, &QAbstractButton::clicked, this, &QgsExtentWidget::setOutputExtentFromDrawOnCanvas );
77 
78  switch ( style )
79  {
80  case CondensedStyle:
81  mExpandedWidget->hide();
82  break;
83 
84  case ExpandedStyle:
85  mCondensedFrame->hide();
86  break;
87  }
88 
89  setAcceptDrops( true );
90 }
91 
93 {
94  if ( mMapToolExtent )
95  {
96  // disconnect from deactivated signal -- this will be called when the map tool is being destroyed,
97  // and we don't want to act on that anymore (the mapToolDeactivated slot tries to show the widget again, but
98  // that's being destroyed!)
99  disconnect( mMapToolExtent.get(), &QgsMapToolExtent::deactivated, this, &QgsExtentWidget::mapToolDeactivated );
100  }
101 }
102 
103 void QgsExtentWidget::setOriginalExtent( const QgsRectangle &originalExtent, const QgsCoordinateReferenceSystem &originalCrs )
104 {
105  mOriginalExtent = originalExtent;
106  mOriginalCrs = originalCrs;
107 
108  mOriginalExtentButton->setVisible( true );
109 }
110 
111 
112 void QgsExtentWidget::setCurrentExtent( const QgsRectangle &currentExtent, const QgsCoordinateReferenceSystem &currentCrs )
113 {
114  mCurrentExtent = currentExtent;
115  mCurrentCrs = currentCrs;
116 
117  mCurrentExtentButton->setVisible( true );
118  mMenu->addAction( mUseCurrentExtentAction );
119 }
120 
122 {
123  mHasFixedOutputCrs = true;
124  if ( mOutputCrs != outputCrs )
125  {
126  const bool prevExtentEnabled = mIsValid;
127  switch ( mExtentState )
128  {
129  case CurrentExtent:
130  mOutputCrs = outputCrs;
132  break;
133 
134  case OriginalExtent:
135  mOutputCrs = outputCrs;
137  break;
138 
139  case ProjectLayerExtent:
140  mOutputCrs = outputCrs;
141  setOutputExtentFromLayer( mExtentLayer.data() );
142  break;
143 
144  case DrawOnCanvas:
145  mOutputCrs = outputCrs;
146  extentDrawn( outputExtent() );
147  break;
148 
149  case UserExtent:
150  try
151  {
154  const QgsRectangle extent = ct.transformBoundingBox( outputExtent() );
155  mOutputCrs = outputCrs;
157  }
158  catch ( QgsCsException & )
159  {
160  // can't reproject
161  mOutputCrs = outputCrs;
162  }
163  break;
164  }
165 
166  if ( !prevExtentEnabled )
167  setValid( false );
168  }
169 }
170 
171 void QgsExtentWidget::setOutputExtent( const QgsRectangle &r, const QgsCoordinateReferenceSystem &srcCrs, ExtentState state )
172 {
173  QgsRectangle extent;
174  if ( !mHasFixedOutputCrs )
175  {
176  mOutputCrs = srcCrs;
177  extent = r;
178  }
179  else
180  {
181  if ( mOutputCrs == srcCrs )
182  {
183  extent = r;
184  }
185  else
186  {
187  try
188  {
189  QgsCoordinateTransform ct( srcCrs, mOutputCrs, QgsProject::instance() );
190  ct.setBallparkTransformsAreAppropriate( true );
191  extent = ct.transformBoundingBox( r );
192  }
193  catch ( QgsCsException & )
194  {
195  // can't reproject
196  extent = r;
197  }
198  }
199  }
200 
201  int decimals = 4;
202  switch ( mOutputCrs.mapUnits() )
203  {
206  decimals = 9;
207  break;
216  decimals = 4;
217  break;
218  }
219  mXMinLineEdit->setText( QLocale().toString( extent.xMinimum(), 'f', decimals ) );
220  mXMaxLineEdit->setText( QLocale().toString( extent.xMaximum(), 'f', decimals ) );
221  mYMinLineEdit->setText( QLocale().toString( extent.yMinimum(), 'f', decimals ) );
222  mYMaxLineEdit->setText( QLocale().toString( extent.yMaximum(), 'f', decimals ) );
223 
224  QString condensed = QStringLiteral( "%1,%2,%3,%4" ).arg( QString::number( extent.xMinimum(), 'f', decimals ),
225  QString::number( extent.xMaximum(), 'f', decimals ),
226  QString::number( extent.yMinimum(), 'f', decimals ),
227  QString::number( extent.yMaximum(), 'f', decimals ) );
228  condensed += QStringLiteral( " [%1]" ).arg( mOutputCrs.userFriendlyIdentifier( QgsCoordinateReferenceSystem::ShortString ) );
229  mCondensedLineEdit->setText( condensed );
230 
231  mExtentState = state;
232 
233  if ( !mIsValid )
234  setValid( true );
235 
236  emit extentChanged( extent );
237 }
238 
239 void QgsExtentWidget::setOutputExtentFromLineEdit()
240 {
241  mExtentState = UserExtent;
242  emit extentChanged( outputExtent() );
243 }
244 
245 void QgsExtentWidget::setOutputExtentFromCondensedLineEdit()
246 {
247  const QString text = mCondensedLineEdit->text();
248  if ( text.isEmpty() )
249  {
250  clear();
251  }
252  else
253  {
254  const QRegularExpressionMatch match = mCondensedRe.match( text );
255  if ( match.hasMatch() )
256  {
257  // Localization
258  whileBlocking( mXMinLineEdit )->setText( QLocale().toString( match.captured( 1 ).toDouble() ) );
259  whileBlocking( mXMaxLineEdit )->setText( QLocale().toString( match.captured( 2 ).toDouble() ) );
260  whileBlocking( mYMinLineEdit )->setText( QLocale().toString( match.captured( 3 ).toDouble() ) );
261  whileBlocking( mYMaxLineEdit )->setText( QLocale().toString( match.captured( 4 ).toDouble() ) );
262  if ( !match.captured( 5 ).isEmpty() )
263  {
264  mOutputCrs = QgsCoordinateReferenceSystem( match.captured( 5 ) );
265  }
266 
267  emit extentChanged( outputExtent() );
268  if ( !mIsValid )
269  setValid( true );
270  }
271  }
272 }
273 
275 {
276  const bool prevWasNull = mIsValid;
277 
278  whileBlocking( mXMinLineEdit )->clear();
279  whileBlocking( mXMaxLineEdit )->clear();
280  whileBlocking( mYMinLineEdit )->clear();
281  whileBlocking( mYMaxLineEdit )->clear();
282  whileBlocking( mCondensedLineEdit )->clearValue();
283  setValid( false );
284 
285  if ( prevWasNull )
286  emit extentChanged( outputExtent() );
287 }
288 
290 {
291  return mExtentLayerName;
292 }
293 
295 {
296  return mIsValid;
297 }
298 
299 void QgsExtentWidget::setNullValueAllowed( bool allowed, const QString &notSetText )
300 {
301  mCondensedLineEdit->setShowClearButton( allowed );
302  mCondensedLineEdit->setNullValue( notSetText );
303 }
304 
305 void QgsExtentWidget::setValid( bool valid )
306 {
307  if ( valid == mIsValid )
308  return;
309 
310  mIsValid = valid;
311  emit validationChanged( mIsValid );
312 }
313 
314 void QgsExtentWidget::layerMenuAboutToShow()
315 {
316  qDeleteAll( mLayerMenuActions );
317  mLayerMenuActions.clear();
318  mLayerMenu->clear();
319  for ( int i = 0; i < mMapLayerModel->rowCount(); ++i )
320  {
321  const QModelIndex index = mMapLayerModel->index( i, 0 );
322  const QIcon icon = qvariant_cast<QIcon>( mMapLayerModel->data( index, Qt::DecorationRole ) );
323  const QString text = mMapLayerModel->data( index, Qt::DisplayRole ).toString();
324  QAction *act = new QAction( icon, text, mLayerMenu );
325  act->setToolTip( mMapLayerModel->data( index, Qt::ToolTipRole ).toString() );
326  const QString layerId = mMapLayerModel->data( index, QgsMapLayerModel::LayerIdRole ).toString();
327  if ( mExtentState == ProjectLayerExtent && mExtentLayer && mExtentLayer->id() == layerId )
328  {
329  act->setCheckable( true );
330  act->setChecked( true );
331  }
332  connect( act, &QAction::triggered, this, [this, layerId]
333  {
334  setExtentToLayerExtent( layerId );
335  } );
336  mLayerMenu->addAction( act );
337  mLayerMenuActions << act;
338  }
339 }
340 
341 void QgsExtentWidget::setExtentToLayerExtent( const QString &layerId )
342 {
343  QgsMapLayer *layer = QgsProject::instance()->mapLayer( layerId );
344  if ( !layer )
345  return;
346 
347  setOutputExtentFromLayer( layer );
348 }
349 
350 QgsMapLayer *QgsExtentWidget::mapLayerFromMimeData( const QMimeData *data ) const
351 {
353  for ( const QgsMimeDataUtils::Uri &u : uriList )
354  {
355  // is this uri from the current project?
356  if ( QgsMapLayer *layer = u.mapLayer() )
357  {
358  return layer;
359  }
360  }
361  return nullptr;
362 }
363 
365 {
366  if ( mCanvas )
367  {
368  // Use unrotated visible extent to insure output size and scale matches canvas
369  QgsMapSettings ms = mCanvas->mapSettings();
370  ms.setRotation( 0 );
371  setOutputExtent( ms.visibleExtent(), ms.destinationCrs(), CurrentExtent );
372  }
373  else
374  {
375  setOutputExtent( mCurrentExtent, mCurrentCrs, CurrentExtent );
376  }
377 }
378 
379 
381 {
382  setOutputExtent( mOriginalExtent, mOriginalCrs, OriginalExtent );
383 }
384 
386 {
387  setOutputExtent( extent, crs, UserExtent );
388 }
389 
391 {
392  if ( !layer )
393  return;
394 
395  mExtentLayer = layer;
396  mExtentLayerName = layer->name();
397 
398  setOutputExtent( layer->extent(), layer->crs(), ProjectLayerExtent );
399 }
400 
402 {
403  if ( mCanvas )
404  {
405  mMapToolPrevious = mCanvas->mapTool();
406  if ( !mMapToolExtent )
407  {
408  mMapToolExtent.reset( new QgsMapToolExtent( mCanvas ) );
409  connect( mMapToolExtent.get(), &QgsMapToolExtent::extentChanged, this, &QgsExtentWidget::extentDrawn );
410  connect( mMapToolExtent.get(), &QgsMapTool::deactivated, this, &QgsExtentWidget::mapToolDeactivated );
411  }
412  mMapToolExtent->setRatio( mRatio );
413  mCanvas->setMapTool( mMapToolExtent.get() );
414 
415  emit toggleDialogVisibility( false );
416  }
417 }
418 
419 void QgsExtentWidget::extentDrawn( const QgsRectangle &extent )
420 {
421  setOutputExtent( extent, mCanvas->mapSettings().destinationCrs(), DrawOnCanvas );
422  mCanvas->setMapTool( mMapToolPrevious );
423  emit toggleDialogVisibility( true );
424  mMapToolPrevious = nullptr;
425 }
426 
427 void QgsExtentWidget::mapToolDeactivated()
428 {
429  emit toggleDialogVisibility( true );
430  mMapToolPrevious = nullptr;
431 }
432 
434 {
435  return QgsRectangle( QgsDoubleValidator::toDouble( mXMinLineEdit->text() ), QgsDoubleValidator::toDouble( mYMinLineEdit->text() ),
436  QgsDoubleValidator::toDouble( mXMaxLineEdit->text() ), QgsDoubleValidator::toDouble( mYMaxLineEdit->text() ) );
437 }
438 
439 void QgsExtentWidget::setMapCanvas( QgsMapCanvas *canvas, bool drawOnCanvasOption )
440 {
441  if ( canvas )
442  {
443  mCanvas = canvas;
444  mButtonDrawOnCanvas->setVisible( drawOnCanvasOption );
445  mCurrentExtentButton->setVisible( true );
446 
447  mMenu->addAction( mUseCanvasExtentAction );
448  if ( drawOnCanvasOption )
449  mMenu->addAction( mDrawOnCanvasAction );
450  }
451  else
452  {
453  mButtonDrawOnCanvas->setVisible( false );
454  mCurrentExtentButton->setVisible( false );
455  mMenu->removeAction( mUseCanvasExtentAction );
456  mMenu->removeAction( mDrawOnCanvasAction );
457  }
458 }
459 
460 void QgsExtentWidget::dragEnterEvent( QDragEnterEvent *event )
461 {
462  if ( !( event->possibleActions() & Qt::CopyAction ) )
463  {
464  event->ignore();
465  return;
466  }
467 
468  if ( mapLayerFromMimeData( event->mimeData() ) )
469  {
470  // dragged an acceptable layer, phew
471  event->setDropAction( Qt::CopyAction );
472  event->accept();
473  mCondensedLineEdit->setHighlighted( true );
474  update();
475  }
476  else
477  {
478  event->ignore();
479  }
480 }
481 
482 void QgsExtentWidget::dragLeaveEvent( QDragLeaveEvent *event )
483 {
484  if ( mCondensedLineEdit->isHighlighted() )
485  {
486  event->accept();
487  mCondensedLineEdit->setHighlighted( false );
488  update();
489  }
490  else
491  {
492  event->ignore();
493  }
494 }
495 
496 void QgsExtentWidget::dropEvent( QDropEvent *event )
497 {
498  if ( !( event->possibleActions() & Qt::CopyAction ) )
499  {
500  event->ignore();
501  return;
502  }
503 
504  if ( QgsMapLayer *layer = mapLayerFromMimeData( event->mimeData() ) )
505  {
506  // dropped a map layer
507  setFocus( Qt::MouseFocusReason );
508  event->setDropAction( Qt::CopyAction );
509  event->accept();
510 
511  setOutputExtentFromLayer( layer );
512  }
513  else
514  {
515  event->ignore();
516  }
517  mCondensedLineEdit->setHighlighted( false );
518  update();
519 }
This class represents a coordinate reference system (CRS).
@ ShortString
A heavily abbreviated string, for use when a compact representation is required.
QString userFriendlyIdentifier(IdentifierType type=MediumString) const
Returns a user friendly identifier for the CRS.
Q_GADGET QgsUnitTypes::DistanceUnit mapUnits
Class for doing transforms between two map coordinate systems.
void setBallparkTransformsAreAppropriate(bool appropriate)
Sets whether approximate "ballpark" results are appropriate for this coordinate transform.
QgsRectangle transformBoundingBox(const QgsRectangle &rectangle, Qgis::TransformDirection direction=Qgis::TransformDirection::Forward, bool handle180Crossover=false) const SIP_THROW(QgsCsException)
Transforms a rectangle from the source CRS to the destination CRS.
Custom exception class for Coordinate Reference System related exceptions.
Definition: qgsexception.h:66
QgsDoubleValidator is a QLineEdit Validator that combines QDoubleValidator and QRegularExpressionVali...
static double toDouble(const QString &input, bool *ok)
Converts input string to double value.
QgsCoordinateReferenceSystem currentCrs() const
Returns the coordinate reference system for the current extent set for the widget.
void setOutputExtentFromOriginal()
Sets the output extent to be the same as original extent (may be transformed to output CRS).
void setOutputExtentFromCurrent()
Sets the output extent to be the same as current extent (may be transformed to output CRS).
void setOutputExtentFromDrawOnCanvas()
Sets the output extent by dragging on the canvas.
void setOriginalExtent(const QgsRectangle &originalExtent, const QgsCoordinateReferenceSystem &originalCrs)
Sets the original extent and coordinate reference system for the widget.
void setCurrentExtent(const QgsRectangle &currentExtent, const QgsCoordinateReferenceSystem &currentCrs)
Sets the current extent to show in the widget - should be called as part of initialization (or whenev...
bool isValid() const
Returns true if the widget is in a valid state, i.e.
void toggleDialogVisibility(bool visible)
Emitted when the parent dialog visibility must be changed (e.g.
void setNullValueAllowed(bool allowed, const QString &notSetText=QString())
Sets whether the widget can be set to a "not set" (null) state.
QgsRectangle originalExtent() const
Returns the original extent set for the widget.
void dragEnterEvent(QDragEnterEvent *event) override
@ UserExtent
Extent manually entered/modified by the user.
@ OriginalExtent
Layer's extent.
@ ProjectLayerExtent
Extent taken from a layer within the project.
@ CurrentExtent
Map canvas extent.
@ DrawOnCanvas
Extent taken from a rectangled drawn onto the map canvas.
void validationChanged(bool valid)
Emitted when the widget's validation state changes.
void dropEvent(QDropEvent *event) override
void clear()
Clears the widget, setting it to a null value.
QgsCoordinateReferenceSystem outputCrs() const
Returns the current output CRS, used in the display.
void setMapCanvas(QgsMapCanvas *canvas, bool drawOnCanvasOption=true)
Sets the map canvas to enable dragging of extent on a canvas.
~QgsExtentWidget() override
QgsRectangle currentExtent() const
Returns the current extent set for the widget.
void extentChanged(const QgsRectangle &r)
Emitted when the widget's extent is changed.
WidgetStyle
Widget styles.
@ CondensedStyle
Shows a compressed widget, for use when available space is minimal.
@ ExpandedStyle
Shows an expanded widget, for use when space is not constrained.
QgsExtentWidget(QWidget *parent=nullptr, WidgetStyle style=CondensedStyle)
Constructor for QgsExtentWidget.
QgsRectangle outputExtent() const
Returns the extent shown in the widget - in output CRS coordinates.
void dragLeaveEvent(QDragLeaveEvent *event) override
QgsCoordinateReferenceSystem originalCrs() const
Returns the original coordinate reference system set for the widget.
void setOutputCrs(const QgsCoordinateReferenceSystem &outputCrs)
Sets the output CRS - may need to be used for transformation from original/current extent.
void setOutputExtentFromLayer(const QgsMapLayer *layer)
Sets the output extent to match a layer's extent (may be transformed to output CRS).
void setOutputExtentFromUser(const QgsRectangle &extent, const QgsCoordinateReferenceSystem &crs)
Sets the output extent to a custom extent (may be transformed to output CRS).
QString extentLayerName() const
Returns the name of the extent layer.
void cleared()
Emitted when the widget is cleared.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:89
QgsMapTool * mapTool()
Returns the currently active tool.
void setMapTool(QgsMapTool *mapTool, bool clean=false)
Sets the map tool currently being used on the canvas.
const QgsMapSettings & mapSettings() const
Gets access to properties used for map rendering.
The QgsMapLayerModel class is a model to display layers in widgets.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
@ LayerIdRole
Stores the map layer ID.
Base class for all map layer types.
Definition: qgsmaplayer.h:73
QString name
Definition: qgsmaplayer.h:76
virtual QgsRectangle extent() const
Returns the extent of the layer.
QgsCoordinateReferenceSystem crs
Definition: qgsmaplayer.h:79
The QgsMapSettings class contains configuration for rendering of the map.
QgsRectangle visibleExtent() const
Returns the actual extent derived from requested extent that takes output image size into account.
void setRotation(double rotation)
Sets the rotation of the resulting map image, in degrees clockwise.
QgsCoordinateReferenceSystem destinationCrs() const
Returns the destination coordinate reference system for the map render.
A map tool that emits an extent from a rectangle drawn onto the map canvas.
void extentChanged(const QgsRectangle &extent)
signal emitted on extent change
void deactivated()
signal emitted once the map tool is deactivated
QList< QgsMimeDataUtils::Uri > UriList
static UriList decodeUriList(const QMimeData *data)
static QgsProject * instance()
Returns the QgsProject singleton instance.
Definition: qgsproject.cpp:467
Q_INVOKABLE QgsMapLayer * mapLayer(const QString &layerId) const
Retrieve a pointer to a registered layer by layer ID.
A rectangle specified with double values.
Definition: qgsrectangle.h:42
double yMaximum() const SIP_HOLDGIL
Returns the y maximum value (top side of rectangle).
Definition: qgsrectangle.h:193
double xMaximum() const SIP_HOLDGIL
Returns the x maximum value (right side of rectangle).
Definition: qgsrectangle.h:183
double xMinimum() const SIP_HOLDGIL
Returns the x minimum value (left side of rectangle).
Definition: qgsrectangle.h:188
double yMinimum() const SIP_HOLDGIL
Returns the y minimum value (bottom side of rectangle).
Definition: qgsrectangle.h:198
@ DistanceMeters
Meters.
Definition: qgsunittypes.h:69
@ DistanceDegrees
Degrees, for planar geographic CRS distance measurements.
Definition: qgsunittypes.h:75
@ DistanceKilometers
Kilometers.
Definition: qgsunittypes.h:70
@ DistanceMiles
Terrestrial miles.
Definition: qgsunittypes.h:74
@ DistanceUnknownUnit
Unknown distance unit.
Definition: qgsunittypes.h:78
@ DistanceMillimeters
Millimeters.
Definition: qgsunittypes.h:77
@ DistanceYards
Imperial yards.
Definition: qgsunittypes.h:73
@ DistanceFeet
Imperial feet.
Definition: qgsunittypes.h:71
@ DistanceNauticalMiles
Nautical miles.
Definition: qgsunittypes.h:72
@ DistanceCentimeters
Centimeters.
Definition: qgsunittypes.h:76
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:1185
const QgsCoordinateReferenceSystem & outputCrs
const QgsCoordinateReferenceSystem & crs