Skip to content

Commit

Permalink
Show root feature in treeview
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Friedel committed Nov 20, 2023
1 parent 1c016ad commit 90ff5a8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tools/fm-editor/tree/FeatureTreeViewModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ class FeatureTreeViewModel : public QAbstractItemModel {
FeatureTreeViewModel(vara::feature::FeatureModel *Model, QObject *Parent)
: QAbstractItemModel(Parent) {
auto UniqueRoot = FeatureTreeItem::createFeatureTreeItem(Model->getRoot());
RootItem = UniqueRoot.get();
RootItem = new FeatureTreeItemFeature(nullptr);
RootItem->addChild(UniqueRoot.get());
auto RawRoot = UniqueRoot.get();
Items.push_back(std::move(UniqueRoot));
buildRecursive(RootItem);
buildRecursive(RawRoot);
}
~FeatureTreeViewModel() override { std::destroy(Items.begin(), Items.end()); }
~FeatureTreeViewModel() override {
delete RootItem;
std::destroy(Items.begin(), Items.end()); }

std::vector<std::unique_ptr<FeatureTreeItem>> *getItems();
[[nodiscard]] QVariant data(const QModelIndex &Index,
Expand Down

0 comments on commit 90ff5a8

Please sign in to comment.