[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] Yet another examples fix
From:       Dmitry Shachnev <mitya57 () ubuntu ! com>
Date:       2013-12-06 12:40:28
Message-ID: CAKimPHUJE7iH4xp7QZUsisYsUzFY82u7ZrK2JZqRKzm8POXWAw () mail ! gmail ! com
[Download RAW message or body]

This time for elasticnodes.py:

Traceback (most recent call last):
  File "./graphicsview/elasticnodes.py", line 348, in keyPressEvent
    self.scaleView(1.2)
  File "./graphicsview/elasticnodes.py", line 412, in scaleView
    factor = self.matrix().scale(scaleFactor,
scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width()
AttributeError: 'GraphWidget' object has no attribute 'matrix'

Patch attached.

--
Dmitry Shachnev

["elasticnodes.diff" (text/plain)]

--- a/examples/graphicsview/elasticnodes.py
+++ b/examples/graphicsview/elasticnodes.py
@@ -409,7 +409,7 @@
         painter.drawText(textRect, message)
 
     def scaleView(self, scaleFactor):
-        factor = self.matrix().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width()
+        factor = self.transform().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width()
 
         if factor < 0.07 or factor > 100:
             return


_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic