| 615 | } |
| 616 | |
| 617 | void RetransformTest::TestCopyPastePlot() { |
| 618 | Project project; |
| 619 | auto* ws = new Worksheet(QStringLiteral("Worksheet")); |
| 620 | QVERIFY(ws != nullptr); |
| 621 | project.addChild(ws); |
| 622 | |
| 623 | auto* p = new CartesianPlot(QStringLiteral("plot")); |
| 624 | p->setType(CartesianPlot::Type::TwoAxes); // Otherwise no axis are created |
| 625 | QVERIFY(p != nullptr); |
| 626 | ws->addChild(p); |
| 627 | |
| 628 | auto* ws2 = new Worksheet(QStringLiteral("Worksheet2")); |
| 629 | QVERIFY(ws2 != nullptr); |
| 630 | project.addChild(ws2); |
| 631 | |
| 632 | RetransformCallCounter c; |
| 633 | |
| 634 | p->copy(); |
| 635 | ws2->paste(true); |
| 636 | |
| 637 | auto plots = ws2->children(AspectType::CartesianPlot); |
| 638 | QCOMPARE(plots.count(), 1); |
| 639 | |
| 640 | // Check that the plot was retransformed after pasting |
| 641 | QCOMPARE(c.callCount(plots.at(0)), 1); |
| 642 | } |
| 643 | |
| 644 | void RetransformTest::TestAddCurve() { |
| 645 | Project project; |