CopperSpice API  1.9.1
QSimpleXmlNodeModel Class Reference

Provides default implementation for QAbstractXmlNodeModel. More...

Inheritance diagram for QSimpleXmlNodeModel:
QAbstractXmlNodeModel QSharedData

Public Methods

 QSimpleXmlNodeModel (const QXmlNamePool &namePool)
virtual ~QSimpleXmlNodeModel ()
QUrl baseUri (const QXmlNodeModelIndex &node) const override
QXmlNodeModelIndex elementById (const QXmlName &id) const override
QXmlNamePoolnamePool () const
QVector< QXmlNamenamespaceBindings (const QXmlNodeModelIndex &node) const override
QVector< QXmlNodeModelIndexnodesByIdref (const QXmlName &idref) const override
QString stringValue (const QXmlNodeModelIndex &node) const override
- Public Methods inherited from QAbstractXmlNodeModel
 QAbstractXmlNodeModel ()
virtual ~QAbstractXmlNodeModel ()
virtual QXmlNodeModelIndex::DocumentOrder compareOrder (const QXmlNodeModelIndex &index1, const QXmlNodeModelIndex &index2) const = 0
virtual QUrl documentUri (const QXmlNodeModelIndex &index) const = 0
virtual QXmlNodeModelIndex::NodeKind kind (const QXmlNodeModelIndex &index) const = 0
virtual QXmlName name (const QXmlNodeModelIndex &index) const = 0
virtual QXmlNodeModelIndex root (const QXmlNodeModelIndex &index) const = 0
QSourceLocation sourceLocation (const QXmlNodeModelIndex &index) const
virtual QVariant typedValue (const QXmlNodeModelIndex &index) const = 0
- Public Methods inherited from QSharedData
 QSharedData ()
 QSharedData (const QSharedData &other)

Additional Inherited Members

- Public Typedefs inherited from QAbstractXmlNodeModel
typedef QList< PtrList
typedef QExplicitlySharedDataPointer< QAbstractXmlNodeModel > Ptr
- Public Types inherited from QAbstractXmlNodeModel
enum  SimpleAxis
- Protected Methods inherited from QAbstractXmlNodeModel
virtual QVector< QXmlNodeModelIndexattributes (const QXmlNodeModelIndex &element) const = 0
QXmlNodeModelIndex createIndex (qint64 data) const
QXmlNodeModelIndex createIndex (qint64 data, qint64 additionalData) const
QXmlNodeModelIndex createIndex (void *pointer, qint64 additionalData=0) const
virtual QXmlNodeModelIndex nextFromSimpleAxis (SimpleAxis axis, const QXmlNodeModelIndex &origin) const = 0

Detailed Description

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

Subclasses of QSimpleXmlNodeModel must be thread-safe.

See also

Constructor & Destructor Documentation

QSimpleXmlNodeModel::QSimpleXmlNodeModel ( const QXmlNamePool namePool)

Constructs a QSimpleXmlNodeModel for use with the specified namePool.

QSimpleXmlNodeModel::~QSimpleXmlNodeModel ( )


Method Documentation

QUrl QSimpleXmlNodeModel::baseUri ( const QXmlNodeModelIndex node) const

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

See also

Implements QAbstractXmlNodeModel::baseUri()

QXmlNodeModelIndex QSimpleXmlNodeModel::elementById ( const QXmlName id) const

Always returns a default constructed QXmlNodeModelIndex instance, regardless of id. This effectively means the model has no elements that have an id.

Implements QAbstractXmlNodeModel::elementById()

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

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

Implements QAbstractXmlNodeModel::namespaceBindings()

QVector< QXmlNodeModelIndex > QSimpleXmlNodeModel::nodesByIdref ( const QXmlName idref) const

Always returns an empty vector, regardless of idref. This effectively means the model has no elements or attributes of type IDREF.

Implements QAbstractXmlNodeModel::nodesByIdref()

QString QSimpleXmlNodeModel::stringValue ( const QXmlNodeModelIndex node) const

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

If this method 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.

Implements QAbstractXmlNodeModel::stringValue()