Results 1 to 3 of 3

Thread: QwtPointSeriesData what for?

  1. #1
    Join Date
    Feb 2013
    Posts
    10
    Thanks
    5
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default QwtPointSeriesData what for?

    I would like to know what is the benefit of using QwtPointSeriesData class.

    f.e.
    Qt Code:
    1. QwtPointSeriesData mySeriesData;
    2. QwtPlotCurve myCurve;
    3. QVector<QPointF> myVector;
    4.  
    5. /////1
    6. mySeriesData.setSamples(myVector);
    7. QPCruve.setData(mySeriesData);
    8.  
    9. //and
    10. ////2
    11. QPCruve.setSamples(myVector);
    To copy to clipboard, switch view to plain text mode 

    what is the difference between 1 and 2.

  2. #2
    Join Date
    Dec 2012
    Posts
    90
    Thanks
    5
    Thanked 20 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QwtPointSeriesData what for?

    setSamples() is there just for convenience.
    If you look at source code you'll see that it creates new QwtPointSeriesData, just like 1.
    So there is no difference between two methods.

    setData() is for more general case, where data is not necessary a set of points.

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

    Default Re: QwtPointSeriesData what for?

    The idea of QwtPointSeriesData is to avoid, that an application needs to create a copy of the points and implements a bridge to the data instead. This makes a lot of sense, when the way how points are stored depends on other requirements.

    Uwe

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.