Hi everybody !

I'm testing QCanvas and I have a problem with it, I'm not able to resize it ... or the results doesn't correspond to what I expected to.

So I have a main application that have for the moment a QCanvas and a QCanvasView as member. In the init slot I do this :
Qt Code:
  1. void CanvasMainWindow::init()
  2. {
  3. pCanvas = 0;
  4. pCanvasView = 0;
  5.  
  6. /////////////////////////////////////
  7. // Construction and initialisation of canvas object
  8. //
  9. pCanvas = new QCanvas(this, "myCanvas");
  10. Q_ASSERT( pCanvas );
  11. pCanvas->resize(800, 600);
  12.  
  13.  
  14. /////////////////////////////////////
  15. // Construction and initialisation of canvasview object
  16. //
  17. pCanvasView = new QCanvasView(this, "myCanvasView");
  18. Q_ASSERT( pCanvasView );
  19. pCanvasView->setCanvas(pCanvas);
  20. }
To copy to clipboard, switch view to plain text mode 

It compiles but when I start the application it only shows me my window with the right size but it only contains a small scrolling area which, I suppose, must be my QCanvas view attached to my QCanvas.

Despite I called the resize method of QCanvas, it looks not to be applied because the view is very small ... maybe something like 80x20.

So what is the problem with my code ?

Thanks in advance.