Re: QwtThermo scale update
I need a QwtThermo with a scale with higher resolution. By higher resolution I mean I need more number of minor ticks on the scale. I couldn't find a way to achieve it with the current api. So i subclassed QwtThermo(QwtThermoSubclass) and used QAbstractScale::setScaleEngine() to set a scaleEngine of my own.(NewScaleEngine)
In the NewScaleEngine I basically give the ticksList. I have two variable majorDivision, minorDivisions, and use them to give the tick list.
For the values of majorDivision and minorDivision in constructor of NewScaleEngine, it works alright. When i try to change the variables in the runtime and call the QWidget::update, the scale is not redrawn.
Am i using a wrong method?
Added after 35 minutes:
QAbstractScale::rescale is the answer.
Re: QwtThermo scale update
Quote:
I need a QwtThermo with a scale with higher resolution. By higher resolution I mean I need more number of minor ticks on the scale
Code:
thermo->setScaleMaxMinor( 20 );
Quote:
In the NewScaleEngine I basically give the ticksList.
This is what "QwtAbstractScale::setScale( const QwtScaleDiv & );" does.
5 minutes reading the class API would have saved you a lot of time for writing useless code.
Uwe
Re: QwtThermo scale update
I knew there has to be a easier way out. I did go through the API and always carried the perception that QwtScaleDiv always does the drawing part and it is the QwtScaleEngine gives the ticks list. Maybe I confused QwtScaleDiv with QwtScaleDraw.
What I don't understand is how the scaleDraw is provided with the QwtScaleDiv instance which it uses to draw the ticks? Suppose the QwtScaleDiv is being provided by the QwtScaleEngine using its divideScale function, how and where the QwtScaleDraw gets this instance, for it doesn't call it explicitly.
I know I am getting into control flow of the library, which I as a lib user is a no-go, but it sure does help to know.
Re: QwtThermo scale update
Qwt is open source - check the implementation of QwtAbstractScale.
Uwe
Re: QwtThermo scale update
Hmm.. got it.
I must congratulate you on the good design that your library has. This is slightly off-topic, but could I ask you that how you arrived at such a beautiful design? Was it just the iterations which made it better over time. Or there are some guidelines/books which makes one better. Not that I haven't read a few, but it rarely gives me any mileage.