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

Method addPlot

tests/backend/TextLabel/TextLabelTest.cpp:86–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84 }
85
86void TextLabelTest::addPlot() {
87 Project project;
88 auto* ws = new Worksheet(QStringLiteral("worksheet"));
89 QVERIFY(ws != nullptr);
90 project.addChild(ws);
91
92 auto* p = new CartesianPlot(QStringLiteral("plot"));
93 QVERIFY(p != nullptr);
94 ws->addChild(p);
95
96 auto* l = new TextLabel(QStringLiteral("Label"));
97 QVERIFY(l != nullptr);
98 l->setText(QStringLiteral("TextLabelText"));
99 ws->addChild(l);
100
101 QCOMPARE(l->text().mode, TextLabel::Mode::Text);
102 VERIFYLABELCOLORS(l, Qt::black, Qt::transparent);
103 QCOMPARE(l->fontColor(), Qt::black);
104 QCOMPARE(l->backgroundColor(), QColor(1, 1, 1, 0));
105
106 // add title?
107
108 // add axes?
109 // check axis label
110}
111
112/*!
113 * \brief TextLabelTest::multiLabelEdit

Callers

nothing calls this directly

Calls 6

fontColorMethod · 0.80
backgroundColorMethod · 0.80
QColorClass · 0.50
addChildMethod · 0.45
setTextMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected