Changeset View
Changeset View
Standalone View
Standalone View
kmplot/functiontools.cpp
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | |||||
101 | 101 | | |||
102 | void FunctionTools::updateEquationList() | 102 | void FunctionTools::updateEquationList() | ||
103 | { | 103 | { | ||
104 | EquationPair previousEquation = equation(); | 104 | EquationPair previousEquation = equation(); | ||
105 | 105 | | |||
106 | m_widget->list->clear(); | 106 | m_widget->list->clear(); | ||
107 | m_equations.clear(); | 107 | m_equations.clear(); | ||
108 | 108 | | |||
109 | foreach ( Function * function, XParser::self()->m_ufkt ) | 109 | for ( Function * function : qAsConst(XParser::self()->m_ufkt) ) | ||
110 | { | 110 | { | ||
111 | if ( function->type() != Function::Cartesian && function->type() != Function::Differential ) | 111 | if ( function->type() != Function::Cartesian && function->type() != Function::Differential ) | ||
112 | continue; | 112 | continue; | ||
113 | 113 | | |||
114 | QList<Plot> plots = function->plots(); | 114 | QList<Plot> plots = function->plots(); | ||
115 | 115 | | |||
116 | for ( int i = 0; i < function->eq.size(); ++i ) | 116 | for ( int i = 0; i < function->eq.size(); ++i ) | ||
117 | { | 117 | { | ||
118 | foreach ( const Plot &plot, plots ) | 118 | for ( const Plot &plot : qAsConst(plots) ) | ||
119 | m_equations << EquationPair( plot, i ); | 119 | m_equations << EquationPair( plot, i ); | ||
120 | } | 120 | } | ||
121 | } | 121 | } | ||
122 | 122 | | |||
123 | foreach ( const EquationPair &eq, m_equations ) | 123 | for ( const EquationPair &eq : qAsConst(m_equations) ) | ||
124 | { | 124 | { | ||
125 | Equation * equation = eq.first.function()->eq[ eq.second ]; | 125 | Equation * equation = eq.first.function()->eq[ eq.second ]; | ||
126 | QListWidgetItem * item = new QListWidgetItem( equation->fstr(), m_widget->list ); | 126 | QListWidgetItem * item = new QListWidgetItem( equation->fstr(), m_widget->list ); | ||
127 | item->setForeground( eq.first.color() ); | 127 | item->setForeground( eq.first.color() ); | ||
128 | } | 128 | } | ||
129 | 129 | | |||
130 | setEquation( previousEquation ); | 130 | setEquation( previousEquation ); | ||
131 | } | 131 | } | ||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |