The QSimpleXmlNodeModel class is an implementation of QAbstractXmlNodeModel sufficient for many common cases. 更多...
| 頭: | #include <QSimpleXmlNodeModel> |
| qmake: | QT += xmlpatterns |
| Since: | Qt 4.4 |
| 繼承: | QAbstractXmlNodeModel |
注意: 此類的所有函數 可重入 .
| QSimpleXmlNodeModel (const QXmlNamePool & namePool ) | |
| virtual | ~QSimpleXmlNodeModel () |
| QXmlNamePool & | namePool () const |
| 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 |
The QSimpleXmlNodeModel class is an implementation of QAbstractXmlNodeModel sufficient for many common cases.
子類化 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.
子類化的 QSimpleXmlNodeModel must be thread-safe.
構造 QSimpleXmlNodeModel for use with with the specified namePool .
[虛擬]
QSimpleXmlNodeModel::
~QSimpleXmlNodeModel
()
析構函數。
[虛擬]
QUrl
QSimpleXmlNodeModel::
baseUri
(const
QXmlNodeModelIndex
&
node
) const
重實現自 QAbstractXmlNodeModel::baseUri ().
Returns the base URI for node . This is always the document URI.
另請參閱 documentUri ().
[虛擬]
QXmlNodeModelIndex
QSimpleXmlNodeModel::
elementById
(const
QXmlName
&
id
) const
重實現自 QAbstractXmlNodeModel::elementById ().
Always returns a default constructed QXmlNodeModelIndex instance, regardless of id .
This effectively means the model has no elements that have an id.
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
重實現自 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
重實現自 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
重實現自 QAbstractXmlNodeModel::stringValue ().
若 node is an element or attribute, typedValue () is called, and the return value converted to a string, as per XQuery 's rules.
若 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
.