Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QXmlItem Class

TheQXmlItem class contains either an XML node or an atomic value.More...

Header:#include <QXmlItem>
Since: Qt 4.4

Note: All functions in this class arereentrant.

Public Types

typedefIterator

Public Functions

QXmlItem()
QXmlItem(const QXmlItem & other)
QXmlItem(const QXmlNodeModelIndex & node)
QXmlItem(const QVariant & atomicValue)
~QXmlItem()
boolisAtomicValue() const
boolisNode() const
boolisNull() const
QVarianttoAtomicValue() const
QXmlNodeModelIndextoNodeModelIndex() const
QXmlItem &operator=(const QXmlItem & other)

Detailed Description

TheQXmlItem class contains either an XML node or an atomic value.

InXQuery, 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.

<aNode/>,xs:base64Binary("FFFF"),current-date(),3e3, (: A floating point value :)attribute {"name"} {()}

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 theseXQuery items in theQtXmlPatterns API. A non-null instance ofQXmlItem is either a node or an atomic value. CallingisNode() orisAtomicValue() tells you which it is. Atomic values are represented elsewhere in the Qt API as instances ofQVariant, and an instance ofQXmlItem that represents an atomic value can be converted to aQVariant by callingtoAtomicValue(). AQXmlItem that wraps a node is represented elsewhere as an instance ofQXmlNodeModelIndex. A nodeQXmlItem can be converted to aQXmlNodeModelIndex by callingtoNodeModelIndex().

A default constructedQXmlItem instance is neither a node nor an atomic value. It is considered null, in which caseisNull() returns true.

An instance ofQXmlItem will be left dangling if theXML node model it refers to is deleted, if it is aQXmlNodeModelIndex.

Member Type Documentation

typedef QXmlItem::Iterator

A QAbstractXmlForwardIterator overQXmlItem.

Member Function Documentation

QXmlItem::QXmlItem()

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

QXmlItem::QXmlItem(constQXmlItem & other)

The copy constructor constructs a copy ofother.

QXmlItem::QXmlItem(constQXmlNodeModelIndex & node)

Constructs a nodeQXmlItem that is a copy ofnode.

See alsoisNode().

QXmlItem::QXmlItem(constQVariant & atomicValue)

Constructs an atomic valueQXmlItem withatomicValue.

See alsoisAtomicValue().

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

bool QXmlItem::isNode() const

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

See alsoisNull() andisAtomicValue().

bool QXmlItem::isNull() const

Returns true if thisQXmlItem is neither a node nor an atomic value. Default constructed instances ofQXmlItem are null.

QVariant QXmlItem::toAtomicValue() const

If thisQXmlItem represents an atomic value, it is converted to an appropriateQVariant and returned. If thisQXmlItem is not an atomic value, the return value is a default constructedQVariant. You can callisAtomicValue() to test whether the item is an atomic value.

See alsoisAtomicValue().

QXmlNodeModelIndex QXmlItem::toNodeModelIndex() const

If thisQXmlItem represents a node, it returns the item as aQXmlNodeModelIndex. If thisQXmlItem is not a node, the return value is undefined. You can callisNode() to test whether the item is a node.

See alsoisNode().

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

Assignsother tothis.

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp