MCPcopy Create free account
hub / github.com/KDAB/KDChart / appendPoints

Method appendPoints

examples/Plotter/BigDataset/Model.cpp:93–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void Model::appendPoints(int numPoints)
94{
95 Q_ASSERT(numPoints >= 1);
96 beginInsertRows(QModelIndex(), m_data.count(), m_data.count() + numPoints - 1);
97
98 for (int i = 0; i < numPoints; i++) {
99 m_data.append(nextFunctionValue());
100 }
101
102 QElapsedTimer stopWatch;
103 stopWatch.start();
104 endInsertRows(); // this immediately triggers the signals that cause the diagram to update
105 qDebug() << "Adding" << numPoints << "data points to the existing" << m_data.count() - numPoints
106 << "took" << stopWatch.elapsed() << "milliseconds";
107}
108
109qreal Model::nextFunctionValue()
110{

Callers 1

Calls 2

QModelIndexClass · 0.50
startMethod · 0.45

Tested by

no test coverage detected