Quote Originally Posted by Uwe View Post
These clone/copy methods of Qwt 5.x were a major source for user problems. That's why I have removed most of them and pass pointers instead - like everyone is used to from the Qt API. But why is this a problem if you want to manipulate the color map from application code ?
I have a class which is defined like so:

class ImageData: public QObject, public QwtRasterData
{
...
private:

// We store pointers to a value to use for the color bar
// We need this instead of member variable so that the interactive color bar works

double *_colorMin;
double *_colorMax;
FuncPtr *_colorBarModifier;
};

My GUI changes the values of those pointers.

QwtPlotSpectrogram *spectrogram = new QwtPlotSpectrogram ();
spectrogram->setColorMap (new TransparentLinearColorMap (_colorMap));
spectrogram->setData (image);

image is of type ImageData which is derived from QwtRasterData. _colorMap was connected to the same values of the the min/max. Thus, when the GUI is up and the user is interacting with the color bar and Qwt replots; it is using the current value of those pointers.

Why this no longer works is I have to do this:
spectrogram->setColorMap (new TransparentLinearColorMap (_colorMap));
instead of my previous "spectrogram->setColorMap (_colorMap);" which would make the spectrogram use the same colorMap that the interactive GUI was using. In other words, since spectrogram owns the new'ed colorMap, my GUI is no longer interacting with the right one.

I hope that all makes sense! Anyway, I'm not saying this is the best way of doing this, but maybe I'm missing something easy on either fixing this or a better design?

Quote Originally Posted by Uwe View Post
PS: Right now I'm working to improve the accurancy of the raster item class and to introduce an additional type of raster data for values stored in a matrix. So don't be surpised to find undocumented APIs and ongoing changes.
I look forward to this! Especially if we can have multi-dimensional matrices and easy ways of slicing them.

Joey