| 17 | using namespace Sublime; |
| 18 | |
| 19 | void 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 | |
| 36 | class Test: public View { |
| 37 | Q_OBJECT |
nothing calls this directly
no test coverage detected