Added default invalid parentIndex to TableModel::columnCount and added Q_UNUSED macro to suppress warnings.

This commit is contained in:
2025-12-08 13:33:05 +01:00
parent 4c906099eb
commit d45b1098f9
2 changed files with 9 additions and 3 deletions

View File

@ -30,9 +30,15 @@ Qt::ItemFlags TableModel::flags(const QModelIndex& index) const {
QHash<int, QByteArray> TableModel::roleNames() const { return ROLE_NAMES; }
int TableModel::rowCount(const QModelIndex& parent) const { return m_items.size(); }
int TableModel::rowCount(const QModelIndex& parent) const {
Q_UNUSED(parent);
return m_items.size();
}
int TableModel::columnCount(const QModelIndex& parent) const { return ROLE_NAMES.size(); }
int TableModel::columnCount(const QModelIndex& parent) const {
Q_UNUSED(parent);
return ROLE_NAMES.size();
}
QVariant TableModel::data(const QModelIndex& index, int role) const {
const int row = index.row();