PDA

View Full Version : rotate QwtScaleWidget to horizontal



SamuelNLP
14th March 2013, 13:33
How can I rotate the QwtScaleWidget? Sorry for the simplicity of the question but I am not able to do it. :/

raphael.lencrerot
15th March 2013, 10:49
If i understand the question I'm looking for the same thing.
It seems that we can handle scale engine, but I couldn't find a way to make (inv)translation through a rotation/scale/shift matrix.
I don't know if it is possible.

Uwe
15th March 2013, 11:22
Answering for Qwt 6.1 ( for earlier versions it is similar ):

A scale widget might be horizontal or vertical - rotating it to other angles is not supported ( could be done using QwtScaleDraw and QPainter transformations - but not on a QWidget level ). The orientation is set in the constructor of QwtScaleWidget ( QwtScaleDraw::Alignment ) and can't be changed later anymore.

When you want to have a scale from 0.0 -> 100.0 you do "plot->setAxisScale( 0.0, 100.0 )", for an inverted scale simply do "plot->setAxisScale( 100.0, 0.0 );" When you are using the auto scaler and you want to have inverted scales: enable "QwtScaleEngine::Inverted". This is all the same for scales of a plot widget or for the scales of the widgets derived from QwtAbstractScale.

Uwe