Valgrind: Modernize

modernize-*

Change-Id: I6db60dce78cf2575e36caa597b1f095adba34fd9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Alessandro Portale
2018-12-10 08:11:18 +01:00
parent 390a227df6
commit 00ec6dfb5d
53 changed files with 182 additions and 294 deletions

View File

@@ -44,20 +44,13 @@ namespace Internal {
class CostDelegate::Private
{
public:
Private();
QAbstractItemModel *m_model;
CostDelegate::CostFormat m_format;
QAbstractItemModel *m_model = nullptr;
CostDelegate::CostFormat m_format = CostDelegate::FormatAbsolute;
float relativeCost(const QModelIndex &index) const;
QString displayText(const QModelIndex &index, const QLocale &locale) const;
};
CostDelegate::Private::Private()
: m_model(0)
, m_format(CostDelegate::FormatAbsolute)
{}
static int toNativeRole(CostDelegate::CostFormat format)
{
switch (format)
@@ -145,7 +138,7 @@ void CostDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
// Draw text.
QLocale loc = opt.locale;
loc.setNumberOptions(0);
loc.setNumberOptions(nullptr);
const QString text = d->displayText(index, loc);
const QBrush &textBrush = (option.state & QStyle::State_Selected ? opt.palette.highlightedText() : opt.palette.text());
painter->setBrush(Qt::NoBrush);