Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ChartModel::appendData(QList<double> graphAttributes)
- {
- int vecSize = vec_.size();
- // limit reached, remove first row and append new row
- if (vecSize == 100) {
- beginRemoveRows(QModelIndex(), 0, 1);
- vec_.removeAt(0);
- vecSize = vec_.size();
- endRemoveRows();
- }
- beginInsertRows(QModelIndex(), vecSize, vecSize+1);
- double xVal = vec_.size();
- QList<double> coordinates = {xVal, graphAttributes.at(0), graphAttributes.at(1)};
- qDebug() << coordinates;
- vec_.push_back(coordinates);
- endInsertRows();
- }
Add Comment
Please, Sign In to add comment