I would like to make a QList of QwtPlotCurve s. The reason for this is to be able to remove them later form my QwtPlot. I have the following code:
Qt Code:
QList<QwtPlotCurve> myList = new QList<QwtPlotCurve>; curves->append(curve1); curves->append(curve2);To copy to clipboard, switch view to plain text mode
The code doesn't compile and the compiler outputs:
error: conversion from 'QList' to non-scalar type 'QList' requested
error: no matching function for call to 'QList::append(QwtPlotCurve&)' void QList::append(const T&) [with T = QwtPlotCurve]
note: candidates are:
note: void QList::append(const T&) [with T = QwtPlotCurve]
note: no known conversion for argument 1 from 'QwtPlotCurve*' to 'const QwtPlotCurve&'
note: void QList::append(const QList&) [with T = QwtPlotCurve]
note: no known conversion for argument 1 from 'QwtPlotCurve*' to 'const QList&'
...
It says the QwtPlotCurve should be constant, but I don't know how to deal with it. I don't know neither whether storing curves in a QList and then removing it (on user demand) from the plot is the right approach.
Bookmarks