From 195fcb53a09e9b852544778a077727f81d31303e Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 2 Jan 2021 21:40:53 +0200 Subject: qt: Follow Qt docs when implementing rowCount and columnCount --- src/qt/bantablemodel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/qt/bantablemodel.cpp') diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp index 2676de96d7..a01a7bc386 100644 --- a/src/qt/bantablemodel.cpp +++ b/src/qt/bantablemodel.cpp @@ -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(); } -- cgit v1.2.3