aboutsummaryrefslogtreecommitdiffstats
path: root/gui/treemodel.cc
diff options
context:
space:
mode:
authorSergiusz Bazanski <q3k@q3k.org>2018-08-01 00:46:22 +0100
committerSergiusz Bazanski <q3k@q3k.org>2018-08-01 00:46:22 +0100
commitc8cf0bbc0542635101d3b5d4e5553e0ddd4ee7c6 (patch)
treeef8c4cd1ddcc148f2513b1d0173ba3f4efedde2b /gui/treemodel.cc
parent6241052e115695e7f47029a7e2058607dfe20e07 (diff)
downloadnextpnr-c8cf0bbc0542635101d3b5d4e5553e0ddd4ee7c6.tar.gz
nextpnr-c8cf0bbc0542635101d3b5d4e5553e0ddd4ee7c6.tar.bz2
nextpnr-c8cf0bbc0542635101d3b5d4e5553e0ddd4ee7c6.zip
gui: make new tree model clickable
Diffstat (limited to 'gui/treemodel.cc')
-rw-r--r--gui/treemodel.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/gui/treemodel.cc b/gui/treemodel.cc
index fd3ae45b..c3accd9a 100644
--- a/gui/treemodel.cc
+++ b/gui/treemodel.cc
@@ -24,7 +24,7 @@ NEXTPNR_NAMESPACE_BEGIN
ContextTreeModel::ContextTreeModel(QObject *parent) :
QAbstractItemModel(parent),
- root_(new StaticTreeItem("Elements", nullptr)) {}
+ root_(new StaticTreeItem("Elements", nullptr, ElementType::NONE)) {}
ContextTreeModel::~ContextTreeModel() {}
@@ -47,7 +47,7 @@ void ContextTreeModel::loadContext(Context *ctx)
belMap[std::pair<int, int>(loc.x, loc.y)].push_back(bel);
}
auto belGetter = [](Context *ctx, BelId id) { return ctx->getBelName(id); };
- bel_root_ = std::unique_ptr<BelXYRoot>(new BelXYRoot(ctx, "Bels", root_.get(), belMap, belGetter));
+ bel_root_ = std::unique_ptr<BelXYRoot>(new BelXYRoot(ctx, "Bels", root_.get(), belMap, belGetter, ElementType::BEL));
std::map<std::pair<int, int>, std::vector<WireId>> wireMap;
for (int i = 0; i < ctx->chip_info->num_wires; i++) {
@@ -57,7 +57,7 @@ void ContextTreeModel::loadContext(Context *ctx)
wireMap[std::pair<int, int>(wire->x, wire->y)].push_back(wireid);
}
auto wireGetter = [](Context *ctx, WireId id) { return ctx->getWireName(id); };
- wire_root_ = std::unique_ptr<WireXYRoot>(new WireXYRoot(ctx, "Wires", root_.get(), wireMap, wireGetter));
+ wire_root_ = std::unique_ptr<WireXYRoot>(new WireXYRoot(ctx, "Wires", root_.get(), wireMap, wireGetter, ElementType::WIRE));
std::map<std::pair<int, int>, std::vector<PipId>> pipMap;
for (int i = 0; i < ctx->chip_info->num_pips; i++) {
@@ -68,12 +68,12 @@ void ContextTreeModel::loadContext(Context *ctx)
}
printf("generating pip static tree...\n");
auto pipGetter = [](Context *ctx, PipId id) { return ctx->getPipName(id); };
- pip_root_ = std::unique_ptr<PipXYRoot>(new PipXYRoot(ctx, "Pips", root_.get(), pipMap, pipGetter));
+ pip_root_ = std::unique_ptr<PipXYRoot>(new PipXYRoot(ctx, "Pips", root_.get(), pipMap, pipGetter, ElementType::PIP));
}
#endif
- cell_root_ = std::unique_ptr<IdStringList>(new IdStringList(QString("Cells"), root_.get()));
- net_root_ = std::unique_ptr<IdStringList>(new IdStringList(QString("Nets"), root_.get()));
+ cell_root_ = std::unique_ptr<IdStringList>(new IdStringList(QString("Cells"), root_.get(), ElementType::CELL));
+ net_root_ = std::unique_ptr<IdStringList>(new IdStringList(QString("Nets"), root_.get(), ElementType::NET));
endResetModel();