本文整理汇总了C++中QXmlNodeModelIndex::internalPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmlNodeModelIndex::internalPointer方法的具体用法?C++ QXmlNodeModelIndex::internalPointer怎么用?C++ QXmlNodeModelIndex::internalPointer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXmlNodeModelIndex
的用法示例。
在下文中一共展示了QXmlNodeModelIndex::internalPointer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: typedValue
QVariant QObjectXmlModel::typedValue(const QXmlNodeModelIndex &n) const
{
switch (toNodeType(n))
{
case QObjectProperty:
{
const QVariant &candidate = toMetaProperty(n).read(asQObject(n));
if (isTypeSupported(candidate.type()))
return candidate;
else
return QVariant();
}
case MetaObjectClassName:
return QVariant(static_cast<QMetaObject*>(n.internalPointer())->className());
case MetaObjectSuperClass:
{
const QMetaObject *const superClass = static_cast<QMetaObject*>(n.internalPointer())->superClass();
if (superClass)
return QVariant(superClass->className());
else
return QVariant();
}
case QObjectClassName:
return QVariant(asQObject(n)->metaObject()->className());
default:
return QVariant();
}
}
示例2: internalPointer
void tst_QXmlNodeModelIndex::internalPointer() const
{
/* Check default value. */
{
const QXmlNodeModelIndex index;
QCOMPARE(index.internalPointer(), static_cast<void *>(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: metaObjectSibling
QXmlNodeModelIndex QObjectXmlModel::metaObjectSibling(const int pos, const QXmlNodeModelIndex &n) const
{
Q_ASSERT(pos == 1 || pos == -1);
Q_ASSERT(!n.isNull());
const int indexOf = m_allMetaObjects.indexOf(static_cast<const QMetaObject *>(n.internalPointer())) + pos;
if (indexOf >= 0 && indexOf < m_allMetaObjects.count())
return createIndex(const_cast<QMetaObject *>(m_allMetaObjects.at(indexOf)), MetaObject);
else
return QXmlNodeModelIndex();
}