Skip to content
Snippets Groups Projects
Commit 8dd71a91 authored by Daniel Molkentin's avatar Daniel Molkentin
Browse files

Let the ListModel wizard generate a valid model.

parent 9beab974
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ int %ClassName%::rowCount(const QModelIndex &) const ...@@ -17,7 +17,7 @@ int %ClassName%::rowCount(const QModelIndex &) const
return items.size(); return items.size();
} }
QVariant %ClassName%::data(const QModelIndex &index, int) QVariant %ClassName%::data(const QModelIndex &index, int) const
{ {
return items.at(index.row()); return items.at(index.row());
} }
...@@ -11,7 +11,7 @@ public: ...@@ -11,7 +11,7 @@ public:
void addItems(const QList<%Datatype%> &items); void addItems(const QList<%Datatype%> &items);
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole); virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
private: private:
QList<%Datatype%> items; QList<%Datatype%> items;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment