本文整理汇总了C++中QXmlNodeModelIndex::model方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmlNodeModelIndex::model方法的具体用法?C++ QXmlNodeModelIndex::model怎么用?C++ QXmlNodeModelIndex::model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXmlNodeModelIndex
的用法示例。
在下文中一共展示了QXmlNodeModelIndex::model方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compareOrder
QXmlNodeModelIndex::DocumentOrder AccelTree::compareOrder(const QXmlNodeModelIndex &ni1,
const QXmlNodeModelIndex &ni2) const
{
Q_ASSERT_X(ni1.model() == ni2.model(), Q_FUNC_INFO,
"The API docs guarantees the two nodes are from the same model");
const PreNumber p1 = ni1.data();
const PreNumber p2 = ni2.data();
if(p1 == p2)
return QXmlNodeModelIndex::Is;
else if(p1 < p2)
return QXmlNodeModelIndex::Precedes;
else
return QXmlNodeModelIndex::Follows;
}
示例2: model
void tst_QXmlNodeModelIndex::model() const
{
/* Check default value. */
{
const QXmlNodeModelIndex index;
QCOMPARE(index.model(), static_cast<const QAbstractXmlNodeModel *>(0));
}
}
示例3: constCorrectness
void tst_QXmlNodeModelIndex::constCorrectness() const
{
const QXmlNodeModelIndex index;
/* All these functions should be const. */
index.internalPointer();
index.data();
index.additionalData();
index.isNull();
index.model();
}
示例4: 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;
}
示例5: 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;
}