| 474 | } |
| 475 | |
| 476 | void XYCurve::handleAspectUpdated(const QString& aspectPath, const AbstractAspect* aspect) { |
| 477 | Q_D(XYCurve); |
| 478 | const auto column = dynamic_cast<const AbstractColumn*>(aspect); |
| 479 | if (!column) |
| 480 | return; |
| 481 | |
| 482 | setUndoAware(false); |
| 483 | |
| 484 | if (d->xColumn == column) // the column is the same and was just renamed -> update the column path |
| 485 | d->xColumnPath = aspectPath; |
| 486 | else if (d->xColumnPath == aspectPath) // another column was renamed to the current path -> set and connect to the new column |
| 487 | setXColumn(column); |
| 488 | |
| 489 | if (d->yColumn == column) |
| 490 | d->yColumnPath = aspectPath; |
| 491 | else if (d->yColumnPath == aspectPath) |
| 492 | setYColumn(column); |
| 493 | |
| 494 | if (d->valuesColumn == column) |
| 495 | d->valuesColumnPath = aspectPath; |
| 496 | else if (d->valuesColumnPath == aspectPath) |
| 497 | setValuesColumn(column); |
| 498 | |
| 499 | if (d->valuesColumnPath == aspectPath) |
| 500 | setValuesColumn(column); |
| 501 | |
| 502 | // x errors |
| 503 | if (d->errorBar->xPlusColumn() == column) |
| 504 | d->errorBar->xPlusColumnPath() = aspectPath; |
| 505 | else if (d->errorBar->xPlusColumnPath() == aspectPath) |
| 506 | d->errorBar->setXPlusColumn(column); |
| 507 | |
| 508 | if (d->errorBar->xMinusColumn() == column) |
| 509 | d->errorBar->xMinusColumnPath() = aspectPath; |
| 510 | else if (d->errorBar->xMinusColumnPath() == aspectPath) |
| 511 | d->errorBar->setXMinusColumn(column); |
| 512 | |
| 513 | // y errors |
| 514 | if (d->errorBar->yPlusColumn() == column) |
| 515 | d->errorBar->yPlusColumnPath() = aspectPath; |
| 516 | else if (d->errorBar->yPlusColumnPath() == aspectPath) |
| 517 | d->errorBar->setYPlusColumn(column); |
| 518 | |
| 519 | if (d->errorBar->yMinusColumn() == column) |
| 520 | d->errorBar->yMinusColumnPath() = aspectPath; |
| 521 | else if (d->errorBar->yMinusColumnPath() == aspectPath) |
| 522 | d->errorBar->setYMinusColumn(column); |
| 523 | |
| 524 | setUndoAware(true); |
| 525 | } |
| 526 | |
| 527 | QColor XYCurve::color() const { |
| 528 | Q_D(const XYCurve); |
nothing calls this directly
no test coverage detected