MCPcopy Create free account
hub / github.com/KDE/labplot / TestCopyPastePlot

Method TestCopyPastePlot

tests/backend/Retransform/RetransformTest.cpp:617–642  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615}
616
617void 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
644void RetransformTest::TestAddCurve() {
645 Project project;

Callers

nothing calls this directly

Calls 7

pasteMethod · 0.80
callCountMethod · 0.80
addChildMethod · 0.45
setTypeMethod · 0.45
copyMethod · 0.45
childrenMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected