qt: Follow Qt docs when implementing rowCount and columnCount

This commit is contained in:
Hennadii Stepanov 2021-01-02 21:40:53 +02:00
parent ae8f797135
commit 195fcb53a0
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
5 changed files with 30 additions and 12 deletions

View file

@ -177,13 +177,17 @@ AddressTableModel::~AddressTableModel()
int AddressTableModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
if (parent.isValid()) {
return 0;
}
return priv->size();
}
int AddressTableModel::columnCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
if (parent.isValid()) {
return 0;
}
return columns.length();
}

View file

@ -98,13 +98,17 @@ BanTableModel::~BanTableModel()
int BanTableModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
if (parent.isValid()) {
return 0;
}
return priv->size();
}
int BanTableModel::columnCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
if (parent.isValid()) {
return 0;
}
return columns.length();
}

View file

@ -134,13 +134,17 @@ void PeerTableModel::stopAutoRefresh()
int PeerTableModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
if (parent.isValid()) {
return 0;
}
return priv->size();
}
int PeerTableModel::columnCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
if (parent.isValid()) {
return 0;
}
return columns.length();
}

View file

@ -36,15 +36,17 @@ RecentRequestsTableModel::~RecentRequestsTableModel()
int RecentRequestsTableModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
if (parent.isValid()) {
return 0;
}
return list.length();
}
int RecentRequestsTableModel::columnCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
if (parent.isValid()) {
return 0;
}
return columns.length();
}

View file

@ -289,13 +289,17 @@ void TransactionTableModel::updateConfirmations()
int TransactionTableModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
if (parent.isValid()) {
return 0;
}
return priv->size();
}
int TransactionTableModel::columnCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
if (parent.isValid()) {
return 0;
}
return columns.length();
}