Skip to content

Commit

Permalink
qt, refactor: Use default arguments for overridden functions
Browse files Browse the repository at this point in the history
See Qt docs for QAbstractTableModel and QAbstractItemModel classes.
  • Loading branch information
hebasto committed May 27, 2021
1 parent ea1e5c2 commit efb7e5a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/qt/peertablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,23 @@ void PeerTableModel::stopAutoRefresh()
timer->stop();
}

int PeerTableModel::rowCount(const QModelIndex &parent) const
int PeerTableModel::rowCount(const QModelIndex& parent) const
{
if (parent.isValid()) {
return 0;
}
return priv->size();
}

int PeerTableModel::columnCount(const QModelIndex &parent) const
int PeerTableModel::columnCount(const QModelIndex& parent) const
{
if (parent.isValid()) {
return 0;
}
return columns.length();
}

QVariant PeerTableModel::data(const QModelIndex &index, int role) const
QVariant PeerTableModel::data(const QModelIndex& index, int role) const
{
if(!index.isValid())
return QVariant();
Expand Down Expand Up @@ -172,7 +172,7 @@ Qt::ItemFlags PeerTableModel::flags(const QModelIndex &index) const
return retval;
}

QModelIndex PeerTableModel::index(int row, int column, const QModelIndex &parent) const
QModelIndex PeerTableModel::index(int row, int column, const QModelIndex& parent) const
{
Q_UNUSED(parent);
CNodeCombinedStats *data = priv->index(row);
Expand Down
10 changes: 5 additions & 5 deletions src/qt/peertablemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ class PeerTableModel : public QAbstractTableModel

/** @name Methods overridden from QAbstractTableModel
@{*/
int rowCount(const QModelIndex &parent) const override;
int columnCount(const QModelIndex &parent) const override;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
QModelIndex index(int row, int column, const QModelIndex &parent) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
/*@}*/

Expand Down

0 comments on commit efb7e5a

Please sign in to comment.