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.
This commit is contained in:
2021-08-12 10:10:24 +02:00
parent 946f656885
commit 7552b6f7d6

View File

@@ -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<TraceSelectorTreeItem *>(currentItem->child(i));
if (currentChildItem->isSelected())
{
auto clonedItem = new TraceSelectorTreeItem(*currentChildItem);
selectedTree->addTopLevelItem(clonedItem);
}
}
}
Q_EMIT selectedTree->itemsChanged();