Results 1 to 20 of 59

Thread: How i can plot result in my GUI ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2011
    Posts
    122
    Thanks
    34
    Platforms
    Windows

    Default plot a curve during compilation

    Hello world,

    i have raed a tutorial which it speak about curve with QWT. In this tutorial i find this example to plot a curve during compilation:


    this is the code:

    Qt Code:
    1. #include <QApplication>
    2. #include <qwt_plot.h>
    3. #include <qwt_plot_curve.h>
    4.  
    5. int main(int argc, char** argv)
    6. {
    7. QApplication app(argc,argv);
    8. QwtPlot myPlot;
    9. QwtPlotCurve myCurve;
    10.  
    11. myCurve.attach(&myPlot);
    12.  
    13. QVector<double> x(5);
    14. QVector<double> y(5);
    15.  
    16. for(int i=0;i<5;i++)
    17. {
    18. x.append((double)i);
    19. y.append((double)(5-i));
    20. }
    21. myCurve.setData(x.data(),y.data(),x.size());
    22.  
    23. myPlot.replot();
    24. myPlot.show();
    25. return app.exec();
    26. }
    To copy to clipboard, switch view to plain text mode 

    this is the error:

    ==> see attached file

    i don't why arguments are not good...

    how i can plot this curve please?

    thank you for your help

    (the help of QWT is very difficult for my, i am a real beginner, it is the reason why i ask this)
    Attached Images Attached Images

Similar Threads

  1. QRegExp - get only last result
    By kabanek in forum Newbie
    Replies: 2
    Last Post: 3rd November 2010, 22:17
  2. How to display result
    By sksingh73 in forum Newbie
    Replies: 1
    Last Post: 7th June 2010, 08:39
  3. QSqlQuery return result
    By arpspatel in forum Qt Programming
    Replies: 2
    Last Post: 9th April 2010, 07:55
  4. Result of DBUS call
    By conexion2000 in forum Qt Programming
    Replies: 4
    Last Post: 28th July 2009, 08:34
  5. Replies: 7
    Last Post: 22nd September 2008, 22:05

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.