• PySide 模块
  • PySide.QtXml
  • 内容表表

    上一话题

    QXmlNamespaceSupport

    下一话题

    QDomNodeList

    QDomNamedNodeMap

    概要

    函数

    详细描述

    PySide.QtXml.QDomNamedNodeMap class contains a collection of nodes that can be accessed by name.

    注意: PySide.QtXml.QDomNamedNodeMap does not inherit from PySide.QtXml.QDomNodeList . QDomNamedNodeMaps do not provide any specific node ordering. Although nodes in a PySide.QtXml.QDomNamedNodeMap may be accessed by an ordinal index, this is simply to allow a convenient enumeration of the contents of a PySide.QtXml.QDomNamedNodeMap , and does not imply that the DOM specifies an ordering of the nodes.

    PySide.QtXml.QDomNamedNodeMap is used in three places:

    Items in the map are identified by the name which QDomNode::name() returns. Nodes are retrieved using PySide.QtXml.QDomNamedNodeMap.namedItem() , PySide.QtXml.QDomNamedNodeMap.namedItemNS() or PySide.QtXml.QDomNamedNodeMap.item() . New nodes are inserted with PySide.QtXml.QDomNamedNodeMap.setNamedItem() or PySide.QtXml.QDomNamedNodeMap.setNamedItemNS() and removed with PySide.QtXml.QDomNamedNodeMap.removeNamedItem() or PySide.QtXml.QDomNamedNodeMap.removeNamedItemNS() 。使用 PySide.QtXml.QDomNamedNodeMap.contains() to see if an item with the given name is in the named node map. The number of items is returned by PySide.QtXml.QDomNamedNodeMap.length() .

    Terminology: in this class we use “item” and “node” interchangeably.

    class PySide.QtXml. QDomNamedNodeMap
    class PySide.QtXml. QDomNamedNodeMap ( arg__1 )
    参数: arg__1 PySide.QtXml.QDomNamedNodeMap

    Constructs an empty named node map.

    构造副本为 n .

    PySide.QtXml.QDomNamedNodeMap. contains ( name )
    参数: name – unicode
    返回类型: PySide.QtCore.bool

    Returns true if the map contains a node called name ;否则返回 false。

    注意

    This function does not take the presence of namespaces into account. Use PySide.QtXml.QDomNamedNodeMap.namedItemNS() to test whether the map contains a node with a specific namespace URI and name.

    PySide.QtXml.QDomNamedNodeMap. count ( )
    返回类型: PySide.QtCore.int

    This function is provided for Qt API consistency. It is equivalent to PySide.QtXml.QDomNamedNodeMap.length() .

    PySide.QtXml.QDomNamedNodeMap. isEmpty ( )
    返回类型: PySide.QtCore.bool

    Returns true if the map is empty; otherwise returns false. This function is provided for Qt API consistency.

    PySide.QtXml.QDomNamedNodeMap. item ( index )
    参数: index PySide.QtCore.int
    返回类型: PySide.QtXml.QDomNode

    Retrieves the node at position index .

    This can be used to iterate over the map. Note that the nodes in the map are ordered arbitrarily.

    PySide.QtXml.QDomNamedNodeMap. length ( )
    返回类型: PySide.QtCore.uint

    Returns the number of nodes in the map.

    PySide.QtXml.QDomNamedNodeMap. namedItem ( name )
    参数: name – unicode
    返回类型: PySide.QtXml.QDomNode

    Returns the node called name .

    If the named node map does not contain such a node, a null node is returned. A node's name is the name returned by QDomNode.nodeName() .

    PySide.QtXml.QDomNamedNodeMap. namedItemNS ( nsURI , localName )
    参数:
    • nsURI – unicode
    • localName – unicode
    返回类型:

    PySide.QtXml.QDomNode

    Returns the node associated with the local name localName and the namespace URI nsURI .

    If the map does not contain such a node, a null node 被返回。

    PySide.QtXml.QDomNamedNodeMap. __ne__ ( arg__1 )
    参数: arg__1 PySide.QtXml.QDomNamedNodeMap
    返回类型: PySide.QtCore.bool

    Returns true if n and this named node map are not equal; otherwise returns false.

    PySide.QtXml.QDomNamedNodeMap. __eq__ ( arg__1 )
    参数: arg__1 PySide.QtXml.QDomNamedNodeMap
    返回类型: PySide.QtCore.bool

    Returns true if n and this named node map are equal; otherwise returns false.

    PySide.QtXml.QDomNamedNodeMap. removeNamedItem ( name )
    参数: name – unicode
    返回类型: PySide.QtXml.QDomNode

    Removes the node called name from the map.

    The function returns the removed node or a null node if the map did not contain a node called name .

    PySide.QtXml.QDomNamedNodeMap. removeNamedItemNS ( nsURI , localName )
    参数:
    • nsURI – unicode
    • localName – unicode
    返回类型:

    PySide.QtXml.QDomNode

    Removes the node with the local name localName and the namespace URI nsURI from the map.

    The function returns the removed node or a null node if the map did not contain a node with the local name localName and the namespace URI nsURI .

    PySide.QtXml.QDomNamedNodeMap. setNamedItem ( newNode )
    参数: newNode PySide.QtXml.QDomNode
    返回类型: PySide.QtXml.QDomNode

    Inserts the node newNode into the named node map. The name used by the map is the node name of newNode as returned by QDomNode.nodeName() .

    If the new node replaces an existing node, i.e. the map contains a node with the same name, the replaced node is returned.

    PySide.QtXml.QDomNamedNodeMap. setNamedItemNS ( newNode )
    参数: newNode PySide.QtXml.QDomNode
    返回类型: PySide.QtXml.QDomNode

    Inserts the node newNode in the map. If a node with the same namespace URI and the same local name already exists in the map, it is replaced by newNode . If the new node replaces an existing node, the replaced node is returned.

    PySide.QtXml.QDomNamedNodeMap. size ( )
    返回类型: PySide.QtCore.int

    This function is provided for Qt API consistency. It is equivalent to PySide.QtXml.QDomNamedNodeMap.length() .