PySide6.QtXml.QDomCharacterData¶
- class QDomCharacterData¶
The
QDomCharacterDataclass represents a generic string in the DOM. More…Inherited by:
QDomText,QDomComment,QDomCDATASectionSynopsis¶
Methods¶
def
__init__()def
appendData()def
data()def
deleteData()def
insertData()def
length()def
replaceData()def
setData()def
substringData()
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¶
Character data as used in XML specifies a generic data string. More specialized versions of this class are
QDomText,QDomCommentandQDomCDATASection.The data string is set with
setData()and retrieved withdata(). You can retrieve a portion of the data string usingsubstringData(). Extra data can be appended withappendData(), or inserted withinsertData(). Portions of the data string can be deleted withdeleteData()or replaced withreplaceData(). The length of the data string is returned bylength().The node type of the node containing this character data is returned by
nodeType().See also
- __init__()¶
Constructs an empty character data object.
- __init__(characterData)
- Parameters:
characterData –
QDomCharacterData
Constructs a copy of
characterData.The data of the copy is shared (shallow copy): modifying one node will also change the other. If you want to make a deep copy, use
cloneNode().- appendData(arg)¶
- Parameters:
arg – str
Appends the string
argto the stored string.- data()¶
- Return type:
str
Returns the string stored in this object.
If the node is a
null node, it will return an empty string.See also
- deleteData(offset, count)¶
- Parameters:
offset – int
count – int
Deletes a substring of length
countfrom positionoffset.- insertData(offset, arg)¶
- Parameters:
offset – int
arg – str
Inserts the string
arginto the stored string at positionoffset.- length()¶
- Return type:
int
Returns the length of the stored string.
- replaceData(offset, count, arg)¶
- Parameters:
offset – int
count – int
arg – str
Replaces the substring of length
countstarting at positionoffsetwith the stringarg.- setData(data)¶
- Parameters:
data – str
Sets this object’s string to
data.See also
- substringData(offset, count)¶
- Parameters:
offset – int
count – int
- Return type:
str
Returns the substring of length
countfrom positionoffset.