Strange behavior in PyQt6

Detlev Offenbach detlev at die-offenbachs.de
Sun May 16 19:05:27 BST 2021


Hello,

I am trying to read in an XML file using QXmlStreamReader class. That 
works until the moment I try to get an attribute of an element with

QXmlStreamReader.attributes()

 >>> l=self.attributes()
 >>> l
[<PyQt6.QtCore.QXmlStreamAttribute object at 0x7ff0bb5dc040>]

Note: self is a subclass of QXmlStreamReader.

According to the Qt6 docu this call should return a QXmlStreamAttributes 
instances. However, PyQt6 returns a list and that causes a call like

l.value("attributeName")

to fail. Do I have to scan through this list by myself or is this an 
implementation flaw?

Detlev

-- 
Detlev Offenbach
detlev at die-offenbachs.de



More information about the PyQt mailing list