qt: Follow Qt docs when implementing rowCount and columnCount

This commit is contained in:
Hennadii Stepanov committed 2021-01-02 21:40:53 +02:00
1 parent ae8f797135
commit 195fcb53a0
5 files changed
+30 -12

No files matched your search

+6 -2
View File
@@ -177,13 +177,17 @@ AddressTableModel::~AddressTableModel()
int AddressTableModel::rowCount(const QModelIndex &parent) const int AddressTableModel::rowCount(const QModelIndex &parent) const
{ {
Q_UNUSED(parent); if (parent.isValid()) {
return 0;
}
return priv->size(); return priv->size();
} }
int AddressTableModel::columnCount(const QModelIndex &parent) const int AddressTableModel::columnCount(const QModelIndex &parent) const
{ {
Q_UNUSED(parent); if (parent.isValid()) {
return 0;
}
return columns.length(); return columns.length();
} }
+6 -2
View File
@@ -98,13 +98,17 @@ BanTableModel::~BanTableModel()
int BanTableModel::rowCount(const QModelIndex &parent) const int BanTableModel::rowCount(const QModelIndex &parent) const
{ {
Q_UNUSED(parent); if (parent.isValid()) {
return 0;
}
return priv->size(); return priv->size();
} }
int BanTableModel::columnCount(const QModelIndex &parent) const int BanTableModel::columnCount(const QModelIndex &parent) const
{ {
Q_UNUSED(parent); if (parent.isValid()) {
return 0;
}
return columns.length(); return columns.length();
} }
+6 -2
View File
@@ -134,13 +134,17 @@ void PeerTableModel::stopAutoRefresh()
int PeerTableModel::rowCount(const QModelIndex &parent) const int PeerTableModel::rowCount(const QModelIndex &parent) const
{ {
Q_UNUSED(parent); if (parent.isValid()) {
return 0;
}
return priv->size(); return priv->size();
} }
int PeerTableModel::columnCount(const QModelIndex &parent) const int PeerTableModel::columnCount(const QModelIndex &parent) const
{ {
Q_UNUSED(parent); if (parent.isValid()) {
return 0;
}
return columns.length(); return columns.length();
} }
+6 -4
View File
@@ -36,15 +36,17 @@ RecentRequestsTableModel::~RecentRequestsTableModel()
int RecentRequestsTableModel::rowCount(const QModelIndex &parent) const int RecentRequestsTableModel::rowCount(const QModelIndex &parent) const
{ {
Q_UNUSED(parent); if (parent.isValid()) {
return 0;
}
return list.length(); return list.length();
} }
int RecentRequestsTableModel::columnCount(const QModelIndex &parent) const int RecentRequestsTableModel::columnCount(const QModelIndex &parent) const
{ {
Q_UNUSED(parent); if (parent.isValid()) {
return 0;
}
return columns.length(); return columns.length();
} }
+6 -2
View File
@@ -289,13 +289,17 @@ void TransactionTableModel::updateConfirmations()
int TransactionTableModel::rowCount(const QModelIndex &parent) const int TransactionTableModel::rowCount(const QModelIndex &parent) const
{ {
Q_UNUSED(parent); if (parent.isValid()) {
return 0;
}
return priv->size(); return priv->size();
} }
int TransactionTableModel::columnCount(const QModelIndex &parent) const int TransactionTableModel::columnCount(const QModelIndex &parent) const
{ {
Q_UNUSED(parent); if (parent.isValid()) {
return 0;
}
return columns.length(); return columns.length();
} }