Results 1 to 2 of 2

Thread: how to create a curve in qwtplot?

  1. #1
    Join Date
    Mar 2011
    Posts
    5
    Thanks
    3
    Thanked 1 Time in 1 Post

    Unhappy how to create a curve in qwtplot?

    hello everyone
    I have a problem with using qwtplot.
    I want to put a qwtplot and a pushbutton in mainwindow.when the pushbutton clicked,sine curve comes out.
    I have read several examples.
    but I found that those qwtplot examples have no XXX.ui within.
    I try copy

    QwtPlotCurve *cSin = new QwtPlotCurve("y = sin(x)");
    #if QT_VERSION >= 0x040000
    cSin->setRenderHint(QwtPlotItem::RenderAntialiased);
    #endif
    cSin->setPen(QPen(Qt::red));
    cSin->attach(this);
    const int nPoints = 100;
    cSin->setData(SimpleData(::sin, nPoints));

    in the pushbutton_clicked() ,
    but it shows "error: 'SimpleData' was not declared in this scope"

    can you help me??

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to create a curve in qwtplot?

    Even if you try to implement a Qwt application this is a C++ beginner question and should be asked in such a forum.

    Uwe

Similar Threads

  1. Replies: 3
    Last Post: 29th September 2013, 19:51
  2. How to create a 2d curve editor?
    By vinaym in forum Qwt
    Replies: 1
    Last Post: 4th June 2013, 07:29
  3. Replies: 1
    Last Post: 13th March 2010, 09:55
  4. Replies: 1
    Last Post: 9th December 2009, 18:14
  5. Does Qt have function to create Bézier curve?
    By lni in forum Qt Programming
    Replies: 1
    Last Post: 20th April 2009, 07:22

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.