aboutsummaryrefslogtreecommitdiffstats
path: root/gui/designwidget.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie.hung+gitlab@gmail.com>2018-07-21 19:03:35 +0000
committerEddie Hung <eddie.hung+gitlab@gmail.com>2018-07-21 19:03:35 +0000
commitf176ee48cdd6b508f6f26e7b2ccca97a680929cf (patch)
tree93d8b7f0baad5b504aff26acdba441ea6ba6d8c6 /gui/designwidget.cc
parent3eecccc6f7f8c36994e9227adfc8ab1067ea287f (diff)
parent1f6897733b57f03cf7f5ccab46c27de811d42167 (diff)
downloadnextpnr-f176ee48cdd6b508f6f26e7b2ccca97a680929cf.tar.gz
nextpnr-f176ee48cdd6b508f6f26e7b2ccca97a680929cf.tar.bz2
nextpnr-f176ee48cdd6b508f6f26e7b2ccca97a680929cf.zip
Merge branch 'redist_slack' into 'redist_slack'
Redist slack See merge request eddiehung/nextpnr!5
Diffstat (limited to 'gui/designwidget.cc')
-rw-r--r--gui/designwidget.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/gui/designwidget.cc b/gui/designwidget.cc
index 4123bf30..f7ae82f5 100644
--- a/gui/designwidget.cc
+++ b/gui/designwidget.cc
@@ -230,6 +230,9 @@ void DesignWidget::addToHistory(QTreeWidgetItem *item)
void DesignWidget::newContext(Context *ctx)
{
treeWidget->clear();
+ // reset pointers since they are not valid after clear
+ nets_root = nullptr;
+ cells_root = nullptr;
history_ignore = false;
history_index = -1;
history.clear();
@@ -334,16 +337,7 @@ void DesignWidget::newContext(Context *ctx)
for (auto pip : nameToItem[2].toStdMap()) {
pip_root->addChild(pip.second);
}
-
- // Add nets to tree
- nets_root = new QTreeWidgetItem(treeWidget);
- nets_root->setText(0, "Nets");
- treeWidget->insertTopLevelItem(0, nets_root);
-
- // Add cells to tree
- cells_root = new QTreeWidgetItem(treeWidget);
- cells_root->setText(0, "Cells");
- treeWidget->insertTopLevelItem(0, cells_root);
+ updateTree();
}
void DesignWidget::updateTree()