Python Forum
Qestions using futurize and QtCore.Signal
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Qestions using futurize and QtCore.Signal
#1
Hello,

We are porting (at last) our codebase on python 3 but need retrocomp with python 2, thus we are using "future".

I have some questions about future behavior and the Qt Objects. I am surprised that declaring some QtCore.Signal(object) after "from builtins import object" line in a file, do not raise any issue in python 2. From my understanding, it really declares QtSignal(newObject), the one from the future module, isn't it ? I am pushing, to this signal attribute, a class that inherits from QtCore.QObject (So I guess not inheriting from newObject) and it still works like a charm. Does anybody have an explanation about that ?

The thingh is : this code works in *almost* every soft we use our scripts with (Autodesk Maya, SideFX Houdini, Unreal) but fails on Foundry Katana, pointing the above mismatch (newobject / object), and I am trying to understand what can explain the difference. Could a bad future module install on Katana explain that ?

Thanks in advance for any advice !

Best regards,
Sebastien
Reply
#2
FYI:
pyuthon 2 was obsoleted January 1, 2020.
Current version in 3.9.0
Reply
#3
Sure Larz60+

Sadly, we need backward compatibility to keep our tools running on former softs, a good part of our customers are still using Maya which is python 2.7, Unreal which was python 2.7 until last release, katana and houdini which are python 2.7, and we have no decision power on these soft. Maya 2020 was issued in 2019, and our support range goes up to 4 years before, so we are doomed to maintain a 2.7 compat until at least 2023 !
Reply
#4
Here is a feedback about the issue : after investigation, Katana uses PyQt5 while others use PySide2. This makes a difference in signal declaration, as PyQt5 is incompatible with future 'object' type. To make all this world work OK in python 2 & 3, I had to declare a "signalObject" which has a different value if using pyqt('PyQt_PyObject') or pyside ('PyObject') and use it as signal declaration argument.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020