[PyQt] Help with segfault in PyQt program

Shriramana Sharma samjnaa at gmail.com
Mon Sep 17 20:00:12 BST 2012


Hi thanks for that fix. I had to polish my concepts of what Python
variables are before I could fathom this correctly:
http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#other-languages-have-variables

Anyhow, I have now further developed the program some and added some
formulae which involves stuff like 3*C1 etc but I am getting thrown an
error saying that I cannot multiply an int and a QPointF but curiously
I can multiply a QPointF and int in that order:

>>> from PyQt4.QtCore import QPointF
>>> QPointF(1,1)
PyQt4.QtCore.QPointF(1.0, 1.0)
>>> QPointF(1,1)*2
PyQt4.QtCore.QPointF(2.0, 2.0)
>>> 2*QPointF(1,1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for *: 'int' and 'QPointF'
>>>

Why is this? Thanks.


-- 
Shriramana Sharma


More information about the PyQt mailing list