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

Method widgetDeletion

kdevplatform/sublime/tests/test_view.cpp:19–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17using namespace Sublime;
18
19void TestView::widgetDeletion()
20{
21 Controller controller;
22 Document *doc = new ToolDocument(QStringLiteral("tool"), &controller, new SimpleToolWidgetFactory<QTextEdit>(QStringLiteral("tool")));
23
24 View *view = doc->createView();
25 //create the widget
26 const auto* const widget = view->initializeWidget(nullptr);
27 QVERIFY(widget);
28 QCOMPARE(view->widget(), widget);
29 QCOMPARE(view->widget()->metaObject()->className(), "QTextEdit");
30
31 //delete the widget and check that view knows about that
32 delete view->widget();
33 QVERIFY(!view->widget());
34}
35
36class Test: public View {
37Q_OBJECT

Callers

nothing calls this directly

Calls 5

metaObjectMethod · 0.80
createViewMethod · 0.45
initializeWidgetMethod · 0.45
widgetMethod · 0.45
classNameMethod · 0.45

Tested by

no test coverage detected