@@ -74,7 +74,7 @@ void QgsAppQueryLogger::queryFinished( const QgsDatabaseQueryLogEntry &query )
74
74
queryGroup->setSql ( query.query );
75
75
}
76
76
77
- const long long newMaxCost = std::max< long long >( query.finishedTime - query.startedTime , mMaxCost );
77
+ const long long newMaxCost = std::max< long long >( static_cast < long long >( query.finishedTime - query.startedTime ) , mMaxCost );
78
78
79
79
// Calculate the number of children: if error or not fetched rows 1 row is added else 2 rows are added
80
80
beginInsertRows ( requestIndex, queryGroup->childCount (), queryGroup->childCount () + ( query.fetchedRows != -1 ? 1 : 0 ) );
@@ -217,8 +217,6 @@ QVariant QgsAppQueryLogger::data( const QModelIndex &index, int role ) const
217
217
switch ( role )
218
218
{
219
219
case Qt::DisplayRole:
220
- return node->data ( QgsDevToolsModelNode::RoleElapsedTime );
221
-
222
220
case QgsDevToolsModelNode::RoleElapsedTime:
223
221
return node->data ( QgsDevToolsModelNode::RoleElapsedTime );
224
222
@@ -307,29 +305,29 @@ bool QgsDatabaseQueryLoggerProxyModel::filterAcceptsRow( int source_row, const Q
307
305
// QueryCostDelegate
308
306
//
309
307
310
- QueryCostDelegate::QueryCostDelegate ( quint32 sortRole, quint32 totalCostRole, QObject *parent )
308
+ QueryCostDelegate::QueryCostDelegate ( int sortRole, int totalCostRole, QObject *parent )
311
309
: QStyledItemDelegate( parent )
312
- , m_sortRole ( sortRole )
313
- , m_totalCostRole ( totalCostRole )
310
+ , mSortRole ( sortRole )
311
+ , mTotalCostRole ( totalCostRole )
314
312
{
315
313
}
316
314
317
315
QueryCostDelegate::~QueryCostDelegate () = default ;
318
316
319
317
void QueryCostDelegate::paint ( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const
320
318
{
321
- const auto cost = index.data ( m_sortRole ).toDouble ();
319
+ const auto cost = index.data ( mSortRole ).toDouble ();
322
320
if ( cost <= 0 )
323
321
{
324
322
QStyledItemDelegate::paint ( painter, option, index );
325
323
return ;
326
324
}
327
325
328
- const auto totalCost = index.data ( m_totalCostRole ).toDouble ();
326
+ const auto totalCost = index.data ( mTotalCostRole ).toDouble ();
329
327
const auto fraction = std::abs ( float ( cost ) / totalCost );
330
328
331
329
auto rect = option.rect ;
332
- rect.setWidth ( rect.width () * fraction );
330
+ rect.setWidth ( static_cast < int >( rect.width () * fraction ) );
333
331
334
332
const auto &brush = painter->brush ();
335
333
const auto &pen = painter->pen ();
@@ -344,7 +342,7 @@ void QueryCostDelegate::paint( QPainter *painter, const QStyleOptionViewItem &op
344
342
painter->drawRect ( option.rect );
345
343
}
346
344
347
- const auto color = QColor::fromHsv ( 120 - fraction * 120 , 255 , 255 , ( -( ( fraction - 1 ) * ( fraction - 1 ) ) ) * 120 + 120 );
345
+ const auto color = QColor::fromHsv ( static_cast < int >( 120 - fraction * 120 ) , 255 , 255 , static_cast < int >( ( -( ( fraction - 1 ) * ( fraction - 1 ) ) ) * 120 + 120 ) );
348
346
painter->setBrush ( color );
349
347
painter->drawRect ( rect );
350
348
0 commit comments