Hi,

I wrote a very simple example to test qwt and recognized that the axisautoscale feature does not work for me so far...
Here is the code:
Qt Code:
  1. class QwtTest : public QMainWindow
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. QwtTest(QWidget *parent = 0, Qt::WFlags flags = 0);
  7. ~QwtTest();
  8.  
  9. protected:
  10. void timerEvent(QTimerEvent * event);
  11.  
  12. private:
  13. Ui::QwtTestClass ui;
  14. double * xData_;
  15. double * yData_;
  16. int dataSize_;
  17. int currXPos_;
  18. int sinPos_;
  19. int scaleFac;
  20. QwtPlotCurve curve_;
  21. static const double pi;
  22. };
  23. const double QwtTest::pi = 3.14159265358979323846264338327950;
  24.  
  25. QwtTest::QwtTest(QWidget *parent, Qt::WFlags flags)
  26. : QMainWindow(parent, flags),
  27. currXPos_(0),
  28. sinPos_(0),
  29. scaleFac(1)
  30. {
  31. ui.setupUi(this);
  32. ui.qwtPlot->setAxisAutoScale(QwtPlot::yLeft);
  33. dataSize_ = 200;
  34.  
  35. xData_ = new double[dataSize_];
  36. yData_ = new double[dataSize_];
  37. for(int i = 0; i < dataSize_; ++i)
  38. {
  39. xData_[i] = double(i);
  40. yData_[i] = sin(2*pi*i/dataSize_);
  41. }
  42. curve_.setRawSamples(xData_, yData_, dataSize_);
  43. curve_.attach(ui.qwtPlot);
  44. ui.qwtPlot->replot();
  45. QObject::startTimer(1000/60);
  46. }
  47.  
  48. QwtTest::~QwtTest()
  49. {
  50. delete[] xData_;
  51. delete[] yData_;
  52. }
  53.  
  54. void QwtTest::timerEvent(QTimerEvent * event)
  55. {
  56. for(int i = 0; i < 5; ++i)
  57. {
  58. yData_[currXPos_] = scaleFac*sin(2*pi*sinPos_/(0.169*dataSize_));
  59. ++sinPos_;
  60. currXPos_ = (currXPos_ + 1) % dataSize_;
  61. }
  62. ++scaleFac;
  63. //ui.qwtPlot->setAxisScale(QwtPlot::yLeft, -1000, 1000);
  64. ui.qwtPlot->replot();
  65. }
To copy to clipboard, switch view to plain text mode 

I draws a sinus, which is getting bigger and bigger, but unfortunately the autoscale is not working, so after short time most parts of the sinus leave the visible area...
Is the problem maybe, that autoscale does not work together with rawSamples?

When I uncomment the line
//ui.qwtPlot->setAxisScale(QwtPlot::yLeft, -1000, 1000);
I can see how the scale changes, but that should be done automaticully...

Thanks for help in advance!