PDA

View Full Version : QwtScaleDraw - Hide Scale before QTime(0,0,0) ?



Maximus2
24th April 2015, 20:26
Hey,

I'm trying to hide the scale so that I don't get this invalid value before 00:00
See image:
https://www.dropbox.com/s/fblzeo5g8dpbwwc/scaleAdjust.png?dl=0

My custom plot is using this QwtScaleDraw:


class TimeScaleDraw: public QwtScaleDraw {
public:
TimeScaleDraw( const QTime &base ):
baseTime( base )
{
}

virtual QwtText label( double v ) const {
QTime upTime = baseTime.addSecs( static_cast<int>( v ) );
return upTime.toString();
}

private:
QTime baseTime;
};

Any help/clues appreciated!
Thanks

Uwe
27th April 2015, 07:38
The scale interval is manually assigned by your code or calculated from the bounding rectangles of the plot items, that have the QwtPlotItem::AutoScale ( usually the curves ).

Uwe

Maximus2
28th April 2015, 13:57
Thanks Uwe,
Have figured it out now ;)

By the way, is there releases notes on the new version 6.1.2 to see different from previous version?
Trying to figure out if it's worth upgrading for me, I'm using qwt-6.1.0
What I'm looking is maybe performance gain on replot() and stuff related to that.