MCPcopy Create free account
hub / github.com/collin80/SavvyCAN / foreach

Function foreach

scriptcontainer.cpp:150–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148 QString valu;
149
150 foreach (QString paramName, scriptParams)
151 {
152 valu = scriptEngine->globalObject().property(paramName).toString();
153 qDebug() << paramName << " - " << valu;
154 bool found = false;
155 for (int i = 0; i < widget->rowCount(); i++)
156 {
157 if (widget->item(i, 0) && widget->item(i, 0)->text().compare(paramName) == 0)
158 {
159 found = true;
160 if (!widget->item(i, 1)->isSelected())
161 {
162 widget->item(i,1)->setText(valu);
163 }
164 break;
165 }
166 }
167 if (!found)
168 {
169 int row = widget->rowCount();
170 widget->insertRow(widget->rowCount());
171 QTableWidgetItem *item;
172 item = new QTableWidgetItem();
173 item->setText(paramName);
174 item->setFlags(Qt::ItemIsEnabled);
175 widget->setItem(row, 0, item);
176 item = new QTableWidgetItem();
177 item->setText(valu);
178 widget->setItem(row, 1, item);
179 }
180 }
181}
182
183void ScriptContainer::updateParameter(QString name, QString value)

Callers

nothing calls this directly

Calls 5

itemMethod · 0.80
setTextMethod · 0.80
insertRowMethod · 0.80
rowCountMethod · 0.45
removeTargettedFrameMethod · 0.45

Tested by

no test coverage detected