Hi Petter, On Sun, Aug 07, 2016 at 12:47:57PM +0200, Petter Reinholdtsen wrote: > Control: tags -1 + help > > We belive we will need help with porting creepy to Qt5. > > I got a tip on #debian-gis that > <URL: https://github.com/qgis/QGIS/blob/master/scripts/2to3 > might > help. It is a script to migrate python code from Qt4 to Qt5.
No, that is a script to port from Python 2 to Python 3. This is also a good thing to do, but has nothing to do with Qt. The biggest difference between PyQt4 and PyQt5 is that the latter only supports the new-style connect syntax. Fortunately creepy seems to be already using it, so your work is much less than it could be. The three main steps then are: 1) There are Python files in creepy/ui/ directory which are generated from .ui files using pyuic4. You need to regenerate them using pyuic5 (available in pyqt5-dev-tools package). 2) There is creepy/components/creepy_resources_compiled.py file which is generated from creepy/include/creepy_resources.qrc file using pyrcc4. You need to regenerate it using pyrcc5 (the same package). 3) In the remaining files, replace PyQt4 imports with PyQt5. Note that the widgets are no longer in QtGui module, but in a separate QtWidgets module. So you need to do some imports replacing i.e.: from PyQt4.QtGui import QWizard → from PyQt5.QtWidgets import QWizard from PyQt4.QtWebKit import QWebView → from PyQt5.QtWebKitWidgets import QWebView Alternatively you can just import all modules from PyQt5.Qt, though maybe that would slow down the import a bit: from PyQt5.Qt import QWizard, QWebView If something does not work after doing all these steps, please write to me and I will try to help you. -- Dmitry Shachnev
signature.asc
Description: PGP signature