Skip to content
Permalink
Browse files

Fix some clang warnings

  • Loading branch information
nyalldawson committed Aug 7, 2018
1 parent 4b1bc82 commit 13b790d1e6bbd3eadf227b8c89e49c29d4b5402c
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/gui/qgstaskmanagerwidget.cpp
@@ -46,9 +46,9 @@ QgsTaskManagerWidget::QgsTaskManagerWidget( QgsTaskManager *manager, QWidget *pa
mTreeView->setHeaderHidden( true );
mTreeView->setRootIsDecorated( false );
mTreeView->setSelectionBehavior( QAbstractItemView::SelectRows );
int progressColWidth = fontMetrics().width( "X" ) * 10 * Qgis::UI_SCALE_FACTOR;
int progressColWidth = static_cast< int >( fontMetrics().width( 'X' ) * 10 * Qgis::UI_SCALE_FACTOR );
mTreeView->setColumnWidth( QgsTaskManagerModel::Progress, progressColWidth );
int statusColWidth = fontMetrics().width( "X" ) * 2 * Qgis::UI_SCALE_FACTOR;
int statusColWidth = static_cast< int >( fontMetrics().width( 'X' ) * 2 * Qgis::UI_SCALE_FACTOR );
mTreeView->setColumnWidth( QgsTaskManagerModel::Status, statusColWidth );
mTreeView->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
mTreeView->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
@@ -85,7 +85,7 @@ void QgsTaskManagerWidget::modelRowsInserted( const QModelIndex &, int start, in
if ( progress > 0 )
{
progressBar->setMaximum( 100 );
progressBar->setValue( progress );
progressBar->setValue( static_cast< int >( std::round( progress ) ) );
}
else
progressBar->setMaximum( 0 );
@@ -570,8 +570,8 @@ QgsTaskManagerFloatingWidget::QgsTaskManagerFloatingWidget( QgsTaskManager *mana
{
setLayout( new QVBoxLayout() );
QgsTaskManagerWidget *w = new QgsTaskManagerWidget( manager );
int minWidth = fontMetrics().width( 'X' ) * 60 * Qgis::UI_SCALE_FACTOR;
int minHeight = fontMetrics().height() * 15 * Qgis::UI_SCALE_FACTOR;
int minWidth = static_cast< int >( fontMetrics().width( 'X' ) * 60 * Qgis::UI_SCALE_FACTOR );
int minHeight = static_cast< int >( fontMetrics().height() * 15 * Qgis::UI_SCALE_FACTOR );
setMinimumSize( minWidth, minHeight );
layout()->addWidget( w );
setStyleSheet( ".QgsTaskManagerFloatingWidget { border-top-left-radius: 8px;"
@@ -609,7 +609,7 @@ QgsTaskManagerStatusBarWidget::QgsTaskManagerStatusBarWidget( QgsTaskManager *ma

QSize QgsTaskManagerStatusBarWidget::sizeHint() const
{
int width = fontMetrics().width( 'X' ) * 10 * Qgis::UI_SCALE_FACTOR;
int width = static_cast< int >( fontMetrics().width( 'X' ) * 10 * Qgis::UI_SCALE_FACTOR );
int height = QToolButton::sizeHint().height();
return QSize( width, height );
}
@@ -627,7 +627,7 @@ void QgsTaskManagerStatusBarWidget::toggleDisplay()

void QgsTaskManagerStatusBarWidget::overallProgressChanged( double progress )
{
mProgressBar->setValue( progress );
mProgressBar->setValue( static_cast< int >( std::round( progress ) ) );
if ( qgsDoubleNear( progress, 0.0 ) )
mProgressBar->setMaximum( 0 );
else if ( mProgressBar->maximum() == 0 )

0 comments on commit 13b790d

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