[PyKDE] QCanvasView: visibleWidth() and visibleHeight()

Karl myonlyb at vollbio.de
Sat Aug 28 22:40:25 BST 2004


Hi!

I have an inherited QCanvasView with a connected QCanvas.
When initializing, the canvas has some size like 2000x2000. The window with 
the QCanvasView is smaller.
Now, I want to adjust the canvas' size to the visible size of the QCanvasView.

I thought, I could use the visibleWidth() and visibleHeight() methods, so I 
get the values using:
w = self.visibleWidth()
h = self.visibleHeight()

These should return something like 800x600, but I get w=98, h=28.
I also tried contentsWidth() and contentsHeight(), viewport().width() and 
viewport().height(), but none of these methods returns proper values...

How can I get the real visble Width and height, what do I do wrong?

  Tnx
   Karl





More information about the PyQt mailing list