Skip to content
Permalink
Browse files

Add mapRefreshCanceled() signal to QgsMapCanvas

This is useful when one wants to follow what exactly is happening
with map canvas rendering. We already have renderStarting() signal
when a job is started and mapCanvasRefreshed() signal when a job
has finished, but there was no notification if the pending job
got cancelled (for example because used moved/zoomed the map).
  • Loading branch information
wonder-sk authored and nyalldawson committed Jan 13, 2021
1 parent 23b50ab commit 1ed818e264cc1b0c4b0a894955cb4649301bfcc7
Showing with 14 additions and 0 deletions.
  1. +7 −0 python/gui/auto_generated/qgsmapcanvas.sip.in
  2. +1 −0 src/gui/qgsmapcanvas.cpp
  3. +6 −0 src/gui/qgsmapcanvas.h
@@ -1087,6 +1087,13 @@ Emitted when canvas finished a refresh request.
void renderStarting();
%Docstring
Emitted when the canvas is about to be rendered.
%End

void mapRefreshCanceled();
%Docstring
Emitted when the pending map refresh has been canceled

.. versionadded:: 3.18
%End

void layersChanged();
@@ -1000,6 +1000,7 @@ void QgsMapCanvas::stopRendering()
connect( mJob, &QgsMapRendererQImageJob::finished, mJob, &QgsMapRendererQImageJob::deleteLater );
mJob->cancelWithoutBlocking();
mJob = nullptr;
emit mapRefreshCanceled();
}
stopPreviewJobs();
}
@@ -996,6 +996,12 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
//! Emitted when the canvas is about to be rendered.
void renderStarting();

/**
* Emitted when the pending map refresh has been canceled
* \since QGIS 3.18
*/
void mapRefreshCanceled();

//! Emitted when a new set of layers has been received
void layersChanged();

0 comments on commit 1ed818e

Please sign in to comment.
You can’t perform that action at this time.