Hi...
I have written a small application using Q3Canvas... i have got a Big List of errors.. i culdnt understand why it was as i have all the header files included and present.
i am pasting the code of the three files... i culdnt understand the error....
CanvasView.cpp
#include "canvassample.h"
#include <QtGui/QPixmap>
CanvasSample::CanvasSample(Q3Canvas *canvas) : Q3CanvasView(canvas)
{
canvas = new Q3Canvas(100,100);
canvas->setBackgroundColor( Qt::black );
canvas
->setBackgroundPixmap
( QPixmap( "stars.png" ) );
}
CanvasSample::~CanvasSample()
{
}
#include "canvassample.h"
#include <QtGui/QPixmap>
CanvasSample::CanvasSample(Q3Canvas *canvas) : Q3CanvasView(canvas)
{
canvas = new Q3Canvas(100,100);
canvas->setBackgroundColor( Qt::black );
canvas->setBackgroundPixmap( QPixmap( "stars.png" ) );
}
CanvasSample::~CanvasSample()
{
}
To copy to clipboard, switch view to plain text mode
CanvasSample.h
#ifndef CANVASSAMPLE_H
#define CANVASSAMPLE_H
#include <qt/q3canvas.h>
class CanvasSample : public Q3CanvasView
{
public:
CanvasSample(Q3Canvas *canvas);
~CanvasSample();
private:
Q3Canvas *canvas;
};
#endif
#ifndef CANVASSAMPLE_H
#define CANVASSAMPLE_H
#include <qt/q3canvas.h>
class CanvasSample : public Q3CanvasView
{
public:
CanvasSample(Q3Canvas *canvas);
~CanvasSample();
private:
Q3Canvas *canvas;
};
#endif
To copy to clipboard, switch view to plain text mode
Main.cpp
#include <qapplication.h>
#include <canvassample.h>
int main(int argc, char ** argv)
{
Q3Canvas *canvas;
CanvasSample *samp = new CanvasSample(canvas);
samp->show();
return app.exec();
}
#include <qapplication.h>
#include <canvassample.h>
int main(int argc, char ** argv)
{
QApplication app(argc,argv);
Q3Canvas *canvas;
CanvasSample *samp = new CanvasSample(canvas);
samp->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks