[Qgis-developer] master and PyQt5 evolutions...

mederic.ribreux at medspx.fr mederic.ribreux at medspx.fr
Tue Aug 16 11:55:07 PDT 2016


Hello devs,

I would like to know if it is OK to replace the few PyQt4 methods that have been modified in PyQt5 directly into master branch ? The code is not correctly ported with 2to3 because this is a PyQt evolution and not a python3 improvement. 

For example, QFileDialog.getOpenFileName in PyQt5 is the new name of QFileDialog.getOpenFileNameAndFilter in PyQt4 (which returns a tuple and not only a string). There is no getOpenFileNameAndFilter in PyQt5. If I "port" to the PyQt5 method, the code will not work anymore in PyQt4.

Of course, I could make a lib2to3 custom fix class (like in fix_pyqt.py) but it seems to be very complicated (well, for my skills).

I can also test for the current PyQt version directly in the code, before launching a QFileDialog method, but this is not very elegant.

What are the rules for the master branch with not retrocompatible PyQt5 code ?

Cheers,
-- 
Envoyé de mon appareil Android avec K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160816/26e8656e/attachment.html>


More information about the Qgis-developer mailing list