Changeset View
Changeset View
Standalone View
Standalone View
plugins/standardoutputview/tests/test_standardoutputview.cpp
Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Line(s) | 183 | { | |||
---|---|---|---|---|---|
189 | QPointer<QAbstractItemModel> checkModel(model); | 189 | QPointer<QAbstractItemModel> checkModel(model); | ||
190 | QAbstractItemDelegate* delegate = new QItemDelegate; | 190 | QAbstractItemDelegate* delegate = new QItemDelegate; | ||
191 | QPointer<QAbstractItemDelegate> checkDelegate(delegate); | 191 | QPointer<QAbstractItemDelegate> checkDelegate(delegate); | ||
192 | 192 | | |||
193 | outputId[0] = m_stdOutputView->registerOutputInToolView(toolViewId, QStringLiteral("output")); | 193 | outputId[0] = m_stdOutputView->registerOutputInToolView(toolViewId, QStringLiteral("output")); | ||
194 | m_stdOutputView->setModel(outputId[0], model); | 194 | m_stdOutputView->setModel(outputId[0], model); | ||
195 | m_stdOutputView->setDelegate(outputId[0], delegate); | 195 | m_stdOutputView->setDelegate(outputId[0], delegate); | ||
196 | 196 | | |||
197 | QCOMPARE(outputWidget->m_views.value(outputId[0])->model(), model); | 197 | QCOMPARE(outputWidget->m_views.value(outputId[0]).view->model(), model); | ||
198 | QCOMPARE(outputWidget->m_views.value(outputId[0])->itemDelegate(), delegate); | 198 | QCOMPARE(outputWidget->m_views.value(outputId[0]).view->itemDelegate(), delegate); | ||
199 | 199 | | |||
200 | QVERIFY(model->parent()); // they have a parent (the outputdata), so parent() != 0x0 | 200 | QVERIFY(model->parent()); // they have a parent (the outputdata), so parent() != 0x0 | ||
201 | QVERIFY(delegate->parent()); | 201 | QVERIFY(delegate->parent()); | ||
202 | 202 | | |||
203 | m_stdOutputView->removeToolView(toolViewId); | 203 | m_stdOutputView->removeToolView(toolViewId); | ||
204 | QVERIFY(!toolViewPointer(toolViewTitle)); | 204 | QVERIFY(!toolViewPointer(toolViewTitle)); | ||
205 | 205 | | |||
206 | // view deleted, hence model + delegate deleted | 206 | // view deleted, hence model + delegate deleted | ||
Show All 22 Lines |