Actually most of recent distributions support PyQT5:
Debian Jessie
Ubuntu 14.04 and later
Arch linux
Gentoo
Fedora 21 and later
In all our code we already not directly include the PyQT4 module but our own qt module responsible of all the imports this save us the need to patch every files for changing the module.
An annoying point was the move from QtGui to QtWidgets of a lot of element. That’s
why we wrote a script finding all the call to QtGui and checking if the module as not move to QtWidgets. The clean syntax of Python allow us to write a naive script.
It’s very easy with this apply to each line of the file:
After that you need to import also QtWidgets. All our imports was like:
It’s easy to patch it by code:
Thanks to the previous move to Python 3 fixing the call to parent classe was easy because we can replace:
By:
Our script detect the name of parent classes and replace it by super.
Thanks to the script most of our code was working after this. We just need to check
the script behavior by using git diff.
Also when using the app we have detected some issue. You need to know that method deprecated in QT5 are totaly removed in PyQT5. For us it was only a few calls.
Our patch script it’s specific for our code but can be a source of inspiration, if you want to use it you need to replace gns3 by your module. It’s also check if you haven’t a double init call: