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
colorMap.addColorStop(0.25, Qt::cyan);
colorMap.addColorStop(0.75, Qt::yellow);
colorBar->setColorBarEnabled(true);
colorBar
->drawColorBar
(&painter,
QRect(10,
10,
25,
100));
QwtLinearColorMap colorMap(Qt::darkBlue, Qt::red);
colorMap.addColorStop(0.25, Qt::cyan);
colorMap.addColorStop(0.75, Qt::yellow);
QWidget *widget = canvas();
QwtScaleWidget *colorBar = new QwtScaleWidget(widget);
colorBar->setColorMap(QwtDoubleInterval(0, 10), colorMap);
colorBar->setColorBarEnabled(true);
colorBar->drawColorBar(&painter, QRect(10,10, 25, 100));
To copy to clipboard, switch view to plain text mode
Bookmarks