![]() |
Home · All Classes · Main Classes · Grouped Classes · Modules · Functions | ![]() |
The QXmlResultItems class represents the items that are the result of an XQuery query. More...
#include <QXmlResultItems>
Note: All the functions in this class are reentrant.
This class was introduced in Qt 4.4.
The QXmlResultItems class represents the items that are the result of an XQuery query.
QXmlResultItems represent the items of a XQuery query, and allows them to be iterated like a forward iterator.
QXmlQuery query;
query.setQuery("<e/>, 1, 'two'");
QXmlResultItems result;
if(query.isValid())
{
query.evaluateToResult(&result);
QXmlItem item(result.next())
while(!item.isNull())
{
// Use item
item = result.next();
}
if(result.hasError())
return "Runtime error!";
}
QXmlResultItems lazily evaluates the query as it is executed. One effect of this is that an error can occur. In that case hasError() will return true, and next() and current() returns a null QXmlItem.
QXmlResultItems can be seen as an iterator that advances over the sequence of items that a query produced. Each call to next() advances the QXmlResultItems instance to "point" to the next item in the sequence and returns it, and current() returns the item that next() returned the last time it was called.
See also QXmlItem::isNode(), QXmlItem::isAtomicValue(), and QXmlNodeModelIndex.
Constructs a QXmlResultItems instance.
Destructs this QXmlResultItems instance.
Returns the c
On a default constructed QXmlResultItems instance, a null QXmlItem is returned.
If an error occurs during the evaluation, this function returns true.
By default false is returned.
On a default constructed QXmlResultItems instance, a null QXmlItem is returned.
Copyright © 2007 Trolltech | Trademarks | Qt 4.4.0-tp1 |