that's right.

browsing the code I can see that the problem is the orientation, and if I set the right orientation the value are the same:
Qt Code:
  1. //
  2. QwtScaleDiv *sd = new QwtScaleDiv(-60, 0);
  3. QList< double > ld;
  4.  
  5. double q;
  6. for(q=-60.0; q<=0.0; q+=5.0)
  7. ld.append(q);
  8.  
  9. sd->setTicks(QwtScaleDiv::MajorTick, ld);
  10.  
  11. w->setScaleDiv(*sd);
  12.  
  13. qDebug("orient w %d", w->scaleDraw()->orientation()); // here is Qt::Vertical
  14. qDebug("extent 2 %f", w->scaleDraw()->extent(w->font())); // is 31.0
  15.  
  16. QwtScaleDraw *sdraw = new QwtScaleDraw;
  17. sdraw->setScaleDiv(*sd);
  18. qDebug("orient sdraw %d", sdraw->orientation()); // here is Qt:Horizontal
  19. sdraw->setAlignment(QwtScaleDraw::LeftScale); // Change to vertical
  20.  
  21. qDebug("extent 1 %f", sdraw->extent(w->font())); // here is also 31.0
To copy to clipboard, switch view to plain text mode 

best regards
max