Fix waitForFinishedWithEventLoop() causing a freeze in composer

Thanks Nyall for finding that out!
This commit is contained in:
Martin Dobias 2014-06-16 18:07:51 +07:00
parent 033bf6f6cc
commit bff7882cf6

View File

@ -238,18 +238,10 @@ void QgsMapRendererCustomPainterJob::start()
QgsDebugMsg( "Rendering prepared in (seconds): " + QString( "%1" ).arg( prepareTime.elapsed() / 1000.0 ) ); QgsDebugMsg( "Rendering prepared in (seconds): " + QString( "%1" ).arg( prepareTime.elapsed() / 1000.0 ) );
// now we are ready to start rendering! // now we are ready to start rendering!
if ( !mLayerJobs.isEmpty() ) connect( &mFutureWatcher, SIGNAL( finished() ), SLOT( futureFinished() ) );
{
connect( &mFutureWatcher, SIGNAL( finished() ), SLOT( futureFinished() ) );
mFuture = QtConcurrent::run( staticRender, this ); mFuture = QtConcurrent::run( staticRender, this );
mFutureWatcher.setFuture( mFuture ); mFutureWatcher.setFuture( mFuture );
}
else
{
// just make sure we will clean up and emit finished() signal
QTimer::singleShot( 0, this, SLOT( futureFinished() ) );
}
} }