QXmlStreamAttributes#
The QXmlStreamAttributes
class represents a vector of QXmlStreamAttribute
. More…
Synopsis#
Functions#
def
append
(l)def
append
(arg__1)def
append
(qualifiedName, value)def
append
(namespaceUri, name, value)def
at
(i)def
back
()def
capacity
()def
clear
()def
constData
()def
constFirst
()def
constLast
()def
count
()def
data
()def
empty
()def
first
(n)def
first
()def
front
()def
hasAttribute
(namespaceUri, name)def
hasAttribute
(qualifiedName)def
insert
(arg__1, arg__2)def
isEmpty
()def
isSharedWith
(other)def
last
()def
last
(n)def
length
()def
mid
(pos[, len=-1])def
move
(from, to)def
__ne__
(arg__1)def
__add__
(l)def
__lshift__
(l)def
__eq__
(arg__1)def
operator[]
(i)def
prepend
(arg__1)def
push_back
(arg__1)def
push_front
(arg__1)def
remove
(i[, n=1])def
removeAll
(arg__1)def
removeAt
(i)def
removeFirst
()def
removeLast
()def
removeOne
(arg__1)def
reserve
(size)def
resize
(size)def
shrink_to_fit
()def
size
()def
sliced
(pos)def
sliced
(pos, n)def
squeeze
()def
swap
(other)def
swapItemsAt
(i, j)def
takeAt
(i)def
toVector
()def
value
(namespaceUri, name)def
value
(qualifiedName)
Static functions#
def
fromVector
(vector)
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
Attributes are returned by a QXmlStreamReader
in attributes()
when the reader reports a start element
. The class can also be used with a QXmlStreamWriter
as an argument to writeAttributes()
.
The convenience function value()
loops over the vector and returns an attribute value for a given namespaceUri and an attribute’s name.
New attributes can be added with append()
.
- class PySide6.QtCore.QXmlStreamAttributes#
A constructor for QXmlStreamAttributes
.
- PySide6.QtCore.QXmlStreamAttributes.append(l)#
- Parameters:
l –
- PySide6.QtCore.QXmlStreamAttributes.append(arg__1)
- Parameters:
arg__1 –
PySide6.QtCore.QXmlStreamAttribute
- PySide6.QtCore.QXmlStreamAttributes.append(qualifiedName, value)
- Parameters:
qualifiedName – str
value – str
This is an overloaded function.
Appends a new attribute with qualified name qualifiedName
and value value
.
- PySide6.QtCore.QXmlStreamAttributes.append(namespaceUri, name, value)
- Parameters:
namespaceUri – str
name – str
value – str
Appends a new attribute with name
in the namespace described with namespaceUri
, and value value
. The namespaceUri
can be empty.
- PySide6.QtCore.QXmlStreamAttributes.at(i)#
- Parameters:
i –
qsizetype
- Return type:
- PySide6.QtCore.QXmlStreamAttributes.back()#
- Return type:
- PySide6.QtCore.QXmlStreamAttributes.capacity()#
- Return type:
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.clear()#
- PySide6.QtCore.QXmlStreamAttributes.constData()#
- Return type:
- PySide6.QtCore.QXmlStreamAttributes.constFirst()#
- Return type:
- PySide6.QtCore.QXmlStreamAttributes.constLast()#
- Return type:
- PySide6.QtCore.QXmlStreamAttributes.count()#
- Return type:
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.data()#
- Return type:
- PySide6.QtCore.QXmlStreamAttributes.empty()#
- Return type:
bool
- PySide6.QtCore.QXmlStreamAttributes.first(n)#
- Parameters:
n –
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.first()
- Return type:
- static PySide6.QtCore.QXmlStreamAttributes.fromVector(vector)#
- Parameters:
vector –
- PySide6.QtCore.QXmlStreamAttributes.front()#
- Return type:
- PySide6.QtCore.QXmlStreamAttributes.hasAttribute(namespaceUri, name)#
- Parameters:
namespaceUri – str
name – str
- Return type:
bool
This is an overloaded function.
Returns true
if this QXmlStreamAttributes
has an attribute whose namespace URI and name correspond to namespaceUri
and name
; otherwise returns false
.
- PySide6.QtCore.QXmlStreamAttributes.hasAttribute(qualifiedName)
- Parameters:
qualifiedName – str
- Return type:
bool
Returns true
if this QXmlStreamAttributes
has an attribute whose qualified name is qualifiedName
; otherwise returns false
.
Note that this is not namespace aware. For instance, if this QXmlStreamAttributes
contains an attribute whose lexical name is “xlink:href” this doesn’t tell that an attribute named href
in the XLink namespace is present, since the xlink
prefix can be bound to any namespace. Use the overload that takes a namespace URI and a local name as parameter, for namespace aware code.
- PySide6.QtCore.QXmlStreamAttributes.insert(arg__1, arg__2)#
- Parameters:
arg__1 –
qsizetype
arg__2 –
PySide6.QtCore.QXmlStreamAttribute
- PySide6.QtCore.QXmlStreamAttributes.isEmpty()#
- Return type:
bool
- Parameters:
other –
- Return type:
bool
- PySide6.QtCore.QXmlStreamAttributes.last()#
- Return type:
- PySide6.QtCore.QXmlStreamAttributes.last(n)
- Parameters:
n –
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.length()#
- Return type:
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.mid(pos[, len=-1])#
- Parameters:
pos –
qsizetype
len –
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.move(from, to)#
- Parameters:
from –
qsizetype
to –
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.__ne__(arg__1)#
- Parameters:
arg__1 –
PySide6.QtCore.QXmlStreamAttributes
- Return type:
bool
- PySide6.QtCore.QXmlStreamAttributes.__add__(l)#
- Parameters:
l –
- PySide6.QtCore.QXmlStreamAttributes.__lshift__(l)#
- Parameters:
l –
- PySide6.QtCore.QXmlStreamAttributes.__eq__(arg__1)#
- Parameters:
arg__1 –
PySide6.QtCore.QXmlStreamAttributes
- Return type:
bool
- PySide6.QtCore.QXmlStreamAttributes.operator[](i)
- Parameters:
i –
qsizetype
- Return type:
- PySide6.QtCore.QXmlStreamAttributes.prepend(arg__1)#
- Parameters:
arg__1 –
PySide6.QtCore.QXmlStreamAttribute
- PySide6.QtCore.QXmlStreamAttributes.push_back(arg__1)#
- Parameters:
arg__1 –
PySide6.QtCore.QXmlStreamAttribute
- PySide6.QtCore.QXmlStreamAttributes.push_front(arg__1)#
- Parameters:
arg__1 –
PySide6.QtCore.QXmlStreamAttribute
- PySide6.QtCore.QXmlStreamAttributes.remove(i[, n=1])#
- Parameters:
i –
qsizetype
n –
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.removeAll(arg__1)#
- Parameters:
arg__1 –
PySide6.QtCore.QXmlStreamAttribute
- PySide6.QtCore.QXmlStreamAttributes.removeAt(i)#
- Parameters:
i –
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.removeFirst()#
- PySide6.QtCore.QXmlStreamAttributes.removeLast()#
- PySide6.QtCore.QXmlStreamAttributes.removeOne(arg__1)#
- Parameters:
arg__1 –
PySide6.QtCore.QXmlStreamAttribute
- PySide6.QtCore.QXmlStreamAttributes.reserve(size)#
- Parameters:
size –
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.resize(size)#
- Parameters:
size –
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.shrink_to_fit()#
- PySide6.QtCore.QXmlStreamAttributes.size()#
- Return type:
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.sliced(pos)#
- Parameters:
pos –
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.sliced(pos, n)
- Parameters:
pos –
qsizetype
n –
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.squeeze()#
- PySide6.QtCore.QXmlStreamAttributes.swap(other)#
- Parameters:
other –
- PySide6.QtCore.QXmlStreamAttributes.swapItemsAt(i, j)#
- Parameters:
i –
qsizetype
j –
qsizetype
- PySide6.QtCore.QXmlStreamAttributes.takeAt(i)#
- Parameters:
i –
qsizetype
- Return type:
- PySide6.QtCore.QXmlStreamAttributes.toVector()#
- PySide6.QtCore.QXmlStreamAttributes.value(namespaceUri, name)#
- Parameters:
namespaceUri – str
name – str
- Return type:
QStringView
Returns the value of the attribute name
in the namespace described with namespaceUri
, or an empty string reference if the attribute is not defined. The namespaceUri
can be empty.
- PySide6.QtCore.QXmlStreamAttributes.value(qualifiedName)
- Parameters:
qualifiedName – str
- Return type:
QStringView
This is an overloaded function.
Returns the value of the attribute with qualified name qualifiedName
, or an empty string reference if the attribute is not defined. A qualified name is the raw name of an attribute in the XML data. It consists of the namespace prefix, followed by colon, followed by the attribute’s local name. Since the namespace prefix is not unique (the same prefix can point to different namespaces and different prefixes can point to the same namespace), you shouldn’t use qualified names, but a resolved namespaceUri and the attribute’s local name.