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

Method newModel

kdevplatform/sublime/tests/test_aggregatemodel.cpp:34–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34QStandardItemModel * TestAggregateModel::newModel()
35{
36 /*
37 construct the simple model like:
38 cool item
39 item 0
40 item 1
41 item 2
42 item 3
43 */
44
45 auto *model = new QStandardItemModel(this);
46 QStandardItem *parentItem = model->invisibleRootItem();
47
48 auto* item = new QStandardItem(QStringLiteral("cool item"));
49 parentItem->appendRow(item);
50
51 for (int i = 0; i < 4; ++i) {
52 auto* item = new QStandardItem(QStringLiteral("item %0").arg(i));
53 parentItem->appendRow(item);
54 parentItem = item;
55 }
56
57 return model;
58}
59
60
61QTEST_MAIN(TestAggregateModel)

Callers

nothing calls this directly

Calls 1

appendRowMethod · 0.80

Tested by

no test coverage detected