Commit 69143bc3 authored by Lorenz Haas's avatar Lorenz Haas
Browse files

Wizards: Fix list model wizard's rowCount()



rowCount() must return 0 when the parent is valid: this indicates that
the list's items has no children and thus it is no tree model. The
list's size has to be returned for an invalid parent (== the invisible
root node).

Change-Id: Ieaa884958ea0094aca2232160b6f769bf90514c4
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent f41e1d3a
......@@ -28,7 +28,9 @@ bool %{CN}::setHeaderData(int section, Qt::Orientation orientation, const QVaria
int %{CN}::rowCount(const QModelIndex &parent) const
{
if (!parent.isValid())
// For list models only the root node (an invalid parent) should return the list's size. For all
// other (valid) parents, rowCount() should return 0 so that it does not become a tree model.
if (parent.isValid())
return 0;
// FIXME: Implement me!
......
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