Hi,
in my own model I have:
// BibtexGlobal::SearchFilter is an enum
QVariant data(const QModelIndex &index, int role) const;
QVariant data(const QModelIndex &index, BibtexGlobal::SearchFilter role) const;
// BibtexGlobal::SearchFilter is an enum
To copy to clipboard, switch view to plain text mode
And in an other class I call:
QModelIndex index
= sourceModel
()->index
(sourceRow,
0, sourceParent
);
QHash<BibtexGlobal
::SearchFilter,
QRegExp*>
::const_iterator i
= m_filter.
constBegin();
while (i != m_filter.constEnd())
{
qWarning() << sourceModel()->data(index, i.key());
++i;
}
QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
QHash<BibtexGlobal::SearchFilter, QRegExp*>::const_iterator i = m_filter.constBegin();
while (i != m_filter.constEnd())
{
qWarning() << sourceModel()->data(index, i.key());
++i;
}
To copy to clipboard, switch view to plain text mode
But although i.key() is BibtexGlobal::SearchFilter the function data(const QModelIndex &index, int role) is called. Why? Is int and enum for the compiler the same?
Thanks
Bookmarks