PDA

View Full Version : cannot access any QwtPlotCurve instanz



pospiech
14th April 2008, 17:15
I always get the following error


1>QCurvePlot.cpp
1>e:\Daten\Dev\SVN\Laserdynamics\QLaserDynamic\inclu de\qwt\qwt_plot_curve.h(214) : error C2248: "QwtPlotItem::QwtPlotItem": Kein Zugriff auf private Member, dessen Deklaration in der QwtPlotItem-Klasse erfolgte.
1> e:\daten\dev\svn\laserdynamics\qlaserdynamic\inclu de\qwt\qwt_plot_item.h(130): Siehe Deklaration von 'QwtPlotItem::QwtPlotItem'
1> e:\daten\dev\svn\laserdynamics\qlaserdynamic\inclu de\qwt\qwt_plot_item.h(31): Siehe Deklaration von 'QwtPlotItem'
1> Diese Diagnose trat in der vom Compiler generierten Funktion "QwtPlotCurve::QwtPlotCurve(const QwtPlotCurve &)" auf.


If I access/create an new curve using:


public:
vector<QwtPlotCurve> Curve;

void QCurvePlot::addCurve()
{
QwtPlotCurve curve;
Curve.push_back(curve);
}

Uwe
14th April 2008, 19:45
Please don't crosspost.

Uwe

pospiech
14th April 2008, 20:33
Since this is a crosspost (I know one should not...) here the answer from the mailinglist of qwt from Rainer Thaden:


Look at the bottom of
http://qwt.sourceforge.net/qwt__plot__item_8h-source.html
You'll find

private:
// Disabled copy constructor and operator=
QwtPlotItem( const QwtPlotItem & );
QwtPlotItem &operator=( const QwtPlotItem & );



QwtPlotItem is a base class of QwtPlotCurve and doesn't allow to be copied.
Your vector uses copies of the curve. So, you could store pointers of
QwtPlotCurves inside your vector.

vector<QwtPlotCurve*> Curve;


Matthias