Results 1 to 2 of 2

Thread: Handling array of QwtPlotCurve dynamically

  1. #1
    Join Date
    Apr 2013
    Posts
    63
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Handling array of QwtPlotCurve dynamically

    All,
    I have a vector of qwtPlotCurve pointers in the main class. I am attaching them to a QwtPlot. I am creating each of the qwtPlotCurve pointer using C++ new operator as required.I may need to remove these curves with new set of curves through the code. Each time the number of curves I need to plot may be different. So I am thinking of deleting all the curve pointers already available in the vector and creating them fresh each time. Is there any memory issues with that approach? Also what is the sequence I need to follow? (do I need to empty data before deleting? Do I need to detach the curve before deleting?, etc.)
    Is there a better way to handle dynamically handling group of curves?

    Thanks in advance

  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: Handling array of QwtPlotCurve dynamically

    Depends on the number of curves and how often the curves are replaced - but usually there is nothing wrong with your approach.

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    mqt (14th July 2014)

Similar Threads

  1. Replies: 8
    Last Post: 9th February 2014, 13:37
  2. Replies: 8
    Last Post: 18th October 2012, 08:23
  3. Replies: 1
    Last Post: 11th May 2012, 09:02
  4. two dimensional array, size determined dynamically
    By feraudyh in forum General Programming
    Replies: 9
    Last Post: 10th June 2010, 04:00
  5. declare an array of QSemaphore and array of slot functions
    By radeberger in forum Qt Programming
    Replies: 11
    Last Post: 2nd May 2010, 14:24

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.