Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QDomNamedNodeMap Class Reference
[QtXml module]

The QDomNamedNodeMap class contains a collection of nodes that can be accessed by name. More...

 #include <QDomNamedNodeMap>

Note: All the functions in this class are reentrant.

Public Functions


Detailed Description

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

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

The QDomNamedNodeMap is used in three places:

  1. QDomDocumentType::entities() returns a map of all entities described in the DTD.
  2. QDomDocumentType::notations() returns a map of all notations described in the DTD.
  3. QDomNode::attributes() returns a map of all attributes of an element.

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

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


Member Function Documentation

QDomNamedNodeMap::QDomNamedNodeMap ()

Constructs an empty named node map.

QDomNamedNodeMap::QDomNamedNodeMap ( const QDomNamedNodeMap & n )

Constructs a copy of n.

QDomNamedNodeMap::~QDomNamedNodeMap ()

Destroys the object and frees its resources.

bool QDomNamedNodeMap::contains ( const QString & name ) const

Returns true if the map contains a node called name; otherwise returns false.

int QDomNamedNodeMap::count () const

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

bool QDomNamedNodeMap::isEmpty () const

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

QDomNode QDomNamedNodeMap::item ( int index ) const

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.

See also length().

uint QDomNamedNodeMap::length () const

Returns the number of nodes in the map.

See also item().

QDomNode QDomNamedNodeMap::namedItem ( const QString & name ) const

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().

See also setNamedItem() and namedItemNS().

QDomNode QDomNamedNodeMap::namedItemNS ( const QString & nsURI, const QString & localName ) const

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 is returned.

See also setNamedItemNS() and namedItem().

QDomNode QDomNamedNodeMap::removeNamedItem ( const QString & name )

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.

See also setNamedItem(), namedItem(), and removeNamedItemNS().

QDomNode QDomNamedNodeMap::removeNamedItemNS ( const QString & nsURI, const QString & localName )

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.

See also setNamedItemNS(), namedItemNS(), and removeNamedItem().

QDomNode QDomNamedNodeMap::setNamedItem ( const QDomNode & newNode )

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.

See also namedItem(), removeNamedItem(), and setNamedItemNS().

QDomNode QDomNamedNodeMap::setNamedItemNS ( const QDomNode & newNode )

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.

See also namedItemNS(), removeNamedItemNS(), and setNamedItem().

int QDomNamedNodeMap::size () const

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

bool QDomNamedNodeMap::operator!= ( const QDomNamedNodeMap & n ) const

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

QDomNamedNodeMap & QDomNamedNodeMap::operator= ( const QDomNamedNodeMap & n )

Assigns n to this named node map.

bool QDomNamedNodeMap::operator== ( const QDomNamedNodeMap & n ) const

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

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Comment fermer une application

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.2
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web