Commit 8c23abb7 authored by Frédéric Brière's avatar Frédéric Brière Committed by Albert Astals Cid
Browse files

Have EntryListModel::rowCount()/columnCount() return 0 when required

The documentation for QAbstractItemModel states:

    When implementing a table based model, rowCount()/columnCount()
    should return 0 when the parent is valid.
parent d55122d9
......@@ -59,12 +59,12 @@ void EntryListModel::setEntryList( const EntryList &list )
int EntryListModel::rowCount( const QModelIndex & parent ) const
{
return _list.size();
return parent.isValid() ? 0 : _list.size();
}
int EntryListModel::columnCount( const QModelIndex & parent ) const
{
return 3;
return parent.isValid() ? 0 : 3;
}
QVariant EntryListModel::data ( const QModelIndex & index, int role ) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment