You have some strange problem. Resizing the canvas makes the canvas bigger. Which part of it is visible has nothing to do with the canvas itself, only with the canvasview size and its world matrix. What exactly do you want to achieve and why?
You have some strange problem. Resizing the canvas makes the canvas bigger. Which part of it is visible has nothing to do with the canvas itself, only with the canvasview size and its world matrix. What exactly do you want to achieve and why?
Originally Posted by wysota
Hi...
Thats my problem.. resizing it is making it bigger than the size i need... I just need 400 X 400 to be seen in the window and the actual canvas to be 1000 X 1000...
Using canvasview's resizeContents() method, i culdnt get the soln... The problem with it is that it does not reduce the canvas size... if the view's size is greater than the canvas size then the scrollbars are added...
Now when i keep view bigger and canvas smaller then the elements are just created on the canvas's size and thus not all are created... the moment i increase it, it goes out of the window...
thats the problem..
Qt Code:
QCanvas *c; QCanvasView *cv; //... c->resize(1000,1000); cv->setFixedSize(400,400);To copy to clipboard, switch view to plain text mode
This will display a bit less than 400x400 (because of the scrollbars).
Kapil (3rd April 2006)
Hi wysota..
Thanks a lot for your help..
Its working out now...
Kapil
Bookmarks