Added default invalid parentIndex to TableModel::columnCount and added Q_UNUSED macro to suppress warnings.
This commit is contained in:
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user