Results 1 to 2 of 2

Thread: error: no matching function for call to ‘QwtPlotCurve::setData

  1. #1
    Join Date
    Nov 2010
    Posts
    142
    Thanks
    24
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: error: no matching function for call to ‘QwtPlotCurve::setData

    i am trying to plot a simple curve:
    QwtPlot *myPlot = new QwtPlot(QwtText("a Curves"),0);
    // add curves
    QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
    double x[100], y[100];
    for (int i = 0; i < 100; i++)
    {
    x[i] = 2.777*i;
    y[i] = 0.888*i;
    }
    // copy the data into the curves
    curve1->setData(x,y,100);
    curve1->attach(myPlot);
    myPlot->replot();


    and i get:

    error: no matching function for call to ‘QwtPlotCurve::setData(double [100], double [100], int)’
    /usr/local/qwt-6.0.0-rc5/include/qwt_plot_seriesitem.h:146: candidates are: void QwtPlotSeriesItem<T>::setData(QwtSeriesData<T>*) [with T = QPointF]

    what should i do?


    Added after 48 minutes:


    The "setRawSamples" worked!
    Does anyone know what is the proper usage of setData for this example?!


    double * x1;
    double * y1;
    x1 = new double [100];
    y1 = new double [100];
    // double x1[100], y1[100];

    for (int i = 0; i < 100; i++)
    {
    x1[i] = 2.777*i;
    y1[i] = 0.888/(i+1);
    }

    // copy the data into the curves
    curve1->setRawSamples(x1,y1,5);
    curve1->attach(myPlot);
    myPlot->replot();
    Last edited by fatecasino; 24th November 2010 at 22:41.

  2. #2
    Join Date
    Nov 2010
    Posts
    19
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: error: no matching function for call to ‘QwtPlotCurve::setData

    I guess you should use SetSamples() now

Similar Threads

  1. no matching function for call to setupUi
    By ctote in forum Qt Programming
    Replies: 2
    Last Post: 30th January 2010, 15:20
  2. no matching function error
    By arpspatel in forum Qt Programming
    Replies: 4
    Last Post: 16th October 2009, 15:47
  3. Replies: 7
    Last Post: 16th August 2009, 09:03
  4. No Matching function to call...
    By weepdoo in forum Qt Programming
    Replies: 2
    Last Post: 7th November 2008, 17:30
  5. model/view call setdata() function help?
    By dolphins in forum Qt Programming
    Replies: 1
    Last Post: 19th October 2007, 01:58

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.