I'm currently exploring QColorMap as a way to implement a spectrogram, but I think my question may be relevant for anyone looking to use QColorMap to generate dynamic colorMaps.

When I update my data, I only, really, update one row of the data, and everything else drops down a row. Currently, for other reasons, I already keep this data in a buffer that behaves as one might intend here. When I go to plot the data, for each new row of data, I must call 'setCell' for every piece of data in my buffer to copy it into the buffer held by QColorMapData.

It would be nice to be able to inject some buffer (by reference or shared_ptr) with some simple API like:

int keySize() const;
void setKeySize(int);

int valueSize() const;
void setValueSize(int);

QCPRange dataBounds() const;

double cell(int key, int value) const;
void setCell(int key, int value, double z);

where QColorMapData could then use these API calls to directly retrieve information about the size of the buffer and the value at any cell within the buffer, skipping all the additional copying of data and letting me optimize how I write to that buffer for the needs I have.

I am currently working on a variation of this idea with the qcustomplot files in my project, but I can imagine this might be useful more generally as well.