From 7552b6f7d620538456aa3677d48b72b9da6be7d8 Mon Sep 17 00:00:00 2001 From: Derek Christ Date: Thu, 12 Aug 2021 10:10:24 +0200 Subject: [PATCH] Fix a bug in TraceSelector that prevented adding child items with return It's now possible to also add single banks with the return key. --- DRAMSys/traceAnalyzer/presentation/traceselector.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/DRAMSys/traceAnalyzer/presentation/traceselector.cpp b/DRAMSys/traceAnalyzer/presentation/traceselector.cpp index 3d2fd69c..9ca682fb 100644 --- a/DRAMSys/traceAnalyzer/presentation/traceselector.cpp +++ b/DRAMSys/traceAnalyzer/presentation/traceselector.cpp @@ -93,6 +93,18 @@ void TraceAvailableTree::keyPressEvent(QKeyEvent *event) selectedTree->addTopLevelItem(clonedItem); } + + // Also add child items that could be selected. + for (unsigned int i = 0; i < currentItem->childCount(); i++) + { + auto currentChildItem = static_cast(currentItem->child(i)); + + if (currentChildItem->isSelected()) + { + auto clonedItem = new TraceSelectorTreeItem(*currentChildItem); + selectedTree->addTopLevelItem(clonedItem); + } + } } Q_EMIT selectedTree->itemsChanged();