diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/designwidget.cc | 12 | ||||
-rw-r--r-- | gui/treemodel.cc | 8 |
2 files changed, 12 insertions, 8 deletions
diff --git a/gui/designwidget.cc b/gui/designwidget.cc index b321aef1..ee6a14b4 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -223,6 +223,18 @@ void DesignWidget::updateTree() clearProperties();
+ QMap<ContextTreeItem *, int>::iterator i = highlightSelected.begin();
+ while (i != highlightSelected.end()) {
+ QMap<ContextTreeItem *, int>::iterator prev = i;
+ ++i;
+ if (prev.key()->type() == ElementType::NET && ctx->nets.find(prev.key()->id()) == ctx->nets.end()) {
+ highlightSelected.erase(prev);
+ }
+ if (prev.key()->type() == ElementType::CELL && ctx->cells.find(prev.key()->id()) == ctx->cells.end()) {
+ highlightSelected.erase(prev);
+ }
+ }
+
treeModel->updateData(ctx);
}
QtProperty *DesignWidget::addTopLevelProperty(const QString &id)
diff --git a/gui/treemodel.cc b/gui/treemodel.cc index 65a17a2f..5a064f57 100644 --- a/gui/treemodel.cc +++ b/gui/treemodel.cc @@ -166,10 +166,6 @@ void ContextTreeModel::updateData(Context *ctx) QMap<QString, ContextTreeItem *>::iterator prev = i; ++i; if (ctx->nets.find(ctx->id(prev.key().toStdString())) == ctx->nets.end()) { - /* if (treeWidget->currentItem() == prev.value()) - treeWidget->setCurrentItem(nets_root); - if (highlightSelected.contains(prev.value())) - highlightSelected.remove(prev.value());*/ delete prev.value(); nameToItem[3].erase(prev); } @@ -191,10 +187,6 @@ void ContextTreeModel::updateData(Context *ctx) QMap<QString, ContextTreeItem *>::iterator prev = i; ++i; if (ctx->cells.find(ctx->id(prev.key().toStdString())) == ctx->cells.end()) { - /* if (treeWidget->currentItem() == prev.value()) - treeWidget->setCurrentItem(cells_root); - if (highlightSelected.contains(prev.value())) - highlightSelected.remove(prev.value());*/ delete prev.value(); nameToItem[4].erase(prev); } |