Interfacing to :qwt_plot_curve.h: void setSamples( const QVector< QPointF >& );
Hi,
I have a QPolygonF of points which I would like to pass to: qwt_plot_curve.h: void setSamples( const QVector< QPointF >& ) however I cannot seem to get the correct syntax:
essential code snippet:
QwtPlotCurve curve;
.
.
QPolygonF points;
.
.
points+=QPointF(xData, yData); // in loop
.
.
curve.setSamples(points);
My problem is that at link time I get the following error:
undefined reference to `QwtPlotCurve::setSamples(QVector<QPointF> const&)'
This is the only linker error all the other Qwt symbols are resolved.
nm shows that the available symbols are:
libqwt.so.6.3.0:000000000010df40 T QwtPlotCurve::setSamples(QList<QPointF> const&)
libqwt.so.6.3.0:000000000010def0 T QwtPlotCurve::setSamples(QwtSeriesData<QPointF>*)
libqwt.so.6.3.0:000000000010e588 T QwtPlotCurve::setSamples(QList<double> const&, QList<double> const&)
libqwt.so.6.3.0:000000000010e850 T QwtPlotCurve::setSamples(QList<double> const&)
libqwt.so.6.3.0:000000000010e990 T QwtPlotCurve::setSamples(float const*, float const*, int)
libqwt.so.6.3.0:000000000010e718 T QwtPlotCurve::setSamples(double const*, int)
libqwt.so.6.3.0:000000000010e8f0 T QwtPlotCurve::setSamples(QList<float> const&)
libqwt.so.6.3.0:000000000010e650 T QwtPlotCurve::setSamples(QList<float> const&, QList<float> const&)
libqwt.so.6.3.0:000000000010ecd8 T QwtPlotCurve::setSamples(float const*, int)
libqwt.so.6.3.0:000000000010e230 T QwtPlotCurve::setSamples(double const*, double const*, int)
Could anyone suggest a way forward, the Qt is version 6.5.2 Qwt is latest from git.
Thanks
Re: Interfacing to :qwt_plot_curve.h: void setSamples( const QVector< QPointF >& )
QList and QVector are the same in Qt6.
See qcontainerfwd.h:
Code:
template<typename T>
using QVector = QList<T>;
HTH,
Uwe
Re: Interfacing to :qwt_plot_curve.h: void setSamples( const QVector< QPointF >& )
Quote:
Originally Posted by
Uwe
QList and QVector are the same in Qt6.
See qcontainerfwd.h:
Code:
template<typename T>
using QVector = QList<T>;
HTH,
Uwe
Thanks I replaced the QPolygonF with QVector<QPointF> but I get the same linker error:
My application is exporting the right unresolved symbol:
myPlotApp.o: U QwtPlotCurve::setSamples(QVector<QPointF> const&)
But the nearest sysmbol in libqwt.so.6.3.0 is:
libqwt.so.6.3.0:000000000010df40 T QwtPlotCurve::setSamples(QList<QPointF> const&)
I wonder if this is a compiler problem not a syntax issue ?
the .o file in the Qwt build directory only refers to QList<QPointF> :
src/obj/qwt_plot_curve.o:0000000000001840 T QwtPlotCurve::setSamples(QList<QPointF> const&)
Re: Interfacing to :qwt_plot_curve.h: void setSamples( const QVector< QPointF >& )
I Think I solved the problem I rebuilt Qt6 and Qwt and my application (in that order) and the issue has gone.
Thanks for the help.