diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp index b6c9c4b430d..921267d015d 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp +++ b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp @@ -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 { diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h index 87812bdb595..fe1ef78cc61 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h +++ b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h @@ -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} diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp index cda910e6f76..e8c71f18bb9 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp +++ b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp @@ -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 { diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h index f6a0ad59c2f..b6293563064 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h +++ b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h @@ -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}