Hi,

I am new to both qt and qwt and I’m facing hell. I need some help in order to understand how to draw and set up a scale in qwt.

My first question concerns the use of Qwt scale draw:

1. Assume I have a set of time strings like 12:33:05 ,12:33:08, 12:33:11, 12:33:14, 12:33:17, 12:33:20. A total of 6. I want to use these as labels for major ticks.

2 .Next, I have a x axis scale set up as : setAxisScale(QwtPlot::xBottom, 0, 60);

3. Somehow qwt automatically divides the scale into 6 major divisions , each of 10 divisions each. This is acceptable for now but how do I change this default behavior in case?

4. Next how do I assign a label to each major tick? I want the time string 12:33:05 to be the label of the first major tick and so on.


my second question relates to the Cpu plot example:

Qt Code:
  1. class TimeScaleDraw: public QwtScaleDraw
  2. {
  3. public:
  4. TimeScaleDraw(const QTime &base):
  5. baseTime(base)
  6. {
  7. }
  8. virtual QwtText label(double v) const
  9. {
  10. QTime upTime = baseTime.addSecs((int)v);
  11. return upTime.toString();
  12. }
  13. private:
  14. QTime baseTime;
  15. };
To copy to clipboard, switch view to plain text mode 

I would like to know which method actually calls the label and passes the parameter v.what exactly is the value of v? and who calls this method? in the example i understand that every second the setRawData is called for each curve.However i would like to know who calls the virtual method label?


Hope you can help me answer these questions.

Thanks,
max.