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. #13
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: plot a curve during compilation

    you need some more c++-knowledge, your problems are not qwt-related. the vectors x and y are declared within scope of the loop. you can't access them when you left the loop. have you ever filled an array with a loop?

    in "fonction", you don't need the call "points.clear()" since the vector is empty when you create it. is there any reason for the "sleep(5000)"?

    ok, I'll help you with some code. I suggest to get back to QPolygonF. Then you can return a QPointF in "fonction()" directly. This is more intuitive and you can forget all the QVector stuff you don't need... I'll give you the modified loop and let you adapt "fonction()" by yourself. I'll help you when you can't manage that.

    Qt Code:
    1. QPolygonF polygon;
    2. for(unsigned int i=0; i<10; i++)
    3. polygon << fonction();
    4.  
    5. curve->setSamples(polygon); // maybe you need more parameters...
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to FelixB for this useful post:

    21did21 (1st June 2011)

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
  •  
Qt is a trademark of The Qt Company.