Results 1 to 3 of 3

Thread: Refreshtest example. How to introduce new data in the circularbuffer.

Hybrid View

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

    Default Re: Refreshtest example. How to introduce new data in the circularbuffer.

    Quote Originally Posted by Ethan View Post
    These days I have been trying to use the refreshtest example to plot different data (i.e. not a circular buffer)
    Then write a class for your type of buffer instead of trying to modify a class, that is written for a different use case ( example code ).
    In the end all what your class has to offer is the API how to iterate over the points,

    Uwe

  2. #2
    Join Date
    Jun 2011
    Posts
    26
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default Re: Refreshtest example. How to introduce new data in the circularbuffer.

    Yes, and that is actually what I am trying to do. Can someone explain me what this line of code does?:
    Qt Code:
    1. CircularBuffer *buffer = (CircularBuffer *)d_curve->data();
    To copy to clipboard, switch view to plain text mode 

    I know this is a casting, d_curve is a QwtPlotCurve pointer, and data() backs a QwtSeriesData< QPointF > pointer. On the other hand, CircularBuffer inherits from QwtSeriesData<QPointF>. It seems to me that, somehow, with this casting I can use the CircularBuffer methods with the data pointed by a QwtSeriesData<QPointF> pointer. Is that the main reason of this line of code, if not, which is?

    Regards,

    -E
    Last edited by Ethan; 25th October 2011 at 17:43.

Similar Threads

  1. DockWidgetArea change and layout direction change
    By mstegehu in forum Qt Programming
    Replies: 1
    Last Post: 21st February 2012, 21:24
  2. QTableView with QSqlTableModel - change widget for edit data
    By elektrrrus in forum Qt Programming
    Replies: 3
    Last Post: 24th February 2011, 15:51
  3. Replies: 8
    Last Post: 25th April 2010, 21:19
  4. Replies: 1
    Last Post: 25th January 2010, 10:12
  5. Change database data in the QTabelView
    By sophister in forum Qt Programming
    Replies: 3
    Last Post: 9th April 2009, 16:40

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