1 Attachment(s)
QwtScaleWidget: problem with drawing a ColorMap
The problem I am having is that whenever I create and then draw a QwtScaleWidget with my defined color map it doesn't render properly. If I give it a range of 0 - 1 it renders fine but when ever I hand it any other range it does not render properly.
I have listed my code below and some sample screenshots.
Thanks for your time,
Jon Jones
Code:
colorMap.addColorStop(0.25, Qt::cyan);
colorMap.addColorStop(0.75, Qt::yellow);
colorBar->setColorBarEnabled(true);
colorBar
->drawColorBar
(&painter,
QRect(10,
10,
25,
100));
Re: QwtScaleWidget: problem with drawing a ColorMap
Assuming you want to use the right axis for your color bar:
Code:
scale->setColorBarEnabled(true);
scale->setColorMap(range, colorMap);
plot
->setAxisScale
(QwtPlot::yRight,
range().minValue(), range().maxValue() );
plot->replot();
The spectrogram example shows a colorbar in the range [0, 10].
Uwe