Skip to content

Commit

Permalink
Merge pull request #212 from homann/issue2850
Browse files Browse the repository at this point in the history
Fix for issue 2850
  • Loading branch information
timlinux committed Aug 25, 2012
2 parents ae08961 + 5ba8422 commit 835f961
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/qgsmeasuredialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ QgsMeasureDialog::QgsMeasureDialog( QgsMeasureTool* tool, Qt::WFlags f )
else
mcbProjectionEnabled->setCheckState( Qt::Unchecked );

connect( mcbProjectionEnabled, SIGNAL( stateChanged( int ) ),
// Update whenever the canvas has refreshed. Maybe more often than needed,
// but at least every time any settings changes
connect( mTool->canvas(), SIGNAL( mapCanvasRefreshed() ),
this, SLOT( changeProjectionEnabledState() ) );
// Update when project wide transformation has changed
connect( mTool->canvas()->mapRenderer(), SIGNAL( hasCrsTransformEnabled( bool ) ),
Expand Down Expand Up @@ -297,6 +299,7 @@ void QgsMeasureDialog::convertMeasurement( double &measure, QGis::UnitType &u, b

void QgsMeasureDialog::changeProjectionEnabledState()
{
QgsDebugMsg( "Entering!" );
// store value
QSettings settings;
if ( mcbProjectionEnabled->isChecked() )
Expand Down Expand Up @@ -357,6 +360,7 @@ void QgsMeasureDialog::changeProjectionEnabledState()
b = false;
}
}
QgsDebugMsg( "Exiting!" );
}

void QgsMeasureDialog::configureDistanceArea()
Expand Down
1 change: 1 addition & 0 deletions src/app/qgsmeasuretool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ QgsMeasureTool::QgsMeasureTool( QgsMapCanvas* canvas, bool measureArea )

QgsMeasureTool::~QgsMeasureTool()
{
delete mDialog;
delete mRubberBand;
}

Expand Down
4 changes: 4 additions & 0 deletions src/gui/qgsmapcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,10 @@ void QgsMapCanvas::refresh()
}

mDrawing = false;

// Done refreshing
emit mapCanvasRefreshed();

} // refresh

void QgsMapCanvas::updateMap()
Expand Down
4 changes: 4 additions & 0 deletions src/gui/qgsmapcanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
*/
void renderComplete( QPainter * );

/** Emitted when canvas finished a refresh request.
\note Added in 2.0 */
void mapCanvasRefreshed();

/** Emitted when the canvas is about to be rendered.
\note Added in 1.5 */
void renderStarting();
Expand Down

0 comments on commit 835f961

Please sign in to comment.