Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[FEATURE] Draw extent onto canvas in save as image/PDF dialog (#4878)
- Loading branch information
Showing
with
411 additions
and 2 deletions.
- +1 −0 python/gui/gui_auto.sip
- +16 −0 python/gui/qgsextentgroupbox.sip
- +75 −0 python/gui/qgsmaptoolextent.sip
- +1 −0 src/app/qgsmapsavedialog.cpp
- +2 −0 src/gui/CMakeLists.txt
- +67 −2 src/gui/qgsextentgroupbox.cpp
- +25 −0 src/gui/qgsextentgroupbox.h
- +125 −0 src/gui/qgsmaptoolextent.cpp
- +86 −0 src/gui/qgsmaptoolextent.h
- +13 −0 src/ui/qgsextentgroupboxwidget.ui
@@ -0,0 +1,75 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgsmaptoolextent.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
class QgsMapToolExtent : QgsMapTool | ||
{ | ||
%Docstring | ||
A map tool that emits an extent from a rectangle drawn onto the map canvas. | ||
.. versionadded:: 3.0 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsmaptoolextent.h" | ||
%End | ||
public: | ||
|
||
QgsMapToolExtent( QgsMapCanvas *canvas ); | ||
%Docstring | ||
constructor | ||
%End | ||
|
||
virtual Flags flags() const; | ||
virtual void canvasMoveEvent( QgsMapMouseEvent *e ); | ||
virtual void canvasPressEvent( QgsMapMouseEvent *e ); | ||
virtual void canvasReleaseEvent( QgsMapMouseEvent *e ); | ||
virtual void activate(); | ||
virtual void deactivate(); | ||
|
||
void setRatio( QSize ratio ); | ||
%Docstring | ||
Sets a fixed aspect ratio to be used when dragging extent onto the canvas. | ||
To unset a fixed aspect ratio, set the width and height to zero. | ||
\param ratio aspect ratio's width and height | ||
* | ||
%End | ||
|
||
QSize ratio() const; | ||
%Docstring | ||
Returns the current fixed aspect ratio to be used when dragging extent onto the canvas. | ||
If the aspect ratio isn't fixed, the width and height will be set to zero. | ||
* | ||
:rtype: QSize | ||
%End | ||
|
||
QgsRectangle extent() const; | ||
%Docstring | ||
Returns the current extent drawn onto the canvas. | ||
:rtype: QgsRectangle | ||
%End | ||
|
||
signals: | ||
|
||
void extentChanged( const QgsRectangle &extent ); | ||
%Docstring | ||
signal emitted on extent change | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgsmaptoolextent.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
Oops, something went wrong.