forked from qt-creator/qt-creator
Wizards: Fix generation of dynamically populated models
This was implemented for QAbstractItemModel based classes, but forgotten for QAbstractListModel and QAbstractTableModel based classes. Change-Id: I807f445e48d2906580abd0a65bb794d6e766c1a7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -35,6 +35,24 @@ int %{CN}::rowCount(const QModelIndex &parent) const
|
||||
|
||||
// FIXME: Implement me!
|
||||
}
|
||||
@if %{DynamicFetch}
|
||||
|
||||
bool %{CN}::hasChildren(const QModelIndex &parent) const
|
||||
{
|
||||
// FIXME: Implement me!
|
||||
}
|
||||
|
||||
bool %{CN}::canFetchMore(const QModelIndex &parent) const
|
||||
{
|
||||
// FIXME: Implement me!
|
||||
return false;
|
||||
}
|
||||
|
||||
void %{CN}::fetchMore(const QModelIndex &parent)
|
||||
{
|
||||
// FIXME: Implement me!
|
||||
}
|
||||
@endif
|
||||
|
||||
QVariant %{CN}::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
|
@@ -28,6 +28,14 @@ public:
|
||||
// Basic functionality:
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
@if %{DynamicFetch}
|
||||
// Fetch data dynamically:
|
||||
bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
bool canFetchMore(const QModelIndex &parent) const override;
|
||||
void fetchMore(const QModelIndex &parent) override;
|
||||
|
||||
@endif
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
@if %{Editable}
|
||||
|
@@ -42,6 +42,24 @@ int %{CN}::columnCount(const QModelIndex &parent) const
|
||||
|
||||
// FIXME: Implement me!
|
||||
}
|
||||
@if %{DynamicFetch}
|
||||
|
||||
bool %{CN}::hasChildren(const QModelIndex &parent) const
|
||||
{
|
||||
// FIXME: Implement me!
|
||||
}
|
||||
|
||||
bool %{CN}::canFetchMore(const QModelIndex &parent) const
|
||||
{
|
||||
// FIXME: Implement me!
|
||||
return false;
|
||||
}
|
||||
|
||||
void %{CN}::fetchMore(const QModelIndex &parent)
|
||||
{
|
||||
// FIXME: Implement me!
|
||||
}
|
||||
@endif
|
||||
|
||||
QVariant %{CN}::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
|
@@ -29,6 +29,14 @@ public:
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
@if %{DynamicFetch}
|
||||
// Fetch data dynamically:
|
||||
bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
bool canFetchMore(const QModelIndex &parent) const override;
|
||||
void fetchMore(const QModelIndex &parent) override;
|
||||
|
||||
@endif
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
@if %{Editable}
|
||||
|
Reference in New Issue
Block a user