problem with rowCount method
Hi everybody,
I defined my own TableModel using the QAbstractTableModel class...all run perfectly just i couldn't use the rowCount method in my program :
"no Matching function for call to TableModel::rowCount const"
"condidates are virtual int TableModel::rowCount const"
i'm sure that i have defined correctly the virtual method but i don't know what happened ? i have also changed the example of adresse book:
Code:
{
if (!index.isValid())
if (index.row() >= /*listOfPairs.size()*/ rowCount() || index.row() < 0)
if (role == Qt::DisplayRole) {
QPair<QString, QString> pair = listOfPairs.at(index.row());
if (index.column() == 0)
return pair.first;
else if (index.column() == 1)
return pair.second;
}
}
same fact !!
any idea ??
Re: problem with rowCount method
How does your method look like exactly?
What is the return type?
Everall
Re: problem with rowCount method
Make sure that the declaration of the method in your subclass allows a default argument for the parent model index.