| 91 | } |
| 92 | |
| 93 | void 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 | |
| 109 | qreal Model::nextFunctionValue() |
| 110 | { |
no test coverage detected