PDA

View Full Version : LayoutDirectoin of QwtScaleDraw



jesse_mark
1st November 2012, 15:03
Hello Guys,

I am drawing a qwtscale on qwtplot, but i need a way to change the layout direction to go from rightToLeft not from leftToRight

so instead of going

- - - -| - - - -| - - - |- - - -| - - - -| - - - >
1 2 3 4 5

i want to be drawn

< - - - -|- - - - |- - - - |- - - - |- - - -| - - -
5 4 3 2 1

I tried to change the layoutDirection of the painter i use to draw the scale but it did not do any thing... i tried to use painter.scale but this will show the numbers flipped too.

Thank you
Jesse

Uwe
2nd November 2012, 07:31
When you assign the axis range explicitely:

plot->setAxisScale( axis, 5, 1 );
or when you are using the autoscaler:

plot->scaleEngine( axis )->setAttribute( QwtScaleEngine::Inverted );
HTH,
Uwe