| 735 | } |
| 736 | |
| 737 | void TestAreaOperation::toolDocumentRemoval() |
| 738 | { |
| 739 | MainWindow mw(m_controller); |
| 740 | m_controller->showArea(m_area1, &mw); |
| 741 | m_controller->showArea(m_area2, &mw); |
| 742 | compareAreas1and2(m_area1, m_area2, MainWindowAffinity::SameWindow); |
| 743 | |
| 744 | auto* const toolView = findNamedView(m_area1->toolViews(), "toolview1.2.1"); |
| 745 | RETURN_IF_TEST_FAILED(); |
| 746 | const QPointer viewWidget = toolView->widget(); |
| 747 | QVERIFY(viewWidget); |
| 748 | |
| 749 | // Adapted from KDevelop::UiController::removeToolView(): |
| 750 | auto* const document = toolView->document(); |
| 751 | for (auto* const view : document->views()) { |
| 752 | for (auto* const area : m_controller->allAreas()) { |
| 753 | area->removeToolView(view); |
| 754 | } |
| 755 | } |
| 756 | emit m_controller->toolViewRemoved(document); |
| 757 | |
| 758 | // the tool view widget must be destroyed when its tool view is completely removed |
| 759 | QCOMPARE_EQ(viewWidget, nullptr); |
| 760 | |
| 761 | delete document; |
| 762 | } |
| 763 | |
| 764 | void TestAreaOperation::testAddingViewAfter() |
| 765 | { |
nothing calls this directly
no test coverage detected