| 813 | } |
| 814 | |
| 815 | void WorksheetElementTest::prepareDrawingMenu() { |
| 816 | Project project; |
| 817 | auto* ws = new Worksheet(QStringLiteral("Worksheet")); |
| 818 | project.addChild(ws); |
| 819 | |
| 820 | auto* lFirst = new TextLabel(QStringLiteral("first")); |
| 821 | ws->addChild(lFirst); |
| 822 | |
| 823 | auto* lSecond = new TextLabel(QStringLiteral("second")); |
| 824 | ws->addChild(lSecond); |
| 825 | |
| 826 | auto* lThird = new TextLabel(QStringLiteral("third")); |
| 827 | ws->addChild(lThird); |
| 828 | |
| 829 | auto children = ws->children<AbstractAspect>(AbstractAspect::ChildIndexFlag::IncludeHidden); |
| 830 | |
| 831 | // First is background |
| 832 | QCOMPARE(children.at(1)->name(), lFirst->name()); |
| 833 | QCOMPARE(children.at(2)->name(), lSecond->name()); |
| 834 | QCOMPARE(children.at(3)->name(), lThird->name()); |
| 835 | |
| 836 | QAction action; |
| 837 | action.setData(1); |
| 838 | lThird->execMoveBehind(&action); |
| 839 | |
| 840 | children = ws->children<AbstractAspect>(AbstractAspect::ChildIndexFlag::IncludeHidden); |
| 841 | // DEBUG_ELEMENT_NAMES(children); |
| 842 | lThird->createContextMenu(); |
| 843 | lThird->prepareDrawingOrderMenu(); |
| 844 | QCOMPARE(lThird->m_moveBehindMenu->actions().count(), 0); |
| 845 | |
| 846 | QCOMPARE(lThird->m_moveInFrontOfMenu->actions().count(), 2); |
| 847 | } |
| 848 | |
| 849 | void WorksheetElementTest::moveTreeModelInteraction() { |
| 850 | Project project; |
nothing calls this directly
no test coverage detected