| 378 | } |
| 379 | |
| 380 | void ExecutionWindow::showBookmarks() const |
| 381 | { |
| 382 | |
| 383 | auto b_window = new QDialog(); |
| 384 | b_window->setAttribute(Qt::WA_DeleteOnClose); |
| 385 | |
| 386 | auto lo = new QVBoxLayout(b_window); |
| 387 | |
| 388 | auto bm_table = new QTableView(); |
| 389 | |
| 390 | auto bm_model = new QStandardItemModel(0, 2); |
| 391 | QStringList headers{"NodeID", "Bookmark Text"}; |
| 392 | bm_model->setHorizontalHeaderLabels(headers); |
| 393 | bm_table->horizontalHeader()->setStretchLastSection(true); |
| 394 | |
| 395 | bm_table->setModel(bm_model); |
| 396 | |
| 397 | { |
| 398 | const auto &ud = execution_.userData(); |
| 399 | |
| 400 | const auto nodes = ud.bookmarkedNodes(); |
| 401 | |
| 402 | for (const auto n : nodes) |
| 403 | { |
| 404 | auto nid_item = new QStandardItem(QString::number(n)); |
| 405 | auto text = ud.getBookmark(n); |
| 406 | auto text_item = new QStandardItem(text.c_str()); |
| 407 | bm_model->appendRow({nid_item, text_item}); |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | lo->addWidget(bm_table); |
| 412 | |
| 413 | b_window->show(); |
| 414 | |
| 415 | // QTableView |
| 416 | } |
| 417 | |
| 418 | /// TODO: this should only be active when the tree is done building |
| 419 | void ExecutionWindow::removeSelectedNode() |
nothing calls this directly
no test coverage detected