forked from qt-creator/qt-creator
Valgrind: Modernize
modernize-* Change-Id: I6db60dce78cf2575e36caa597b1f095adba34fd9 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user