| 442 | |
| 443 | |
| 444 | void AutomatableModel::linkModels( AutomatableModel* model1, AutomatableModel* model2 ) |
| 445 | { |
| 446 | if (!model1->m_linkedModels.contains( model2 ) && model1 != model2) |
| 447 | { |
| 448 | // copy data |
| 449 | model1->m_value = model2->m_value; |
| 450 | if (model1->valueBuffer() && model2->valueBuffer()) |
| 451 | { |
| 452 | std::copy_n(model2->valueBuffer()->data(), |
| 453 | model1->valueBuffer()->length(), |
| 454 | model1->valueBuffer()->data()); |
| 455 | } |
| 456 | // send dataChanged() before linking (because linking will |
| 457 | // connect the two dataChanged() signals) |
| 458 | emit model1->dataChanged(); |
| 459 | // finally: link the models |
| 460 | model1->linkModel( model2 ); |
| 461 | model2->linkModel( model1 ); |
| 462 | } |
| 463 | } |
| 464 | |
| 465 | |
| 466 |
nothing calls this directly
no test coverage detected