Skip to content
Snippets Groups Projects
Commit 252a3f89 authored by David Faure's avatar David Faure
Browse files

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: default avatarAlessandro Portale <alessandro.portale@qt.io>
parent 7f07ec41
Branches
Tags
No related merge requests found
...@@ -28,7 +28,7 @@ bool %{CN}::setHeaderData(int section, Qt::Orientation orientation, const QVaria ...@@ -28,7 +28,7 @@ bool %{CN}::setHeaderData(int section, Qt::Orientation orientation, const QVaria
int %{CN}::rowCount(const QModelIndex &parent) const int %{CN}::rowCount(const QModelIndex &parent) const
{ {
if (!parent.isValid()) if (parent.isValid())
return 0; return 0;
// FIXME: Implement me! // FIXME: Implement me!
......
...@@ -29,7 +29,7 @@ bool %{CN}::setHeaderData(int section, Qt::Orientation orientation, const QVaria ...@@ -29,7 +29,7 @@ bool %{CN}::setHeaderData(int section, Qt::Orientation orientation, const QVaria
int %{CN}::rowCount(const QModelIndex &parent) const int %{CN}::rowCount(const QModelIndex &parent) const
{ {
if (!parent.isValid()) if (parent.isValid())
return 0; return 0;
// FIXME: Implement me! // FIXME: Implement me!
...@@ -37,7 +37,7 @@ int %{CN}::rowCount(const QModelIndex &parent) const ...@@ -37,7 +37,7 @@ int %{CN}::rowCount(const QModelIndex &parent) const
int %{CN}::columnCount(const QModelIndex &parent) const int %{CN}::columnCount(const QModelIndex &parent) const
{ {
if (!parent.isValid()) if (parent.isValid())
return 0; return 0;
// FIXME: Implement me! // FIXME: Implement me!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment