Skip to content
Permalink
Browse files

Removed stop rendering button, deprecated QgsMapTool::renderComplete

  • Loading branch information
wonder-sk committed Nov 11, 2013
1 parent abc15ab commit 106b2cce127b6e2f06deecc9303466a0b2c2be86
@@ -1630,14 +1630,6 @@ void QgisApp::createStatusBar()
statusBar()->addPermanentWidget( mScaleEdit, 0 );
connect( mScaleEdit, SIGNAL( scaleChanged() ), this, SLOT( userScale() ) );

//stop rendering status bar widget
mStopRenderButton = new QToolButton( statusBar() );
mStopRenderButton->setObjectName( "mStopRenderButton" );
mStopRenderButton->setMaximumWidth( 20 );
mStopRenderButton->setMaximumHeight( 20 );
mStopRenderButton->setIcon( QgsApplication::getThemeIcon( "mIconStopRendering.png" ) );
mStopRenderButton->setToolTip( tr( "Stop map rendering" ) );
statusBar()->addPermanentWidget( mStopRenderButton, 0 );
// render suppression status bar widget
mRenderSuppressionCBox = new QCheckBox( tr( "Render" ), statusBar() );
mRenderSuppressionCBox->setObjectName( "mRenderSuppressionCBox" );
@@ -1947,12 +1939,6 @@ void QgisApp::setupConnections()
connect( this, SIGNAL( projectRead() ),
this, SLOT( checkForDeprecatedLabelsInProject() ) );

//
// Do we really need this ??? - its already connected to the esc key...TS
//
connect( mStopRenderButton, SIGNAL( clicked() ),
this, SLOT( stopRendering() ) );

// setup undo/redo actions
connect( mUndoWidget, SIGNAL( undoStackChanged() ), this, SLOT( updateUndoActions() ) );
}
@@ -4096,17 +4082,7 @@ void QgisApp::removeWindow( QAction *action )
void QgisApp::stopRendering()
{
if ( mMapCanvas )
{
QgsMapRenderer* mypMapRenderer = mMapCanvas->mapRenderer();
if ( mypMapRenderer )
{
QgsRenderContext* mypRenderContext = mypMapRenderer->rendererContext();
if ( mypRenderContext )
{
mypRenderContext->setRenderingStopped( true );
}
}
}
mMapCanvas->stopRendering();
}

//reimplements method from base (gui) class
@@ -1392,8 +1392,6 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QCheckBox * mRenderSuppressionCBox;
//! A toggle to switch between mouse coords and view extents display
QToolButton * mToggleExtentsViewButton;
//! Button used to stop rendering
QToolButton* mStopRenderButton;
//! Widget in status bar used to show current project CRS
QLabel * mOnTheFlyProjectionStatusLabel;
//! Widget in status bar used to show status of on the fly projection
@@ -136,10 +136,6 @@ void QgsMapToolCapture::canvasPressEvent( QMouseEvent *e )
}


void QgsMapToolCapture::renderComplete()
{
}

int QgsMapToolCapture::nextPoint( const QPoint &p, QgsPoint &layerPoint, QgsPoint &mapPoint )
{
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mCanvas->currentLayer() );
@@ -61,9 +61,6 @@ class APP_EXPORT QgsMapToolCapture : public QgsMapToolEdit

virtual void keyPressEvent( QKeyEvent* e );

//! Resize rubber band
virtual void renderComplete();

//! deactive the tool
virtual void deactivate();

@@ -412,20 +412,9 @@ void QgsBrowser::keyReleaseEvent( QKeyEvent * e )

void QgsBrowser::stopRendering()
{
// you might have seen this already in QgisApp
QgsDebugMsg( "Entered" );
if ( mapCanvas )
{
QgsMapRenderer* mypMapRenderer = mapCanvas->mapRenderer();
if ( mypMapRenderer )
{
QgsRenderContext* mypRenderContext = mypMapRenderer->rendererContext();
if ( mypRenderContext )
{
mypRenderContext->setRenderingStopped( true );
}
}
}
mapCanvas->stopRendering();
}

QgsBrowser::Tab QgsBrowser::activeTab()
@@ -284,10 +284,10 @@ class CORE_EXPORT QgsMapRenderer : public QObject

//! Returns a QPainter::CompositionMode corresponding to a BlendMode
//! Added in 1.9
Q_DECL_DEPRECATED static QPainter::CompositionMode getCompositionMode( const QgsMapRenderer::BlendMode blendMode );
static QPainter::CompositionMode getCompositionMode( const QgsMapRenderer::BlendMode blendMode );
//! Returns a BlendMode corresponding to a QPainter::CompositionMode
//! Added in 1.9
Q_DECL_DEPRECATED static QgsMapRenderer::BlendMode getBlendModeEnum( const QPainter::CompositionMode blendMode );
static QgsMapRenderer::BlendMode getBlendModeEnum( const QPainter::CompositionMode blendMode );

signals:

@@ -472,6 +472,15 @@ void QgsMapCanvas::refresh()

} // refresh

void QgsMapCanvas::stopRendering()
{
QgsRenderContext* mypRenderContext = mMapRenderer->rendererContext();
if ( mypRenderContext )
{
mypRenderContext->setRenderingStopped( true );
}
}

void QgsMapCanvas::updateMap()
{
}
@@ -1274,19 +1283,13 @@ QGis::UnitType QgsMapCanvas::mapUnits() const
void QgsMapCanvas::setRenderFlag( bool theFlag )
{
mRenderFlag = theFlag;
if ( mMapRenderer )
{
QgsRenderContext* rc = mMapRenderer->rendererContext();
if ( rc )
{
rc->setRenderingStopped( !theFlag );
}
}

if ( mRenderFlag )
{
refresh();
}
else
stopRendering();
}

void QgsMapCanvas::connectNotify( const char * signal )
@@ -139,7 +139,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView

//! Accessor for the canvas paint device
//! @deprecated since 2.1
QPaintDevice &canvasPaintDevice();
Q_DECL_DEPRECATED QPaintDevice &canvasPaintDevice();

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

//! added in 2.1
//! @note probably it is not necessary to allow any client to stop rendering - should be handled just be canvas
Q_DECL_DEPRECATED void stopRendering();

//! show whatever error is exposed by the QgsMapLayer.
void showError( QgsMapLayer * mapLayer );

@@ -25,7 +25,6 @@

#include <qgsmaprendererjob.h>

class QgsMapRenderer;
class QgsMapSettings;
class QgsMapCanvas;

@@ -79,7 +79,8 @@ class GUI_EXPORT QgsMapTool : public QObject
#endif

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


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

0 comments on commit 106b2cc

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