Gui: [skip ci] improve search function in parameter editor to jump from one top-level item to the sibling item

This commit is contained in:
wmayer
2020-03-16 17:19:53 +01:00
parent a2ee671ad7
commit a7b4b11d9d

View File

@@ -250,6 +250,13 @@ void DlgParameterFind::accept()
while (!next && current) {
// go to the parent item and try again for each sibling after the current item
QTreeWidgetItem* parent = current->parent();
if (!parent) {
// switch from one top-level group to the next
QTreeWidgetItem* root = groupTree->invisibleRootItem();
if (root->indexOfChild(current) >= 0) {
parent = root;
}
}
if (parent) {
int index = parent->indexOfChild(current);
for (int i=index+1; i<parent->childCount(); i++) {