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
Qt Code:
  1. #include "canvassample.h"
  2. #include <QtGui/QPixmap>
  3.  
  4. CanvasSample::CanvasSample(Q3Canvas *canvas) : Q3CanvasView(canvas)
  5. {
  6. canvas = new Q3Canvas(100,100);
  7. canvas->setBackgroundColor( Qt::black );
  8. canvas->setBackgroundPixmap( QPixmap( "stars.png" ) );
  9. }
  10. CanvasSample::~CanvasSample()
  11. {
  12. }
To copy to clipboard, switch view to plain text mode 

CanvasSample.h
Qt Code:
  1. #ifndef CANVASSAMPLE_H
  2. #define CANVASSAMPLE_H
  3.  
  4. #include <qt/q3canvas.h>
  5.  
  6. class CanvasSample : public Q3CanvasView
  7. {
  8. public:
  9. CanvasSample(Q3Canvas *canvas);
  10. ~CanvasSample();
  11. private:
  12. Q3Canvas *canvas;
  13. };
  14.  
  15.  
  16. #endif
To copy to clipboard, switch view to plain text mode 

Main.cpp
Qt Code:
  1. #include <qapplication.h>
  2. #include <canvassample.h>
  3.  
  4. int main(int argc, char ** argv)
  5. {
  6. QApplication app(argc,argv);
  7.  
  8. Q3Canvas *canvas;
  9. CanvasSample *samp = new CanvasSample(canvas);
  10. samp->show();
  11. return app.exec();
  12. }
To copy to clipboard, switch view to plain text mode