[PyQt] Help with segfault in PyQt program
Phil Thompson
phil at riverbankcomputing.com
Wed Sep 19 00:10:59 BST 2012
On Tue, 18 Sep 2012 00:30:12 +0530, Shriramana Sharma <samjnaa at gmail.com>
wrote:
> 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.
The relevant C++ operator wasn't wrapped for some reason. Fixed in
tonight's snapshot.
Phil
More information about the PyQt
mailing list