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  · 

QXmlItem Class

The QXmlItem class contains either an XML node or an atomic value. More...

 #include <QXmlItem>

Note: All functions in this class are reentrant.

This class was introduced in Qt 4.4.

Public Types

typedef Iterator

Public Functions

QXmlItem()
QXmlItem(const QXmlItem & other)
QXmlItem(const QXmlNodeModelIndex & node)
QXmlItem(const QVariant & atomicValue)
~QXmlItem()
bool isAtomicValue() const
bool isNode() const
bool isNull() const
QVariant toAtomicValue() const
QXmlNodeModelIndex toNodeModelIndex() const
QXmlItem & operator=(const QXmlItem & other)

Detailed Description

The QXmlItem class contains either an XML node or an atomic value.

In XQuery, all expressions evaluate to a sequence of items, where each item is either an XML node or an atomic value. The query in the following snippet evaluates to sequence of five items.


The five items are: An element, an atomic value (binary data encoded in base64), a date, a float, and an attribute.

QXmlItem is the class that represents these XQuery items in the Qt XML Patterns API. A non-null instance of QXmlItem is either a node or an atomic value. Calling isNode() or isAtomicValue() tells you which it is. Atomic values are represented elsewhere in the Qt API as instances of QVariant, and an instance of QXmlItem that represents an atomic value can be converted to a QVariant by calling toAtomicValue(). A QXmlItem that wraps a node is represented elsewhere as an instance of QXmlNodeModelIndex. A node QXmlItem can be converted to a QXmlNodeModelIndex by calling toNodeModelIndex().

A default constructed QXmlItem instance is neither a node nor an atomic value. It is considered null, in which case isNull() returns true.

An instance of QXmlItem will be left dangling if the XML node model it refers to is deleted, if it is a QXmlNodeModelIndex.

Member Type Documentation

typedef QXmlItem::Iterator

A QAbstractXmlForwardIterator over QXmlItem.

Member Function Documentation

QXmlItem::QXmlItem()

Constructs a null QXmlItem that is neither a node nor an atomic value. isNull() returns true for a default constructed instance.

QXmlItem::QXmlItem(const QXmlItem & other)

The copy constructor constructs a copy of other.

QXmlItem::QXmlItem(const QXmlNodeModelIndex & node)

Constructs a node QXmlItem that is a copy of node.

See also isNode().

QXmlItem::QXmlItem(const QVariant & atomicValue)

Constructs an atomic value QXmlItem with atomicValue.

See also isAtomicValue().

QXmlItem::~QXmlItem()

Destructor.

bool QXmlItem::isAtomicValue() const

Returns true if this item is an atomic value. Returns false if it is a node or null.

See also isNull() and isNode().

bool QXmlItem::isNode() const

Returns true if this item is a Node. Returns false if it is an atomic value or null.

See also isNull() and isAtomicValue().

bool QXmlItem::isNull() const

Returns true if this QXmlItem is neither a node nor an atomic value. Default constructed instances of QXmlItem are null.

QVariant QXmlItem::toAtomicValue() const

If this QXmlItem represents an atomic value, it is converted to an appropriate QVariant and returned. If this QXmlItem is not an atomic value, the return value is a default constructed QVariant. You can call isAtomicValue() to test whether the item is an atomic value.

See also isAtomicValue().

QXmlNodeModelIndex QXmlItem::toNodeModelIndex() const

If this QXmlItem represents a node, it returns the item as a QXmlNodeModelIndex. If this QXmlItem is not a node, the return value is undefined. You can call isNode() to test whether the item is a node.

See also isNode().

QXmlItem & QXmlItem::operator=(const QXmlItem & other)

Assigns other to this.

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 5.0-snapshot
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