Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'number' operators are set up incorrectly #10

Closed
iestynne opened this issue Jan 11, 2013 · 2 comments
Closed

'number' operators are set up incorrectly #10

iestynne opened this issue Jan 11, 2013 · 2 comments

Comments

@iestynne
Copy link

Hi!

Thanks to everyone involved in creating PythonQt, being able to glue Qt/Python/OGL together is an absolute godsend for productivity :)

Anyway, I found an issue and thankfully was able to diagnose the cause. For all 'number' type objects wrapped by PythonQt (e.g QVector3D), the standard operators for '+', '-' an d'' are set up incorrectly - they are set to the 'in-place' versions '+=', '-=' and '=' instead, so for example:

print str( vecA + vecB )

...will actually execute this:

print str( vecA += vecB )

...so the value of vecA will unexpectedly change!

The erroneous code is in initializeSlots() in PythonQtClassWrapper.cpp.

The fix is trivial (just replace an instance of 'nb_add' with 'nb_inplace_add', etc), but I'm not sure what the rules/procedures are for updating the PythonQt code.

FYI I am using the latest code, downloaded from here:

http://sourceforge.net/projects/pythonqt/files/pythonqt/PythonQt-2.1/PythonQt2.1_Qt4.6.2.zip/download

Hope this is helpful!

iestyn

@florianlink
Copy link

This has been fixed in PythonQt on svn trunk a long time ago.

@jcfr
Copy link
Member

jcfr commented Aug 9, 2017

Closing. This has been addressed upstream.

@jcfr jcfr closed this as completed Aug 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants