MCPcopy Create free account
hub / github.com/KDE/kdevelop / toolViewPointer

Method toolViewPointer

plugins/standardoutputview/tests/test_standardoutputview.cpp:67–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67OutputWidget* StandardOutputViewTest::toolViewPointer(const QString& toolViewTitle)
68{
69 const QList< Sublime::View* > views = m_controller->activeArea()->toolViews();
70 for (const auto* const view : views) {
71 auto* doc = qobject_cast<Sublime::ToolDocument*>(view->document());
72 if (doc && doc->title() == toolViewTitle) {
73 if (auto* const widget = view->widget()) {
74 // cannot use qobject_cast here, test code currently slightly fragile due to
75 // duplicated compilation of OutputWidget, here & loaded plugin
76 // cmp. comment in CMakeLists.txt
77 return dynamic_cast<OutputWidget*>(widget);
78 }
79 }
80 }
81 return nullptr;
82}
83
84void StandardOutputViewTest::testRegisterAndRemoveToolView()
85{

Callers

nothing calls this directly

Calls 4

activeAreaMethod · 0.80
documentMethod · 0.45
titleMethod · 0.45
widgetMethod · 0.45

Tested by

no test coverage detected