[gui] Fix progress bar in status bar

This commit is contained in:
Andrea Giudiceandrea 2025-01-01 12:49:57 +01:00 committed by GitHub
parent 340861dc00
commit 88d7ee04e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,7 +87,7 @@ void QgsTaskManagerWidget::modelRowsInserted( const QModelIndex &, int start, in
if ( progress > 0 )
{
progressBar->setMaximum( 100 );
progressBar->setValue( static_cast<int>( std::round( progress ) ) );
progressBar->setValue( static_cast<int>( progress ) );
}
else
progressBar->setMaximum( 0 );
@ -641,7 +641,7 @@ void QgsTaskManagerStatusBarWidget::toggleDisplay()
void QgsTaskManagerStatusBarWidget::overallProgressChanged( double progress )
{
mProgressBar->setValue( static_cast<int>( std::round( progress ) ) );
mProgressBar->setValue( static_cast<int>( progress ) );
if ( qgsDoubleNear( progress, 0.0 ) )
mProgressBar->setMaximum( 0 );
else if ( mProgressBar->maximum() == 0 )