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