Hi,

I want to create a QCanvasView which shows a "zoomed" version of it's Canvas. What I 
tried looked like this:

class ZoomedCanvasView(QCanvasView):
    def __init__(self, canvas, parent):
        QCanvasView.__init__(self, canvas, parent)
        matrix = self.matrix = QWMatrix()
        matrix.scale(2,2)

    def drawContents(self, painter, cx, cy, cw, ch):
        painter.setWorldMatrix(self.matrix)
        QCanvasView.drawContents(self, painter, cx, cy, cw, ch)

Unfortunately this doesn't work, in several ways: First, the last four parameters are 
not always passed, so an exception "Wrong number of arguments" is raised (This usually 
happens only in the first call of drawContents). However, when I change it to 
something like

   def drawContents(*args):
       ...
       apply(QCanvasView.drawContents, args)

another exception, "parameter 2 has wrong type", is raised - but not always. The third 
kind of error is not raising an exception at all, but simply not redrawing the 
CanvasItems properly after they scrolled out of the viewport an in again.

Is this a bug, or am I doing something terribly wrong?

Regards
Henrik Motakef

_______________________________________________________________________
1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de
[EMAIL PROTECTED], 8MB Speicher, Verschluesselung - http://freemail.web.de



_______________________________________________
PyKDE mailing list    [EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde

Reply via email to