! * \brief TextLabelTest::multiLabelEditTextChange * Changing the text of two labels changes the text content and more text related * properties */
| 171 | * properties |
| 172 | */ |
| 173 | void TextLabelTest::multiLabelEditTextChange() { |
| 174 | Project project; |
| 175 | auto* ws = new Worksheet(QStringLiteral("worksheet")); |
| 176 | QVERIFY(ws != nullptr); |
| 177 | project.addChild(ws); |
| 178 | |
| 179 | auto* p = new CartesianPlot(QStringLiteral("plot")); |
| 180 | QVERIFY(p != nullptr); |
| 181 | ws->addChild(p); |
| 182 | |
| 183 | auto* l1 = new TextLabel(QStringLiteral("Label")); |
| 184 | QVERIFY(l1 != nullptr); |
| 185 | l1->setText(QStringLiteral("Text1")); |
| 186 | ws->addChild(l1); |
| 187 | |
| 188 | auto* l2 = new TextLabel(QStringLiteral("Label")); |
| 189 | QVERIFY(l2 != nullptr); |
| 190 | l2->setText(QStringLiteral("Text2")); |
| 191 | ws->addChild(l2); |
| 192 | |
| 193 | LabelWidget w(nullptr); |
| 194 | w.setLabels({l1}); // change only one textlabel |
| 195 | w.fontColorChanged(Qt::red); |
| 196 | w.backgroundColorChanged(Qt::blue); |
| 197 | w.fontSuperScriptChanged(true); |
| 198 | w.fontStrikeOutChanged(true); |
| 199 | w.fontUnderlineChanged(true); |
| 200 | w.fontItalicChanged(true); |
| 201 | w.fontBoldChanged(true); |
| 202 | w.fontChanged(QFont(QStringLiteral("AkrutiTml2"))); |
| 203 | |
| 204 | STORETEXTPROPERTIES(l1, l1InitProperties); |
| 205 | |
| 206 | w.setLabels({l1, l2}); |
| 207 | w.ui.teLabel->setText(QStringLiteral("New text")); |
| 208 | |
| 209 | TextProperties l1p = l1InitProperties; |
| 210 | l1p.plainText = QStringLiteral("New text"); |
| 211 | COMPARETEXTPROPERTIESLABEL(l1, l1p); |
| 212 | COMPARETEXTPROPERTIESLABEL(l2, l1p); // textlabel2 received all properties of the first label, because the text content changes |
| 213 | } |
| 214 | |
| 215 | void TextLabelTest::multiLabelEditColorChangeSelection() { |
| 216 | Project project; |
nothing calls this directly
no test coverage detected