MCPcopy Create free account
hub / github.com/QtExcel/QXlsx / testData

Method testData

HelloAndroid/XlsxTableModel.cpp:30–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30void XlsxTableModel::testData()
31{
32 // test code
33
34 // | 1 | 2 | 3 | col.count is 3.
35 // |-------|----|-------|
36 // | Alpha | 10 | 100.0 | row count is 4.
37 // | Beta | 20 | 200.0 |
38 // | Gamma | 30 | 300.0 |
39 // | Delta | 40 | 400.0 |
40
41 // set name of column
42
43 m_colNames.append(QString("COL1"));
44 m_colNames.append(QString("COL2"));
45 m_colNames.append(QString("COL3"));
46
47 m_roleCount = m_colNames.size();
48
49 // set data
50
51 VLIST list1;
52 list1.append(QVariant("Alpha"));
53 list1.append(QVariant(10));
54 list1.append(QVariant(100.0));
55 m_the_data.append(list1);
56
57 VLIST list2;
58 list2.append(QVariant("Beta"));
59 list2.append(QVariant(20));
60 list2.append(QVariant(200.0));
61 m_the_data.append(list2);
62
63 VLIST list3;
64 list3.append(QVariant("Gamma"));
65 list3.append(QVariant(30));
66 list3.append(QVariant(300.0));
67 m_the_data.append(list3);
68
69 VLIST list4;
70 list4.append(QVariant("Delta"));
71 list4.append(QVariant(40));
72 list4.append(QVariant(400.0));
73 m_the_data.append(list4);
74}
75
76int XlsxTableModel::rowCount(const QModelIndex &parent) const
77{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected