本文整理汇总了C++中qxmlnodemodelindex::iterator::Ptr::next方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::next方法的具体用法?C++ Ptr::next怎么用?C++ Ptr::next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qxmlnodemodelindex::iterator::Ptr
的用法示例。
在下文中一共展示了Ptr::next方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sendFromAxis
void QAbstractXmlReceiver::sendFromAxis(const QXmlNodeModelIndex &node)
{
Q_ASSERT(!node.isNull());
const QXmlNodeModelIndex::Iterator::Ptr it(node.iterate(axis));
QXmlNodeModelIndex next(it->next());
while(!next.isNull())
{
sendAsNode(next);
next = it->next();
}
}
示例2: hasChildElement
bool XsdInstanceReader::hasChildElement() const
{
const QXmlNodeModelIndex index = m_model.index();
QXmlNodeModelIndex::Iterator::Ptr it = index.model()->iterate(index, QXmlNodeModelIndex::AxisChild);
QXmlNodeModelIndex currentIndex = it->next();
while (!currentIndex.isNull()) {
if (currentIndex.kind() == QXmlNodeModelIndex::Element)
return true;
currentIndex = it->next();
}
return false;
}
示例3: attribute
QHash<QXmlName, QXmlItem> PullBridge::attributeItems()
{
Q_ASSERT(m_current == StartElement);
QHash<QXmlName, QXmlItem> attributes;
QXmlNodeModelIndex::Iterator::Ptr it = m_index.iterate(QXmlNodeModelIndex::AxisAttribute);
QXmlNodeModelIndex index = it->next();
while (!index.isNull()) {
const Item attribute(index);
attributes.insert(index.name(), QXmlItem(index));
index = it->next();
}
return attributes;
}
示例4: text
QString XsdInstanceReader::text() const
{
const QXmlNodeModelIndex index = m_model.index();
QXmlNodeModelIndex::Iterator::Ptr it = index.model()->iterate(index, QXmlNodeModelIndex::AxisChild);
QString result;
QXmlNodeModelIndex currentIndex = it->next();
while (!currentIndex.isNull()) {
if (currentIndex.kind() == QXmlNodeModelIndex::Text) {
result.append(Item(currentIndex).stringValue());
}
currentIndex = it->next();
}
return result;
}
示例5: evaluateSingleton
Item AxisStep::evaluateSingleton(const DynamicContext::Ptr &context) const
{
/* If we don't have a focus, it's either a bug or our parent isn't a Path
* that have advanced the focus iterator. Hence, attempt to advance the focus on our own. */
if(!context->contextItem())
context->focusIterator()->next();
Q_ASSERT(context->contextItem());
const QXmlNodeModelIndex::Iterator::Ptr it(context->contextItem().asNode().iterate(m_axis));
QXmlNodeModelIndex next(it->next());
while(!next.isNull())
{
const Item candidate(mapToItem(next, context));
if(candidate)
return candidate;
else
next = it->next();
};
return Item();
}
示例6: evaluateSingleton
Item LangFN::evaluateSingleton(const DynamicContext::Ptr &context) const
{
const Item langArg(m_operands.first()->evaluateSingleton(context));
const QString lang(langArg ? langArg.stringValue() : QString());
const QXmlName xmlLang(StandardNamespaces::xml, StandardLocalNames::lang, StandardPrefixes::xml);
const QXmlNodeModelIndex langNode(m_operands.at(1)->evaluateSingleton(context).asNode());
const QXmlNodeModelIndex::Iterator::Ptr ancestors(langNode.iterate(QXmlNodeModelIndex::AxisAncestorOrSelf));
QXmlNodeModelIndex ancestor(ancestors->next());
while(!ancestor.isNull())
{
const QXmlNodeModelIndex::Iterator::Ptr attributes(ancestor.iterate(QXmlNodeModelIndex::AxisAttribute));
QXmlNodeModelIndex attribute(attributes->next());
while(!attribute.isNull())
{
Q_ASSERT(attribute.kind() == QXmlNodeModelIndex::Attribute);
if(attribute.name() == xmlLang)
{
if(isLangMatch(attribute.stringValue(), lang))
return CommonValues::BooleanTrue;
else
return CommonValues::BooleanFalse;
}
attribute = attributes->next();
}
ancestor = ancestors->next();
}
return CommonValues::BooleanFalse;
}
示例7: n
QVector<QXmlName> AccelTree::namespaceBindings(const QXmlNodeModelIndex &ni) const
{
/* We get a hold of the ancestor, and loop them in reverse document
* order(first the parent, then the parent's parent, etc). As soon
* we find a binding that hasn't already been added, we add it to the
* result list. In that way, declarations appearing further down override
* those further up. */
const PreNumber preNumber = toPreNumber(ni);
const QXmlNodeModelIndex::Iterator::Ptr it(new AncestorIterator<true>(this, preNumber));
QVector<QXmlName> result;
QXmlNodeModelIndex n(it->next());
/* Whether xmlns="" has been encountered. */
bool hasUndeclaration = false;
while(!n.isNull())
{
const QVector<QXmlName> &forNode = namespaces.value(toPreNumber(n));
const int len = forNode.size();
bool stopInheritance = false;
for(int i = 0; i < len; ++i)
{
const QXmlName &nsb = forNode.at(i);
if(nsb.namespaceURI() == StandardNamespaces::StopNamespaceInheritance)
{
stopInheritance = true;
continue;
}
if(nsb.prefix() == StandardPrefixes::empty &&
nsb.namespaceURI() == StandardNamespaces::empty)
{
hasUndeclaration = true;
continue;
}
if(!hasPrefix(result, nsb.prefix()))
{
/* We've already encountered an undeclaration, so we're supposed to skip
* them. */
if(hasUndeclaration && nsb.prefix() == StandardPrefixes::empty)
continue;
else
result.append(nsb);
}
}
if(stopInheritance)
break;
else
n = it->next();
}
result.append(QXmlName(StandardNamespaces::xml, StandardLocalNames::empty, StandardPrefixes::xml));
return result;
}