本文整理汇总了C++中QXmlItem::isNode方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmlItem::isNode方法的具体用法?C++ QXmlItem::isNode怎么用?C++ QXmlItem::isNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXmlItem
的用法示例。
在下文中一共展示了QXmlItem::isNode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isNode
void tst_QXmlItem::isNode() const
{
/* Check default value. */
{
const QXmlItem item;
QVERIFY(!item.isNode());
}
/* On atomic value. */
{
const QXmlItem item(QVariant(3));
QVERIFY(!item.isNode());
}
// TODO on valid node index
/* On a QXmlItem constructed from a null QVariant. */
{
const QXmlItem item((QVariant()));
QVERIFY(!item.isNode());
}
/* On a QXmlItem constructed from a null QXmlNodeModelIndex. */
{
const QXmlItem item((QXmlNodeModelIndex()));
QVERIFY(!item.isNode());
}
}
示例2: constCorrectness
/*!
Check that the functions that should be const, are.
*/
void tst_QXmlItem::constCorrectness() const
{
const QXmlItem item;
item.isNull();
item.isNode();
item.isAtomicValue();
item.toAtomicValue();
item.toNodeModelIndex();
}
示例3: qtToXDMType
ItemType::Ptr AtomicValue::qtToXDMType(const QXmlItem &item)
{
Q_ASSERT(!item.isNull());
if(item.isNull())
return ItemType::Ptr();
if(item.isNode())
return BuiltinTypes::node;
Q_ASSERT(item.isAtomicValue());
const QVariant v(item.toAtomicValue());
switch(int(v.type()))
{
case QVariant::Char:
/* Fallthrough. */
case QVariant::String:
/* Fallthrough. */
case QVariant::Url:
return BuiltinTypes::xsString;
case QVariant::Bool:
return BuiltinTypes::xsBoolean;
case QVariant::ByteArray:
return BuiltinTypes::xsBase64Binary;
case QVariant::Int:
/* Fallthrough. */
case QVariant::LongLong:
return BuiltinTypes::xsInteger;
case QVariant::ULongLong:
return BuiltinTypes::xsUnsignedLong;
case QVariant::Date:
return BuiltinTypes::xsDate;
case QVariant::DateTime:
/* Fallthrough. */
case QVariant::Time:
return BuiltinTypes::xsDateTime;
case QMetaType::Float:
return BuiltinTypes::xsFloat;
case QVariant::Double:
return BuiltinTypes::xsDouble;
default:
return ItemType::Ptr();
}
}