PDA

View Full Version : qwtplot program in Qt 4.3.3 with VS2005 not working



dheeraj
28th March 2008, 10:33
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




-----------graphplot.cpp-------------


#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()
{

}


And this is the self generated main.cpp

------------ main.cpp--------------


#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();
}


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. !! :crying:

I will be really ThankFull to u guy's.
Regards
Dhee

Uwe
28th March 2008, 10:59
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
The name of the file is qwt_plot.h.

Uwe

dheeraj
28th March 2008, 17:03
Hi thank You for the reply. That error was cleared. Hey and is this program fine:confused:. Cause i have so many new errors up now. pls tell me the change's i need to do here.So that it works fine.




1>moc_graphplot.cpp
1>c:\qt\4.3.3\qwt\qwt-5.0.2\qwt-5.0.2\examples\graphplot\graphplot\generatedfiles\ release\../../graphplot.h(11) : error C2504: 'qwtPlot' : base class undefined
1>.\GeneratedFiles\Release\moc_graphplot.cpp(52) : error C2061: syntax error : identifier 'qwtPlot'
1>main.cpp
1>c:\qt\4.3.3\qwt\qwt-5.0.2\qwt-5.0.2\examples\graphplot\graphplot\graphplot.h(11) : error C2504: 'qwtPlot' : base class undefined
1>graphplot.cpp
1>c:\qt\4.3.3\qwt\qwt-5.0.2\qwt-5.0.2\examples\graphplot\graphplot\graphplot.h(11) : error C2504: 'qwtPlot' : base class undefined
1>.\graphplot.cpp(9) : error C3861: 'setupUi': identifier not found
1>.\graphplot.cpp(10) : error C2065: 'pane' : undeclared identifier
1>.\graphplot.cpp(10) : error C2227: left of '->setAxisTitle' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>.\graphplot.cpp(11) : error C2227: left of '->setAxisScale' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>.\graphplot.cpp(12) : error C2227: left of '->setAxisTitle' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>.\graphplot.cpp(13) : error C2227: left of '->setAxisScale' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>Generating Code...
1>Build log was saved at "file://c:\Qt\4.3.3\QWT\qwt-5.0.2\qwt-5.0.2\examples\graphplot\graphplot\Release\BuildLo g.htm"
1>graphplot - 10 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Thank You
Regard's