Good afternoon !
I am beginner in qt.I have a problem .How connection variable i in function with my spinBox.
This my function :
Qt Code:
  1. void DataPlot::insertCurve(Qt::Orientation o,
  2. const QColor &c, double base)
  3. {
  4. QwtPlotCurve *curve = new QwtPlotCurve();
  5. curve->setPen(QPen(Qt::blue,3));
  6.  
  7.  
  8. double i ;
  9. double x[10];
  10. double y[sizeof(x) / sizeof(x[0])];
  11.  
  12. for ( uint k = 0; k < sizeof(x) / sizeof(x[0]); k++ )
  13. {
  14. double v = i+k * 1.5;
  15. if ( o == Qt::Horizontal )
  16. {
  17. x[k] = v;
  18. y[k] = base;
  19. }
  20. else
  21. {
  22. x[k] = base;
  23. y[k] = v;
  24. }
  25. }
  26.  
  27. curve->setData(x, y, sizeof(x) / sizeof(x[0]));
  28. curve->attach(this);
  29. }
To copy to clipboard, switch view to plain text mode