I was always returning the cell data.
Something like:
if (!index.isValid())
if (role == Qt::DecorationRole)
switch(index.column())
{
case 0: return "col0";
case 1: return "col1";
case 2: return "col2";
...
}
if (!index.isValid())
return QVariant();
if (role == Qt::DecorationRole)
return QIcon(/* */);
switch(index.column())
{
case 0: return "col0";
case 1: return "col1";
case 2: return "col2";
...
}
return QVariant();
To copy to clipboard, switch view to plain text mode
What does that mean?
I return a string for the role Qt::SizeHintRole - which causes each item to have a size of 0.
That's why the list view has a total height of 0 as well.

Again THX a lot!
Bookmarks