Hello! Friends,
I am using Qwt plugin with Qt4.3.4 in WinXP to design a GUI. Now i have created a Widget in Qt, added QwtPlot Widget to it named sampleqwtPlot and coded the following files: -

########sampleplot.h##########
Qt Code:
  1. #ifndef SAMPLEPLOT_H
  2. #define SAMPLEPLOT_H
  3.  
  4. #include<QtGui>
  5. #include <qwt_plot.h>
  6. #include <qwt_plot_curve.h>
  7.  
  8. #include "ui_sampleplot.h"
  9.  
  10. const int PLOT_SIZE = 101;
  11.  
  12. class samplePlot : public QWidget, private Ui::sampleForm
  13. {
  14. Q_OBJECT
  15.  
  16. public:
  17. samplePlot(QWidget* parent = 0);
  18.  
  19. private:
  20. // Arrays holding the values.
  21. double xval[PLOT_SIZE];
  22. double yval[PLOT_SIZE];
  23. // Insert new curve
  24. QwtPlotCurve *curve;
  25. };
  26.  
  27. #endif
To copy to clipboard, switch view to plain text mode 

########sampleplot.cpp########
Qt Code:
  1. #include <QtGui>
  2. #include "sampleplot.h"
  3.  
  4. samplePlot::samplePlot( QWidget *parent )
  5. : QWidget( parent )
  6. {
  7. setupUi(this); // this sets up GUI
  8. connect( startPushButton, SIGNAL( clicked() ), this, SLOT( draw_curve() ) );
  9.  
  10. // Axis
  11. sampleqwtPlot->setAxisTitle(QwtPlot::xBottom, "Time/seconds");
  12. sampleqwtPlot->setAxisScale(QwtPlot::xBottom, 0, 100);
  13.  
  14. sampleqwtPlot->setAxisTitle(QwtPlot::yLeft, "Values");
  15. sampleqwtPlot->setAxisScale(QwtPlot::yLeft, 0, 50);
  16.  
  17. // Set curve styles
  18. curve->setPen(QPen(Qt::red));
  19.  
  20. //
  21. // Calculate values
  22. //
  23. for(int i=0;i<PLOT_SIZE;i++)
  24. {
  25. xval[i] = i;
  26. yval[i] = 0.5*i;
  27. }
  28. //
  29. //Assign values to the curve.
  30. //
  31. curve->setData( xval, yval, PLOT_SIZE );
  32. //
  33. //Attach the curve.
  34. //
  35. curve->attach( sampleqwtPlot );
  36. //
  37. // finally, refresh the plot
  38. //
  39. sampleqwtPlot->replot();
  40. }
To copy to clipboard, switch view to plain text mode 

I am able to get the sampleplot.exe file but its not working, like whenever i try to run it, displays error "encountered a problem".

I think i am making a small silly mistake somewhere.

Can anyone please help me out.--> I will be obliged