Hi Friends,
I am using Qwt plugin with Qt4.3.3 with VS2005 in WinXP to design a GUI.I have created a QWidget in Qt, added QwtPlot Widget to it named it testqwtPlot and coded the following files: - Hey pls tell me if this program is right.
---------- graphplot.h----------
#ifndef GRAPHPLOT_H
#define GRAPHPLOT_H
#include <QtGui>
#include <QWidget>
#include "ui_graphplot.h"
#include <qwtplot.h>
using namespace Ui;
class graphplot
: public QWidget,
public Ui_testQwtPlot
{
Q_OBJECT
public:
graphplot
(QWidget *parent
= 0, Qt
::WFlags flags
= 0);
~graphplot();
private:
Ui::graphplotClass ui;
};
#endif
#ifndef GRAPHPLOT_H
#define GRAPHPLOT_H
#include <QtGui>
#include <QWidget>
#include "ui_graphplot.h"
#include <qwtplot.h>
using namespace Ui;
class graphplot : public QWidget, public Ui_testQwtPlot
{
Q_OBJECT
public:
graphplot(QWidget *parent = 0, Qt::WFlags flags = 0);
~graphplot();
private:
Ui::graphplotClass ui;
};
#endif
To copy to clipboard, switch view to plain text mode
-----------graphplot.cpp-------------
#include "graphplot.h"
#include <QtGui>
#include <QWidget>
graphplot
::graphplot(QWidget *parent, Qt
::WFlags flags
){
setupUi( this );
//setupUi(parent);
qwtPlot
->setAxisTitle
(QwtPlot::xBottom,
"Time/seconds");
qwtPlot
->setAxisScale
(QwtPlot::xBottom,
0,
100);
qwtPlot
->setAxisTitle
(QwtPlot::yLeft,
"Values");
qwtPlot
->setAxisScale
(QwtPlot::yLeft,
0,
50);
}
graphplot::~graphplot()
{
}
#include "graphplot.h"
#include <QtGui>
#include <QWidget>
graphplot::graphplot(QWidget *parent, Qt::WFlags flags)
: QWidget(parent, flags)
{
setupUi( this );
//setupUi(parent);
qwtPlot->setAxisTitle(QwtPlot::xBottom, "Time/seconds");
qwtPlot->setAxisScale(QwtPlot::xBottom, 0, 100);
qwtPlot->setAxisTitle(QwtPlot::yLeft, "Values");
qwtPlot->setAxisScale(QwtPlot::yLeft, 0, 50);
}
graphplot::~graphplot()
{
}
To copy to clipboard, switch view to plain text mode
And this is the self generated main.cpp
------------ main.cpp--------------
#include <QtGui/QApplication>
#include "graphplot.h"
int main(int argc, char *argv[])
{
graphplot w;
w.show();
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
return a.exec();
}
#include <QtGui/QApplication>
#include "graphplot.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
graphplot w;
w.show();
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Right now in the above program i am just trying to change only the AxisTitle and Axis Scale. Once this works i will try to plot a simple graph on the qwtplot widget on .ui form. But i get this error
1>c:\qt\4.3.3\qwt\qwt-5.0.2\qwt-5.0.2\examples\graphplot\graphplot\graphplot.h(7) : fatal error C1083: Cannot open include file: 'qwtplot.h': No such file or directory
I even added the include path in the project Properties window. But i still get the error.What are the change's needed in the program for it to work.
I am stuck here for the past 3 dazz pls Help me friend's. !! 
I will be really ThankFull to u guy's.
Regards
Dhee
Bookmarks