| 335 | } |
| 336 | |
| 337 | QVariant ArgumentsEditor::valueForName(const QString &name, |
| 338 | const QVariant &originalValue, |
| 339 | bool *changed) const |
| 340 | { |
| 341 | QVariant val; |
| 342 | |
| 343 | *changed = false; |
| 344 | |
| 345 | //Handle string arrays specially |
| 346 | if (isVariantStringArray(originalValue)) { |
| 347 | ApiArray array = originalValue.value<ApiArray>(); |
| 348 | return arrayFromEditor(array, changed); |
| 349 | } |
| 350 | |
| 351 | if (!isVariantEditable(originalValue)) { |
| 352 | return originalValue; |
| 353 | } |
| 354 | |
| 355 | for (int topRow = 0; topRow < m_model->rowCount(); ++topRow) { |
| 356 | QModelIndex nameIdx = m_model->index(topRow, 0, QModelIndex()); |
| 357 | QString argName = nameIdx.data().toString(); |
| 358 | /* we display shaders in a separate widget so |
| 359 | * the ordering might be different */ |
| 360 | if (argName == name) { |
| 361 | if (originalValue.userType() == QMetaType::type("ApiArray")) { |
| 362 | ApiArray array = originalValue.value<ApiArray>(); |
| 363 | val = arrayFromIndex(nameIdx, array, changed); |
| 364 | } else { |
| 365 | QModelIndex valIdx = m_model->index(topRow, 1, QModelIndex()); |
| 366 | val = valIdx.data(); |
| 367 | if (val != originalValue) |
| 368 | *changed = true; |
| 369 | } |
| 370 | } |
| 371 | } |
| 372 | return val; |
| 373 | } |
| 374 | |
| 375 | QVariant ArgumentsEditor::arrayFromIndex(const QModelIndex &parentIndex, |
| 376 | const ApiArray &origArray, |
nothing calls this directly
no test coverage detected