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  · 

QSimpleXmlNodeModel Class

The QSimpleXmlNodeModel class is an implementation of QAbstractXmlNodeModel sufficient for many common cases. More...

 #include <QSimpleXmlNodeModel>

Inherits: QAbstractXmlNodeModel.

Note: All functions in this class are reentrant.

This class was introduced in Qt 4.4.

Public Types

typedef List
typedef Ptr
enum SimpleAxis { Parent, FirstChild, PreviousSibling, NextSibling }

Public Functions

QAbstractXmlNodeModel()
QSimpleXmlNodeModel(const QXmlNamePool & namePool)
virtual ~QAbstractXmlNodeModel()
virtual ~QSimpleXmlNodeModel()
virtual QUrl baseUri(const QXmlNodeModelIndex & n) const = 0
virtual QXmlNodeModelIndex::DocumentOrder compareOrder(const QXmlNodeModelIndex & ni1, const QXmlNodeModelIndex & ni2) const = 0
virtual QUrl documentUri(const QXmlNodeModelIndex & n) const = 0
virtual QXmlNodeModelIndex elementById(const QXmlName & id) const = 0
virtual QXmlNodeModelIndex::NodeKind kind(const QXmlNodeModelIndex & ni) const = 0
virtual QXmlName name(const QXmlNodeModelIndex & ni) const = 0
QXmlNamePool & namePool() const
virtual QVector<QXmlName> namespaceBindings(const QXmlNodeModelIndex & n) const = 0
virtual QVector<QXmlNodeModelIndex> nodesByIdref(const QXmlName & idref) const = 0
virtual QXmlNodeModelIndex root(const QXmlNodeModelIndex & n) const = 0
QSourceLocation sourceLocation(const QXmlNodeModelIndex & index) const
virtual QString stringValue(const QXmlNodeModelIndex & n) const = 0
virtual QVariant typedValue(const QXmlNodeModelIndex & node) const = 0

Reimplemented Public Functions

virtual QUrl baseUri(const QXmlNodeModelIndex & node) const
virtual QXmlNodeModelIndex elementById(const QXmlName & id) const
virtual QVector<QXmlName> namespaceBindings(const QXmlNodeModelIndex & node) const
virtual QVector<QXmlNodeModelIndex> nodesByIdref(const QXmlName & idref) const
virtual QString stringValue(const QXmlNodeModelIndex & node) const

Protected Functions

virtual QVector<QXmlNodeModelIndex> attributes(const QXmlNodeModelIndex & element) const = 0
QXmlNodeModelIndex createIndex(qint64 data) const
QXmlNodeModelIndex createIndex(void * pointer, qint64 additionalData = 0) const
QXmlNodeModelIndex createIndex(qint64 data, qint64 additionalData) const
virtual QXmlNodeModelIndex nextFromSimpleAxis(SimpleAxis axis, const QXmlNodeModelIndex & origin) const = 0

Detailed Description

The QSimpleXmlNodeModel class is an implementation of QAbstractXmlNodeModel sufficient for many common cases.

Subclassing QAbstractXmlNodeModel can be a significant task, because it requires implementing several, complex member functions. QSimpleXmlNodeModel provides default implementations of these member functions that are suitable for a wide range of node models.

Subclasses of QSimpleXmlNodeModel must be thread-safe.

Member Function Documentation

QSimpleXmlNodeModel::QSimpleXmlNodeModel(const QXmlNamePool & namePool)

Constructs a QSimpleXmlNodeModel for use with with the specified namePool.

QSimpleXmlNodeModel::~QSimpleXmlNodeModel() [virtual]

Destructor.

QUrl QSimpleXmlNodeModel::baseUri(const QXmlNodeModelIndex & node) const [virtual]

Reimplemented from QAbstractXmlNodeModel::baseUri().

Returns the base URI for node. This is always the document URI.

See also documentUri().

QXmlNodeModelIndex QSimpleXmlNodeModel::elementById(const QXmlName & id) const [virtual]

Reimplemented from QAbstractXmlNodeModel::elementById().

Always returns a default constructed QXmlNodeModelIndex instance, regardless of id.

This effectively means the model has no elements that have an id.

QXmlNamePool & QSimpleXmlNodeModel::namePool() const

Returns the name pool associated with this model. The implementation of name() will use this name pool to create names.

QVector<QXmlName> QSimpleXmlNodeModel::namespaceBindings(const QXmlNodeModelIndex & node) const [virtual]

Reimplemented from QAbstractXmlNodeModel::namespaceBindings().

Always returns an empty QVector. This signals that no namespace bindings are in scope for node.

QVector<QXmlNodeModelIndex> QSimpleXmlNodeModel::nodesByIdref(const QXmlName & idref) const [virtual]

Reimplemented from QAbstractXmlNodeModel::nodesByIdref().

Always returns an empty vector, regardless of idref.

This effectively means the model has no elements or attributes of type IDREF.

QString QSimpleXmlNodeModel::stringValue(const QXmlNodeModelIndex & node) const [virtual]

Reimplemented from QAbstractXmlNodeModel::stringValue().

If node is an element or attribute, typedValue() is called, and the return value converted to a string, as per XQuery's rules.

If node is another type of node, the empty string is returned.

If this function is overridden for comments or processing instructions, it is important to remember to call it (for elements and attributes having values not of type xs:string) to ensure that the values are formatted according to XQuery.

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