Results 1 to 3 of 3

Thread: QwtPlotMultiBarChart with raw data

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QwtPlotMultiBarChart with raw data

    Hello!

    I'ld like to know if there is a equivalent of QwtPlotCurve::setRawData(...) for QwtPlotMultiBarChart, that is, a way of setting the samples to QwtPlotMultiBarChart that don't perform a copy of the original data, but merely points to it (I'm asking because the manual isn't clear enough if all setSamples() perform a copy or not).

    If there isn't, is there a way I could subclass QwtPlotMultiBarChart to create one? And Uwe, could you please add then such method in the next versions of Qwt?


    Thanks,

    Momergil
    May the Lord be with you. Always.

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

    Default Re: QwtPlotMultiBarChart with raw data

    A bar chart with so many values, that avoiding a copy is important ?

    Anyway, QVector - like all Qt containers - is implicitly shared. So there is no real copy until you change one of the "copies" ( copy on write ). Beside that you can always use a QwtSeriesData bridge to your data, so that you are free to store your samples however you like. As Qwt doesn't see behind this bridge you can be sure, that they will never be copied - unless your code does it.

    So it is more the other way round: QwtPlotCurve::setRawData() is legacy code and is only left over for convenience and compatibility. It doesn't offer much value since the very, very first versions of Qwt.

    Uwe

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

    Momergil (14th May 2014)

  4. #3
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QwtPlotMultiBarChart with raw data

    Quote Originally Posted by Uwe View Post
    A bar chart with so many values, that avoiding a copy is important?
    Actually not, but in developing for a embedded context, any processing or memory consumption that can be avoided is considered gain

    Thanks, Uwe, for the reply!


    Momergil
    May the Lord be with you. Always.

Similar Threads

  1. Replies: 0
    Last Post: 25th February 2014, 16:17
  2. Replies: 1
    Last Post: 26th November 2013, 20:25
  3. Stacked Curves - QwtPlotMultiBarChart
    By GG2013 in forum Qwt
    Replies: 2
    Last Post: 13th August 2013, 02:58
  4. Replies: 0
    Last Post: 10th September 2011, 13:38
  5. Corrupt JPEG data: premature end of data segment
    By node_ex in forum Qt Programming
    Replies: 1
    Last Post: 19th August 2008, 08:57

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.