QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
21 , mTitleBase( tr(
"Extent" ) )
24 QVBoxLayout *layout =
new QVBoxLayout();
25 layout->addWidget( mWidget );
28 connect(
this, &QGroupBox::toggled,
this, &QgsExtentGroupBox::groupBoxClicked );
34 window()->setVisible( visible );
73 void QgsExtentGroupBox::updateTitle()
82 msg = tr(
"map view" );
85 msg = tr(
"user defined" );
91 msg = tr(
"drawn on canvas" );
94 if ( isCheckable() && !isChecked() )
96 msg = tr(
"%1 (current: %2)" ).arg( mTitleBase, msg );
131 void QgsExtentGroupBox::groupBoxClicked()
133 if ( !isCheckable() )
142 void QgsExtentGroupBox::widgetExtentChanged()
149 void QgsExtentGroupBox::validationChanged(
bool valid )
153 if ( isCheckable() && !isChecked() )
156 else if ( isCheckable() && isChecked() )
162 if ( isCheckable() && !isChecked() )
196 return mWidget->
ratio();
void setOutputExtentFromDrawOnCanvas()
Sets the output extent by dragging on the canvas.
const QgsCoordinateReferenceSystem & outputCrs
void setOutputExtentFromOriginal()
Sets the output extent to be the same as original extent (may be transformed to output CRS).
QgsCoordinateReferenceSystem currentCrs() const
Returns the coordinate reference system for the current extent set for the widget.
const QgsCoordinateReferenceSystem & crs
void setOriginalExtent(const QgsRectangle &originalExtent, const QgsCoordinateReferenceSystem &originalCrs)
Sets the original extent and coordinate reference system for the widget.
void setRatio(QSize ratio)
Sets a fixed aspect ratio to be used when dragging extent onto the canvas.
QSize ratio() const
Returns the current fixed aspect ratio to be used when dragging extent onto the canvas.
QgsRectangle originalExtent() const
Returns the original extent set for the widget.
void setOutputExtentFromCurrent()
Sets the output extent to be the same as current extent (may be transformed to output CRS).
QgsRectangle outputExtent() const
Returns the extent shown in the widget - in output CRS coordinates.
void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas to enable dragging of extent on a canvas.
void setTitleBase(const QString &title)
Sets the base part of title of the group box (will be appended with extent state)
ExtentState
Available states for the current extent selection in the widget.
QgsExtentGroupBox::ExtentState extentState() const
Returns the currently selected state for the widget's extent.
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.
QgsCoordinateReferenceSystem outputCrs() const
Returns the current output CRS, used in the display.
QgsRectangle currentExtent() const
Returns the current extent set for the widget.
void setCurrentExtent(const QgsRectangle ¤tExtent, const QgsCoordinateReferenceSystem ¤tCrs)
Sets the current extent to show in the widget - should be called as part of initialization (or whenev...
void setOutputExtentFromLayer(const QgsMapLayer *layer)
Sets the output extent to match a layer's extent (may be transformed to output CRS).
QgsExtentGroupBox(QWidget *parent=nullptr)
Constructor for QgsExtentGroupBox.
void setOutputExtentFromUser(const QgsRectangle &extent, const QgsCoordinateReferenceSystem &crs)
Sets the output extent to a custom extent (may be transformed to output CRS).
void extentChanged(const QgsRectangle &r)
Emitted when the widget's extent is changed.