![]() |
Home · All Classes · Main Classes · Grouped Classes · Modules · Functions | ![]() |
The QXmlNodeModelIndex class is used to represent a node in a node model. More...
#include <QXmlNodeModelIndex>
Note: All the functions in this class are reentrant.
This class was introduced in Qt 4.4.
The QXmlNodeModelIndex class is used to represent a node in a node model.
QXmlNodeModelIndex is used as an index into QAbstractXmlNodeModel. It contains two things:
QXmlNodeModelIndex does not impose restrictions on what data QXmlNodeModelIndex should contain, that is entirely up to the associated QXmlNodeModelIndex.
Conceptually, QXmlNodeModelIndex can be seen as being one of the two types of items in XQuery: namely nodes. When the XQuery engine handles nodes, it uses QXmlNodeModelIndex in order to delegate the actual functionality to the associated QAbstractXmlNodeModel.
Since QXmlNodeModelIndex is dependent on a particular QAbstractXmlNodeModel subclass, there is no way to create instances, except for via QAbstractXmlNodeModel::createIndex(). Since that function is protected, it can probably be a good to create a function that creates node indexes from arguments that fits the particular node model.
A default constructed node index is invalid and @c null, and isNull() will return true.
QXmlNodeModelIndex and QAbstractXmlNodeModel follows the same pattern that QModelIndex QAbstractItemModel do.
Identify axes. An axis navigates from a node in a way specific to that axis.
The axes Child, Descendant, Attribute, Self, DescendantOrSelf, FollowingSibling, and Following are forward axes.
The axes Parent, Ancestor, PrecedingSibling, Preceding and AncestorOrSelf are reverse axes.
Constant | Value | Description |
---|---|---|
QXmlNodeModelIndex::AxisChild | 1 | ForwardAxis | The child axis. |
QXmlNodeModelIndex::AxisDescendant | 2 | ForwardAxis | The descendant axis. |
QXmlNodeModelIndex::AxisAttribute | 4 | ForwardAxis | The attribute axis. This enum value isn't named "Attribute", in order to not clash with node kind by that name. |
QXmlNodeModelIndex::AxisSelf | 8 | ForwardAxis | The self axis. |
QXmlNodeModelIndex::AxisDescendantOrSelf | 16 | ForwardAxis | The descendant-or-self axis. |
QXmlNodeModelIndex::AxisFollowingSibling | 32 | ForwardAxis | The following-sibling axis. |
QXmlNodeModelIndex::AxisNamespace | 64 | ForwardAxis | The namespace axis. It does not exist in XQuery, is deprecated in XPath 2.0(optionally supported), and mandatory in XPath 1.0. |
QXmlNodeModelIndex::AxisFollowing | 128 | ReverseAxis | The following axis. |
QXmlNodeModelIndex::AxisParent | 256 | ReverseAxis | The parent axis. |
QXmlNodeModelIndex::AxisAncestor | 512 | ReverseAxis | The ancestor axis. |
QXmlNodeModelIndex::AxisPrecedingSibling | 1024 | ReverseAxis | The preceding-sibling axis. |
QXmlNodeModelIndex::AxisPreceding | 2048 | ReverseAxis | The preceding axis. |
QXmlNodeModelIndex::AxisAncestorOrSelf | 4096 | ReverseAxis | The ancestor-or-self axis. |
See also XQuery 1.0: An XML Query Language, 3.2.1.1 Axes.
Identifies what specific node comparison operator that should be used.
Constant | Value | Description |
---|---|---|
QXmlNodeModelIndex::Precedes | -1 | Signifies the \<\< operator. Whether the first operand precedes the second operand in document order. |
QXmlNodeModelIndex::Follows | 1 | Signifies the \>\> operator. Whether the first operand follows the second operand in document order. |
QXmlNodeModelIndex::Is | 0 | Signifies the is operator. Whether two nodes have the same node identity. |
Typedef for QList<QXmlNodeModelIndex>.
Constant | Value | Description |
---|---|---|
QXmlNodeModelIndex::Attribute | 1 | Identifies an attribute node |
QXmlNodeModelIndex::Text | 64 | Identifies a text node |
QXmlNodeModelIndex::Comment | 2 | Identifies a comment node |
QXmlNodeModelIndex::Document | 4 | Identifies a document node |
QXmlNodeModelIndex::Element | 8 | Identifies an element node |
QXmlNodeModelIndex::Namespace | 16 | Identifies a namespace node |
QXmlNodeModelIndex::ProcessingInstruction | 32 | Identifies a processing instruction. Not that the optional XML declaration at very beginning of the XML document is not a processing instruction |
Default constructor. Creates an item that is null.
See also isNull().
Standard copy constructor. Creates a QXmlNodeModelIndex instance that is a copy of other.
Returns the second data section that this node index carries.
See also data().
Returns the first data section that this node index carries.
See also additionalData().
Returns the first data section typed as a void * pointer.
See also additionalData().
Returns true if this QXmlNodeModelIndex is a default constructed value, otherwise false.
A null QXmlNodeModelIndex instance doesn't represent any node and cannot be used in conjunction with QAbstractXmlNodeModel.
Returns the QAbstractXmlNodeModel that this node index belongs to. QXmlNodeModelIndex does not own QAbstractXmlNodeModel nor keep track of its lifetime, so this pointer will dangle whenthe QAbstractXmlNodeModel is deallocated.
There is no setter for this, QXmlNodeModelIndex instances are created with QAbstractXmlNodeModel::createIndex().
Returns true if other is the same node as this.
Returns true if this node is the same as other.
In other words, this operator does not compare values, children or names of nodes, it tells whether two nodes have the same node identity. That is, whether they are from the same document and can be found at the exact same place.
This is an overloaded member function, provided for convenience.
Computes a hash key from the QXmlNodeModelIndex index, and returns it.
The hash is computed on QXmlNodeModelIndex::data(), QXmlNodeModelIndex::additionalData(), and QXmlNodeModelIndex::model(). This means the hash key can be used for node indexes from different node models.
Copyright © 2007 Trolltech | Trademarks | Qt 4.4.0-tp1 |