Skip to content
Snippets Groups Projects
Commit c43f54fc authored by Alice Russell's avatar Alice Russell
Browse files

Re #27587 Add check to make sure selected item is not a nested group

When getting the function name if a nested group name is selected instead of a function it will return an empty string (the same as it does for top level groups)
parent 01d09104
No related branches found
No related tags found
No related merge requests found
...@@ -172,7 +172,7 @@ SelectFunctionDialog::~SelectFunctionDialog() { delete m_form; } ...@@ -172,7 +172,7 @@ SelectFunctionDialog::~SelectFunctionDialog() { delete m_form; }
QString SelectFunctionDialog::getFunction() const { QString SelectFunctionDialog::getFunction() const {
const auto searchText = m_form->searchBox->currentText(); const auto searchText = m_form->searchBox->currentText();
QList<QTreeWidgetItem *> items(m_form->fitTree->selectedItems()); QList<QTreeWidgetItem *> items(m_form->fitTree->selectedItems());
if (items.size() == 1 && items[0]->parent() != nullptr) { if (items.size() == 1 && items[0]->childCount() == 0) {
return items[0]->text(0); return items[0]->text(0);
} else if (m_form->searchBox->findText(searchText) >= 0) { } else if (m_form->searchBox->findText(searchText) >= 0) {
return searchText; return searchText;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment