Results 1 to 13 of 13

Thread: QwtRasterData and values

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: QwtRasterData and values

    The map is somewhere allocated in your application code. It's up to the application code to take care of its lifetime. Also check the indices before accessing your map and double arrays - without setting the bounding rect you can be sure to see requests for positions you don't have.

    Note, that SpectrogramData::value() is called very often ( for each pixel of your plot canvas: width * height ). So better don't use a QMap. Returning a rasterHint should be useful as well.

    Uwe

  2. #2
    Join Date
    Dec 2009
    Posts
    24
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QwtRasterData and values

    Quote Originally Posted by Uwe View Post
    The map is somewhere allocated in your application code. It's up to the application code to take care of its lifetime.
    Yes it is created outside the code, I cant afford copying it around, it can be big, and there's several of them...RAM usage could quickly explode...

    Quote Originally Posted by Uwe View Post
    Also check the indices before accessing your map and double arrays - without setting the bounding rect you can be sure to see requests for positions you don't have.
    Yes turns out it was just that, a position request was outside the boundaries of my map...

    Quote Originally Posted by Uwe View Post
    Note, that SpectrogramData::value() is called very often ( for each pixel of your plot canvas: width * height ). So better don't use a QMap. Returning a rasterHint should be useful as well.
    Uwe
    I know, but QMap is just very convenient in my case, i have series of vectors (double) keyed by integers that are not linearly increasing....
    QHash would be probably a bit faster, is that what you were thinking about or even going further than that by using a more low level container... like a long flatten array for example?

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.