Skip to content
Permalink
Browse files

[ui] prevent infinite canvas redraw due to (#6098)

progress bar changing status bar height when
shown/hidden.

Yes, it's as bad as it sounds.
  • Loading branch information
nirvn committed Jan 18, 2018
1 parent bc1bfd3 commit 5dc91b4b1f133252d5d81a44ec0ce91a6c3cb0ef
Showing with 5 additions and 7 deletions.
  1. +5 −7 src/app/qgisapp.cpp
@@ -2783,10 +2783,8 @@ void QgisApp::createStatusBar()
// And also rendering suppression checkbox
mProgressBar = new QProgressBar( mStatusBar );
mProgressBar->setObjectName( QStringLiteral( "mProgressBar" ) );
mProgressBar->setMaximumWidth( 100 );
mProgressBar->hide();
mProgressBar->setWhatsThis( tr( "Progress bar that displays the status "
"of rendering layers and other time-intensive operations" ) );
mProgressBar->setMaximumWidth( 0 );
mProgressBar->setMaximumHeight( 18 );
mStatusBar->addPermanentWidget( mProgressBar, 1 );

connect( mMapCanvas, &QgsMapCanvas::renderStarting, this, &QgisApp::canvasRefreshStarted );
@@ -11084,14 +11082,14 @@ void QgisApp::showProgress( int progress, int totalSteps )
if ( progress == totalSteps )
{
mProgressBar->reset();
mProgressBar->hide();
mProgressBar->setMaximumWidth( 0 );
}
else
{
//only call show if not already hidden to reduce flicker
if ( !mProgressBar->isVisible() )
if ( mProgressBar->maximumWidth() == 0 )
{
mProgressBar->show();
mProgressBar->setMaximumWidth( 100 );
}
mProgressBar->setMaximum( totalSteps );
mProgressBar->setValue( progress );

0 comments on commit 5dc91b4

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