I can't answer your first question, but I can give some recommendations on your data structures.
You need to read up on data structures, and particularly the list of functions supplied by Qt for their containers. QList/QVector provide removeFirst() and append() which will do what you want. If you look at their algorithm complexities it might be as bad as O(n) (http://qt-project.org/doc/qt-5/conta...mic-complexity). For your case, however, a circular buffer would seem to suffice. You can implement this in an array or a circular list and overload QwtPlotCurve::drawCurve. You would keep an index of your most current point and start plotting from there. Insertion time in a circular buffer is O(1). If you use an array instead of a list you also get O(1) random access.
Bookmarks