Skip to content

Commit 106b2cc

Browse files
committed
Removed stop rendering button, deprecated QgsMapTool::renderComplete
1 parent abc15ab commit 106b2cc

File tree

10 files changed

+22
-59
lines changed

10 files changed

+22
-59
lines changed

src/app/qgisapp.cpp

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,14 +1630,6 @@ void QgisApp::createStatusBar()
16301630
statusBar()->addPermanentWidget( mScaleEdit, 0 );
16311631
connect( mScaleEdit, SIGNAL( scaleChanged() ), this, SLOT( userScale() ) );
16321632

1633-
//stop rendering status bar widget
1634-
mStopRenderButton = new QToolButton( statusBar() );
1635-
mStopRenderButton->setObjectName( "mStopRenderButton" );
1636-
mStopRenderButton->setMaximumWidth( 20 );
1637-
mStopRenderButton->setMaximumHeight( 20 );
1638-
mStopRenderButton->setIcon( QgsApplication::getThemeIcon( "mIconStopRendering.png" ) );
1639-
mStopRenderButton->setToolTip( tr( "Stop map rendering" ) );
1640-
statusBar()->addPermanentWidget( mStopRenderButton, 0 );
16411633
// render suppression status bar widget
16421634
mRenderSuppressionCBox = new QCheckBox( tr( "Render" ), statusBar() );
16431635
mRenderSuppressionCBox->setObjectName( "mRenderSuppressionCBox" );
@@ -1947,12 +1939,6 @@ void QgisApp::setupConnections()
19471939
connect( this, SIGNAL( projectRead() ),
19481940
this, SLOT( checkForDeprecatedLabelsInProject() ) );
19491941

1950-
//
1951-
// Do we really need this ??? - its already connected to the esc key...TS
1952-
//
1953-
connect( mStopRenderButton, SIGNAL( clicked() ),
1954-
this, SLOT( stopRendering() ) );
1955-
19561942
// setup undo/redo actions
19571943
connect( mUndoWidget, SIGNAL( undoStackChanged() ), this, SLOT( updateUndoActions() ) );
19581944
}
@@ -4096,17 +4082,7 @@ void QgisApp::removeWindow( QAction *action )
40964082
void QgisApp::stopRendering()
40974083
{
40984084
if ( mMapCanvas )
4099-
{
4100-
QgsMapRenderer* mypMapRenderer = mMapCanvas->mapRenderer();
4101-
if ( mypMapRenderer )
4102-
{
4103-
QgsRenderContext* mypRenderContext = mypMapRenderer->rendererContext();
4104-
if ( mypRenderContext )
4105-
{
4106-
mypRenderContext->setRenderingStopped( true );
4107-
}
4108-
}
4109-
}
4085+
mMapCanvas->stopRendering();
41104086
}
41114087

41124088
//reimplements method from base (gui) class

src/app/qgisapp.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,8 +1392,6 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
13921392
QCheckBox * mRenderSuppressionCBox;
13931393
//! A toggle to switch between mouse coords and view extents display
13941394
QToolButton * mToggleExtentsViewButton;
1395-
//! Button used to stop rendering
1396-
QToolButton* mStopRenderButton;
13971395
//! Widget in status bar used to show current project CRS
13981396
QLabel * mOnTheFlyProjectionStatusLabel;
13991397
//! Widget in status bar used to show status of on the fly projection

src/app/qgsmaptoolcapture.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,6 @@ void QgsMapToolCapture::canvasPressEvent( QMouseEvent *e )
136136
}
137137

138138

139-
void QgsMapToolCapture::renderComplete()
140-
{
141-
}
142-
143139
int QgsMapToolCapture::nextPoint( const QPoint &p, QgsPoint &layerPoint, QgsPoint &mapPoint )
144140
{
145141
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mCanvas->currentLayer() );

src/app/qgsmaptoolcapture.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ class APP_EXPORT QgsMapToolCapture : public QgsMapToolEdit
6161

6262
virtual void keyPressEvent( QKeyEvent* e );
6363

64-
//! Resize rubber band
65-
virtual void renderComplete();
66-
6764
//! deactive the tool
6865
virtual void deactivate();
6966

src/browser/qgsbrowser.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -412,20 +412,9 @@ void QgsBrowser::keyReleaseEvent( QKeyEvent * e )
412412

413413
void QgsBrowser::stopRendering()
414414
{
415-
// you might have seen this already in QgisApp
416415
QgsDebugMsg( "Entered" );
417416
if ( mapCanvas )
418-
{
419-
QgsMapRenderer* mypMapRenderer = mapCanvas->mapRenderer();
420-
if ( mypMapRenderer )
421-
{
422-
QgsRenderContext* mypRenderContext = mypMapRenderer->rendererContext();
423-
if ( mypRenderContext )
424-
{
425-
mypRenderContext->setRenderingStopped( true );
426-
}
427-
}
428-
}
417+
mapCanvas->stopRendering();
429418
}
430419

431420
QgsBrowser::Tab QgsBrowser::activeTab()

src/core/qgsmaprenderer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,10 @@ class CORE_EXPORT QgsMapRenderer : public QObject
284284

285285
//! Returns a QPainter::CompositionMode corresponding to a BlendMode
286286
//! Added in 1.9
287-
Q_DECL_DEPRECATED static QPainter::CompositionMode getCompositionMode( const QgsMapRenderer::BlendMode blendMode );
287+
static QPainter::CompositionMode getCompositionMode( const QgsMapRenderer::BlendMode blendMode );
288288
//! Returns a BlendMode corresponding to a QPainter::CompositionMode
289289
//! Added in 1.9
290-
Q_DECL_DEPRECATED static QgsMapRenderer::BlendMode getBlendModeEnum( const QPainter::CompositionMode blendMode );
290+
static QgsMapRenderer::BlendMode getBlendModeEnum( const QPainter::CompositionMode blendMode );
291291

292292
signals:
293293

src/gui/qgsmapcanvas.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,15 @@ void QgsMapCanvas::refresh()
472472

473473
} // refresh
474474

475+
void QgsMapCanvas::stopRendering()
476+
{
477+
QgsRenderContext* mypRenderContext = mMapRenderer->rendererContext();
478+
if ( mypRenderContext )
479+
{
480+
mypRenderContext->setRenderingStopped( true );
481+
}
482+
}
483+
475484
void QgsMapCanvas::updateMap()
476485
{
477486
}
@@ -1274,19 +1283,13 @@ QGis::UnitType QgsMapCanvas::mapUnits() const
12741283
void QgsMapCanvas::setRenderFlag( bool theFlag )
12751284
{
12761285
mRenderFlag = theFlag;
1277-
if ( mMapRenderer )
1278-
{
1279-
QgsRenderContext* rc = mMapRenderer->rendererContext();
1280-
if ( rc )
1281-
{
1282-
rc->setRenderingStopped( !theFlag );
1283-
}
1284-
}
12851286

12861287
if ( mRenderFlag )
12871288
{
12881289
refresh();
12891290
}
1291+
else
1292+
stopRendering();
12901293
}
12911294

12921295
void QgsMapCanvas::connectNotify( const char * signal )

src/gui/qgsmapcanvas.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
139139

140140
//! Accessor for the canvas paint device
141141
//! @deprecated since 2.1
142-
QPaintDevice &canvasPaintDevice();
142+
Q_DECL_DEPRECATED QPaintDevice &canvasPaintDevice();
143143

144144
//! Get the last reported scale of the canvas
145145
double scale();
@@ -314,6 +314,10 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
314314
//! @deprecated in 2.1 - does nothing - kept for API compatibility
315315
Q_DECL_DEPRECATED void updateMap();
316316

317+
//! added in 2.1
318+
//! @note probably it is not necessary to allow any client to stop rendering - should be handled just be canvas
319+
Q_DECL_DEPRECATED void stopRendering();
320+
317321
//! show whatever error is exposed by the QgsMapLayer.
318322
void showError( QgsMapLayer * mapLayer );
319323

src/gui/qgsmapcanvasmap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#include <qgsmaprendererjob.h>
2727

28-
class QgsMapRenderer;
2928
class QgsMapSettings;
3029
class QgsMapCanvas;
3130

src/gui/qgsmaptool.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ class GUI_EXPORT QgsMapTool : public QObject
7979
#endif
8080

8181
//! Called when rendering has finished. Default implementation does nothing.
82-
virtual void renderComplete();
82+
//! @deprecated since 2.1 - not called anymore - map tools must not directly depend on rendering progress
83+
Q_DECL_DEPRECATED virtual void renderComplete();
8384

8485

8586
/** Use this to associate a QAction to this maptool. Then when the setMapTool

0 commit comments

Comments
 (0)