|
QGIS API Documentation 4.1.0-Master (5bf3c20f3c9)
|
Plot canvas is a class for displaying interactive 2d charts and plots. More...
#include <qgsplotcanvas.h>

Public Slots | |
| virtual void | refresh () |
| Updates and redraws the plot. | |
Signals | |
| void | contextMenuAboutToShow (QMenu *menu, QgsPlotMouseEvent *event) |
| Emitted before the canvas context menu will be shown. | |
| void | plotAreaChanged () |
| Emitted whenever the visible area of the plot is changed. | |
| void | toolChanged (QgsPlotTool *newTool) |
| Emitted when the plot tool is changed. | |
| void | willBeDeleted () |
| Emitted in the destructor when the canvas is about to be deleted, but is still in a perfectly valid state. | |
Public Member Functions | |
| QgsPlotCanvas (QWidget *parent=nullptr) | |
| Constructor for QgsPlotCanvas, with the specified parent widget. | |
| ~QgsPlotCanvas () override | |
| virtual void | cancelJobs () |
| Cancel any rendering job, in a blocking way. | |
| virtual void | centerPlotOn (double x, double y) |
| Centers the plot on the plot point corresponding to x, y in canvas units. | |
| virtual QgsCoordinateReferenceSystem | crs () const |
| Returns the coordinate reference system (CRS) for map coordinates used by the canvas. | |
| virtual void | panContentsBy (double dx, double dy) |
| Pans the plot contents by dx, dy in canvas units. | |
| virtual void | scalePlot (double factor) |
| Scales the plot by a specified scale factor. | |
| void | setTool (QgsPlotTool *tool) |
| Sets the interactive tool currently being used on the canvas. | |
| virtual QgsPointXY | snapToPlot (QPoint point) |
| Snap a canvas point to the plot. | |
| virtual QgsPointXY | toCanvasCoordinates (const QgsPoint &point) const |
| Converts a point in map coordinates to the associated canvas point. | |
| virtual QgsPoint | toMapCoordinates (const QgsPointXY &point) const |
| Converts a point on the canvas to the associated map coordinate. | |
| QgsPlotTool * | tool () |
| Returns the currently active tool. | |
| void | unsetTool (QgsPlotTool *tool) |
| Unset the current tool. | |
| virtual void | zoomToRect (const QRectF &rect) |
| Zooms the plot to the specified rect in canvas units. | |
Protected Member Functions | |
| bool | event (QEvent *e) override |
| void | keyPressEvent (QKeyEvent *e) override |
| void | keyReleaseEvent (QKeyEvent *e) override |
| void | mouseDoubleClickEvent (QMouseEvent *e) override |
| void | mouseMoveEvent (QMouseEvent *e) override |
| void | mousePressEvent (QMouseEvent *e) override |
| void | mouseReleaseEvent (QMouseEvent *e) override |
| void | resizeEvent (QResizeEvent *e) override |
| bool | viewportEvent (QEvent *event) override |
| void | wheelEvent (QWheelEvent *e) override |
| virtual void | wheelZoom (QWheelEvent *event) |
| Zoom plot from a mouse wheel event. | |
Plot canvas is a class for displaying interactive 2d charts and plots.
Definition at line 54 of file qgsplotcanvas.h.
| QgsPlotCanvas::QgsPlotCanvas | ( | QWidget * | parent = nullptr | ) |
Constructor for QgsPlotCanvas, with the specified parent widget.
Definition at line 36 of file qgsplotcanvas.cpp.
|
override |
Definition at line 57 of file qgsplotcanvas.cpp.
|
virtual |
Cancel any rendering job, in a blocking way.
Used for application closing.
Reimplemented in QgsElevationProfileCanvas.
Definition at line 85 of file qgsplotcanvas.cpp.
|
virtual |
Centers the plot on the plot point corresponding to x, y in canvas units.
The default implementation does nothing.
Reimplemented in QgsElevationProfileCanvas.
Definition at line 282 of file qgsplotcanvas.cpp.
|
signal |
Emitted before the canvas context menu will be shown.
Can be used to extend the context menu.
|
virtual |
Returns the coordinate reference system (CRS) for map coordinates used by the canvas.
May return an invalid CRS if no CRS is associated with the canvas.
Reimplemented in QgsElevationProfileCanvas.
Definition at line 264 of file qgsplotcanvas.cpp.
|
overrideprotected |
Definition at line 308 of file qgsplotcanvas.cpp.
|
overrideprotected |
Definition at line 106 of file qgsplotcanvas.cpp.
|
overrideprotected |
Definition at line 131 of file qgsplotcanvas.cpp.
|
overrideprotected |
Definition at line 142 of file qgsplotcanvas.cpp.
|
overrideprotected |
Definition at line 218 of file qgsplotcanvas.cpp.
|
overrideprotected |
Definition at line 155 of file qgsplotcanvas.cpp.
|
overrideprotected |
Definition at line 186 of file qgsplotcanvas.cpp.
|
virtual |
Pans the plot contents by dx, dy in canvas units.
The default implementation does nothing.
Reimplemented in QgsElevationProfileCanvas.
Definition at line 279 of file qgsplotcanvas.cpp.
|
signal |
Emitted whenever the visible area of the plot is changed.
|
virtualslot |
Updates and redraws the plot.
Reimplemented in QgsElevationProfileCanvas.
Definition at line 88 of file qgsplotcanvas.cpp.
|
overrideprotected |
Definition at line 199 of file qgsplotcanvas.cpp.
|
virtual |
Scales the plot by a specified scale factor.
The default implementation does nothing.
Reimplemented in QgsElevationProfileCanvas.
Definition at line 285 of file qgsplotcanvas.cpp.
| void QgsPlotCanvas::setTool | ( | QgsPlotTool * | tool | ) |
Sets the interactive tool currently being used on the canvas.
Definition at line 231 of file qgsplotcanvas.cpp.
|
virtual |
Snap a canvas point to the plot.
Returns an empty point if snapping was not possible.
| point | point in canvas coordinates |
Reimplemented in QgsElevationProfileCanvas.
Definition at line 291 of file qgsplotcanvas.cpp.
|
virtual |
Converts a point in map coordinates to the associated canvas point.
May return an empty point if the map point cannot be converted to a canvas point.
Reimplemented in QgsElevationProfileCanvas.
Definition at line 274 of file qgsplotcanvas.cpp.
|
virtual |
Converts a point on the canvas to the associated map coordinate.
May return an empty point if the canvas point cannot be converted to a map point.
Reimplemented in QgsElevationProfileCanvas.
Definition at line 269 of file qgsplotcanvas.cpp.
| QgsPlotTool * QgsPlotCanvas::tool | ( | ) |
Returns the currently active tool.
Definition at line 259 of file qgsplotcanvas.cpp.
|
signal |
Emitted when the plot tool is changed.
| void QgsPlotCanvas::unsetTool | ( | QgsPlotTool * | tool | ) |
Unset the current tool.
This is called from destructor of plot tools to make sure that this map tool won't be used any more.
You don't have to call it manually, QgsPlotTool takes care of it.
Definition at line 249 of file qgsplotcanvas.cpp.
|
overrideprotected |
Definition at line 296 of file qgsplotcanvas.cpp.
|
overrideprotected |
Definition at line 204 of file qgsplotcanvas.cpp.
|
protectedvirtual |
Zoom plot from a mouse wheel event.
The default implementation does nothing.
Reimplemented in QgsElevationProfileCanvas.
Definition at line 305 of file qgsplotcanvas.cpp.
|
signal |
Emitted in the destructor when the canvas is about to be deleted, but is still in a perfectly valid state.
|
virtual |
Zooms the plot to the specified rect in canvas units.
The default implementation does nothing.
Reimplemented in QgsElevationProfileCanvas.
Definition at line 288 of file qgsplotcanvas.cpp.