aboutsummaryrefslogtreecommitdiffstats
path: root/gui/treemodel.h
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-08-02 13:02:07 +0200
committerClifford Wolf <clifford@clifford.at>2018-08-02 13:02:07 +0200
commitf9a9da6cdb6e864f04532fd1d1ab3e646319fc2d (patch)
treed0542fcdf558552f23b8baa49f4f981bf23d1883 /gui/treemodel.h
parent2b3f363e8975e80bb56e6adaea5604ab8fce164c (diff)
parent81ee55c7eb2f153ba01a6ff8aba2bffc54daa9dc (diff)
downloadnextpnr-f9a9da6cdb6e864f04532fd1d1ab3e646319fc2d.tar.gz
nextpnr-f9a9da6cdb6e864f04532fd1d1ab3e646319fc2d.tar.bz2
nextpnr-f9a9da6cdb6e864f04532fd1d1ab3e646319fc2d.zip
Merge branch 'master' of github.com:YosysHQ/nextpnr into reroute
Diffstat (limited to 'gui/treemodel.h')
-rw-r--r--gui/treemodel.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/gui/treemodel.h b/gui/treemodel.h
index 4c3f64c3..c3f9fe88 100644
--- a/gui/treemodel.h
+++ b/gui/treemodel.h
@@ -62,6 +62,8 @@ class Item
void addChild(Item *child) { children_.append(child); }
+ void deleteChild(Item *child) { children_.removeAll(child); }
+
public:
Item(QString name, Item *parent) : name_(name), parent_(parent)
{
@@ -100,7 +102,12 @@ class Item
virtual bool canFetchMore() const { return false; }
virtual void fetchMore() {}
- ~Item() {}
+ ~Item()
+ {
+ if (parent_ != nullptr) {
+ parent_->deleteChild(this);
+ }
+ }
};
// IdString is an Item that corresponds to a real element in Arch.