Commit 252a3f89 authored by David Faure's avatar David Faure

Fix wrong code in list/table model templates

rowCount should return 0 if the parent *is* valid, and return
the actual number of rows when queried with an invalid index.

Change-Id: I00e3d4ea79e1aaf0be1974da876c5a871d3924e6
Reviewed-by: Alessandro Portale's avatarAlessandro Portale <alessandro.portale@qt.io>
parent 7f07ec41
......@@ -28,7 +28,7 @@ bool %{CN}::setHeaderData(int section, Qt::Orientation orientation, const QVaria
int %{CN}::rowCount(const QModelIndex &parent) const
{
if (!parent.isValid())
if (parent.isValid())
return 0;
// FIXME: Implement me!
......
......@@ -29,7 +29,7 @@ bool %{CN}::setHeaderData(int section, Qt::Orientation orientation, const QVaria
int %{CN}::rowCount(const QModelIndex &parent) const
{
if (!parent.isValid())
if (parent.isValid())
return 0;
// FIXME: Implement me!
......@@ -37,7 +37,7 @@ int %{CN}::rowCount(const QModelIndex &parent) const
int %{CN}::columnCount(const QModelIndex &parent) const
{
if (!parent.isValid())
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