! * shows all functions of the selected group and selects the first one in the QStringList */
| 77 | * shows all functions of the selected group and selects the first one in the QStringList |
| 78 | */ |
| 79 | void FunctionsWidget::groupChanged(int index) { |
| 80 | const auto d = ui.cbGroup->itemData(index); |
| 81 | if (d.isNull()) |
| 82 | return; // separator selected |
| 83 | |
| 84 | bool ok; |
| 85 | const auto groupIndex = static_cast<Parsing::FunctionGroups>(d.toInt(&ok)); |
| 86 | if (!ok) |
| 87 | return; |
| 88 | |
| 89 | static const QStringList& functions = m_expressionParser->functions(); |
| 90 | static const QStringList& names = m_expressionParser->functionsDescriptions(); |
| 91 | static const QVector<Parsing::FunctionGroups>& indices = m_expressionParser->functionsGroupIndices(); |
| 92 | |
| 93 | QDEBUG(Q_FUNC_INFO << ", index = " << Parsing::FunctionGroupsToString(groupIndex)); |
| 94 | |
| 95 | ui.lwFunctions->clear(); |
| 96 | for (int i = 0; i < names.size(); ++i) { |
| 97 | if (indices.at(i) == groupIndex) |
| 98 | ui.lwFunctions->addItem(names.at(i) + QStringLiteral(" (") + functions.at(i) + QStringLiteral(")")); |
| 99 | } |
| 100 | ui.lwFunctions->setCurrentRow(0); |
| 101 | } |
| 102 | |
| 103 | void FunctionsWidget::filterChanged(const QString& filter) { |
| 104 | if (!filter.isEmpty()) { |
no test coverage detected