本文整理汇总了C++中QXmlResultItems::current方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmlResultItems::current方法的具体用法?C++ QXmlResultItems::current怎么用?C++ QXmlResultItems::current使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXmlResultItems
的用法示例。
在下文中一共展示了QXmlResultItems::current方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: evaluate
void tst_QXmlResultItems::evaluate() const
{
QFETCH(QString, queryString);
QXmlQuery query;
query.setQuery(queryString);
QVERIFY(query.isValid());
QXmlResultItems result;
query.evaluateTo(&result);
QXmlItem item(result.next());
while(!item.isNull())
{
QVERIFY(!result.current().isNull());
QVERIFY(!result.hasError());
item = result.next();
}
/* Now, stress beyond the end. */
for(int i = 0; i < 3; ++i)
{
QVERIFY(result.current().isNull());
QVERIFY(result.next().isNull());
}
}
示例2: current
void tst_QXmlResultItems::current() const
{
/* Check default value. */
{
QXmlResultItems result;
QVERIFY(result.current().isNull());
}
/* Stress it on a default constructed value. */
{
QXmlResultItems result;
QVERIFY(result.current().isNull());
QVERIFY(result.current().isNull());
QVERIFY(result.current().isNull());
}
}
示例3: constCorrectness
void tst_QXmlResultItems::constCorrectness() const
{
const QXmlResultItems result;
/* These functions should be const. */
result.current();
result.hasError();
}
示例4: evalateWithInstantError
/*!
What's special about this is that it's not the QAbstractXmlForwardIterator::next()
that triggers the error, it's QPatternist::Expression::evaluateSingleton() directly.
*/
void tst_QXmlResultItems::evalateWithInstantError() const
{
QXmlQuery query;
MessageSilencer silencer;
query.setMessageHandler(&silencer);
query.setQuery(QLatin1String("fn:error()"));
QXmlResultItems result;
query.evaluateTo(&result);
/* Check the values, and stress it. */
for(int i = 0; i < 3; ++i)
{
QVERIFY(result.current().isNull());
QVERIFY(result.next().isNull());
QVERIFY(result.hasError());
}
}