|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.xmlpatterns.QXmlNodeModelIndex
public class QXmlNodeModelIndex
The QXmlNodeModelIndex
class identifies a node in an XML node model subclassed from QAbstractXmlNodeModel
. QXmlNodeModelIndex
is an index into an XML node model
. It contains:
XML node model
, which is returned by model()
, anddata()
, internalPointer(), and additionalData()
.QXmlNodeModelIndex
is intentionally a simple class, it doesn't have member functions for accessing nodes. For example, it doesn't have functions for getting a node's name or its list of attributes. If you find that you need to retrieve this kind of information from your query results, there are two ways to proceed. XQuery
to an XML receiver
, orXQuery
do all the work to produce the desired result.XQuery
to return the set of elements, and then you would write the code to iterate over the result elements, get their attributes, and extract the desired string values. But the simpler way is to just augment your XQuery
to finding the desired attribute values. Then all you have to do is evaluate the XQuery
using the version of QXmlQuery::evaluateTo()
that populates a QStringList, which you can send directly to your widget. QXmlNodeModelIndex
doesn't impose any restrictions on the data value an QXmlNodeModelIndex
should contain. The meaning of the data left to the associated node model
. Because QXmlNodeModelIndex
depends on a particular subclass of QAbstractXmlNodeModel
for its existence, the only way you can create an instance of QXmlNodeModelIndex
is by asking the node model to create one for you with QAbstractXmlNodeModel::createIndex()
. Since that function is protected, it is usually a good ide to write a public function that creates a QXmlNodeModelIndex
from arguments that are appropriate for your particular node model.
A default constructed node index is said to be null, i.e., isNull()
returns true.
QXmlNodeModelIndex
and QAbstractXmlNodeModel
follow the same design pattern used for QModelIndex and QAbstractItemModel
.
Nested Class Summary | |
---|---|
static class |
QXmlNodeModelIndex.DocumentOrder
Identifies the specific node comparison operator that should be used. |
static class |
QXmlNodeModelIndex.NodeKind
Identifies a kind of node. |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Constructor Summary | |
---|---|
QXmlNodeModelIndex()
Default constructor. |
|
QXmlNodeModelIndex(QXmlNodeModelIndex other)
Standard copy constructor. |
Method Summary | |
---|---|
long |
additionalData()
Returns the second data value. |
QXmlNodeModelIndex |
clone()
This method is reimplemented for internal reasons |
long |
data()
Returns the first data value. |
static QXmlNodeModelIndex |
fromNativePointer(QNativePointer nativePointer)
|
boolean |
isNull()
Returns true if this QXmlNodeModelIndex is a default constructed value, otherwise false. |
QAbstractXmlNodeModel |
model()
Returns the QAbstractXmlNodeModel that this node index refers to. |
static QNativePointer |
nativePointerArray(QXmlNodeModelIndex[] array)
|
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QXmlNodeModelIndex()
isNull()
.
public QXmlNodeModelIndex(QXmlNodeModelIndex other)
QXmlNodeModelIndex
instance that is a copy of other.
Method Detail |
---|
public final long additionalData()
data()
returns the first one. data()
.
public final long data()
additionalData()
returns the second one. additionalData()
.
public final boolean isNull()
QXmlNodeModelIndex
is a default constructed value, otherwise false. A null QXmlNodeModelIndex
doesn't represent any node and cannot be used in conjunction with QAbstractXmlNodeModel
.
public static QXmlNodeModelIndex fromNativePointer(QNativePointer nativePointer)
public static QNativePointer nativePointerArray(QXmlNodeModelIndex[] array)
public final QAbstractXmlNodeModel model()
QAbstractXmlNodeModel
that this node index refers to. QXmlNodeModelIndex
does not own QAbstractXmlNodeModel
and does not keep track of its lifetime, so this pointer will dangle if the QAbstractXmlNodeModel
is deallocated first. There is no setter for the node model because instances of QXmlNodeModelIndex
instances are only created with QAbstractXmlNodeModel::createIndex()
.
public QXmlNodeModelIndex clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |