Hello,

I am using QwtScaleWidget in a mainwindow to display color bar. The problem is that the color bar is somehow a little bit longer than the backbone of scalewidget's scaledraw at the bottom, when both of their lower boundaries are exactly the same.

Here is a screenshot: plot.PNG
My code:
Qt Code:
  1. colorbar->setColorBarEnabled(true);
  2. QwtInterval zInterval = ... //The zInterval is [2, 79]
  3.  
  4. QwtLinearColorMap *colormap = ...
  5. colorbar->setColorMap(zInterval, colormap);
  6.  
  7. QwtScaleDiv scaleDiv(zInterval.minValue(), zInterval.maxValue());
  8. QList<double> majorTick;
  9. for (double i = zInterval.minValue(); i <= zInterval.maxValue(); i += gap) { //gap is 8 here
  10. majorTick.append(i);
  11. }
  12. scaleDiv.setTicks(QwtScaleDiv::MajorTick, majorTick);
  13. colorbar->setScaleDiv(scaleDiv);
To copy to clipboard, switch view to plain text mode 

I want to align the bottom of the color bar with the backbone(i.e. the first tick of the scale). Is there any way to do this?

Thanks for your help!