aboutsummaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/basewindow.cc5
-rw-r--r--gui/treemodel.cc12
-rw-r--r--gui/treemodel.h2
3 files changed, 11 insertions, 8 deletions
diff --git a/gui/basewindow.cc b/gui/basewindow.cc
index 6d5e97f5..685a205f 100644
--- a/gui/basewindow.cc
+++ b/gui/basewindow.cc
@@ -77,8 +77,9 @@ BaseMainWindow::BaseMainWindow(std::unique_ptr<Context> context, QWidget *parent
connect(centralTabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
fpgaView = new FPGAViewWidget();
- centralTabWidget->addTab(fpgaView, "Graphics");
- centralTabWidget->tabBar()->tabButton(0, QTabBar::RightSide)->resize(0, 0);
+ centralTabWidget->addTab(fpgaView, "Device");
+ centralTabWidget->tabBar()->setTabButton(0, QTabBar::RightSide, 0);
+ centralTabWidget->tabBar()->setTabButton(0, QTabBar::LeftSide, 0);
connect(this, SIGNAL(contextChanged(Context *)), fpgaView, SLOT(newContext(Context *)));
connect(designview, SIGNAL(selected(std::vector<DecalXY>, bool)), fpgaView,
diff --git a/gui/treemodel.cc b/gui/treemodel.cc
index 900d5101..33dd6a96 100644
--- a/gui/treemodel.cc
+++ b/gui/treemodel.cc
@@ -70,12 +70,14 @@ void IdStringList::updateElements(Context *ctx, std::vector<IdString> elements)
}
// For any elements that are in managed_ but not in new, delete them.
- for (auto &pair : managed_) {
- if (element_set.count(pair.first) != 0) {
- continue;
+ auto it = managed_.begin();
+ while (it != managed_.end()) {
+ if (element_set.count(it->first) != 0) {
+ ++it;
+ } else {
+ it = managed_.erase(it);
+ changed = true;
}
- managed_.erase(pair.first);
- changed = true;
}
// Return early if there are no changes.
diff --git a/gui/treemodel.h b/gui/treemodel.h
index c3f9fe88..0236a715 100644
--- a/gui/treemodel.h
+++ b/gui/treemodel.h
@@ -102,7 +102,7 @@ class Item
virtual bool canFetchMore() const { return false; }
virtual void fetchMore() {}
- ~Item()
+ virtual ~Item()
{
if (parent_ != nullptr) {
parent_->deleteChild(this);