[QGIS-Developer] PyQt QtXmlPatters and QXmlQuery ?
Alessandro Pasotti
apasotti at gmail.com
Tue Sep 29 05:16:11 PDT 2020
On Tue, Sep 29, 2020 at 2:05 PM Richard Duivenvoorde
<rdmailings at duif.net> wrote:
>
> Hi,
>
> Trying to port a plugin here from py2 to py3 the devs have used:
>
> from PyQt4.QtXmlPatterns import QXmlQuery
> then use:
> QXmlQuery(QXmlQuery.XSLT20)
>
> but.. in QGIS3 we tried to get rid of Qt-version dependency, so we encourage to use
> from qgis.PyQt.QtCore import xxxx
> etc
>
> but (looking into my installs and trying in the python console
>
> from qgis.PyQt.QtXmlPatterns import QXmlQuery
> returns me a
> ModuleNotFoundError: No module named 'qgis.PyQt.QtXmlPatterns'
>
> BUT: if I do
>
> from PyQt5.QtXmlPatterns import QXmlQuery
> the class is successfully loaded
>
> Should/Can I include QtXmlPatterns.py here:
>
> https://github.com/qgis/QGIS/tree/master/python/PyQt/PyQt5
>
> without issues? Or am I creating a new dependency then?
>
Hi Richard,
from what I can see here the module has been deprecated since QT 5.13:
https://doc.qt.io/qt-5/qtxmlpatterns-index.html
--
Alessandro Pasotti
QCooperative: www.qcooperative.net
ItOpen: www.itopen.it
More information about the QGIS-Developer
mailing list