MCPcopy Create free account
hub / github.com/KDE/labplot / groupChanged

Method groupChanged

src/frontend/widgets/ConstantsWidget.cpp:67–80  ·  view source on GitHub ↗

! * shows all constants of the selected group and selects the first one in the QStringList */

Source from the content-addressed store, hash-verified

65 * shows all constants of the selected group and selects the first one in the QStringList
66 */
67void ConstantsWidget::groupChanged(int index) {
68 static const QStringList& constants = m_expressionParser->constants();
69 static const QStringList& names = m_expressionParser->constantsNames();
70 static const QVector<Parsing::ConstantGroups>& indices = m_expressionParser->constantsGroupIndices();
71
72 const auto group = static_cast<Parsing::ConstantGroups>(ui.cbGroup->itemData(index).toInt());
73
74 ui.lwConstants->clear();
75 for (int i = 0; i < names.size(); ++i) {
76 if (indices.at(i) == group)
77 ui.lwConstants->addItem(names.at(i) + QStringLiteral(" (") + constants.at(i) + QStringLiteral(")"));
78 }
79 ui.lwConstants->setCurrentRow(0);
80}
81
82void ConstantsWidget::filterChanged(const QString& filter) {
83 if (!filter.isEmpty()) {

Callers 1

ConstantsWidgetMethod · 0.95

Calls 2

clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected