aboutsummaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/mainwindow.cc12
-rw-r--r--gui/mainwindow.ui2
2 files changed, 13 insertions, 1 deletions
diff --git a/gui/mainwindow.cc b/gui/mainwindow.cc
index 31ce8fae..c436fd6c 100644
--- a/gui/mainwindow.cc
+++ b/gui/mainwindow.cc
@@ -16,6 +16,18 @@ MainWindow::MainWindow(Design *_design, QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow), design(_design)
{
ui->setupUi(this);
+ ui->treeWidget->setColumnCount(1);
+ ui->treeWidget->setHeaderLabel(QString("Items"));
+ QTreeWidgetItem *belroot = new QTreeWidgetItem(ui->treeWidget);
+ belroot->setText(0, QString("Bels"));
+ ui->treeWidget->insertTopLevelItem(0, belroot);
+ QList<QTreeWidgetItem *> items;
+ for (auto bel : design->chip.getBels()) {
+ auto name = design->chip.getBelName(bel);
+ items.append(new QTreeWidgetItem((QTreeWidget *)nullptr,
+ QStringList(QString(name.c_str()))));
+ }
+ belroot->addChildren(items);
PyImport_ImportModule("emb");
write = [this](std::string s) {
diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui
index 3fe0f400..7352af1f 100644
--- a/gui/mainwindow.ui
+++ b/gui/mainwindow.ui
@@ -64,7 +64,7 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <widget class="QTreeView" name="treeView">
+ <widget class="QTreeWidget" name="treeWidget">
<property name="minimumSize">
<size>
<width>300</width>