本文整理汇总了C++中QDeclarativeListReference::isValid方法的典型用法代码示例。如果您正苦于以下问题:C++ QDeclarativeListReference::isValid方法的具体用法?C++ QDeclarativeListReference::isValid怎么用?C++ QDeclarativeListReference::isValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDeclarativeListReference
的用法示例。
在下文中一共展示了QDeclarativeListReference::isValid方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hasFullImplementedListInterface
static bool hasFullImplementedListInterface(const QDeclarativeListReference &list)
{
#if QT_VERSION<0x050000
return list.isValid() && list.canCount() && list.canAt() && list.canAppend() && list.canClear();
#else
return list.isChangeable();
#endif
}
示例2: qmllistreference_invalid
void tst_qdeclarativelistreference::qmllistreference_invalid()
{
TestType tt;
// Invalid
{
QDeclarativeListReference r;
QVERIFY(r.isValid() == false);
QVERIFY(r.object() == 0);
QVERIFY(r.listElementType() == 0);
QVERIFY(r.canAt() == false);
QVERIFY(r.canClear() == false);
QVERIFY(r.canCount() == false);
QVERIFY(r.append(0) == false);
QVERIFY(r.at(10) == 0);
QVERIFY(r.clear() == false);
QVERIFY(r.count() == 0);
}
// Non-property
{
QDeclarativeListReference r(&tt, "blah");
QVERIFY(r.isValid() == false);
QVERIFY(r.object() == 0);
QVERIFY(r.listElementType() == 0);
QVERIFY(r.canAt() == false);
QVERIFY(r.canClear() == false);
QVERIFY(r.canCount() == false);
QVERIFY(r.append(0) == false);
QVERIFY(r.at(10) == 0);
QVERIFY(r.clear() == false);
QVERIFY(r.count() == 0);
}
// Non-list property
{
QDeclarativeListReference r(&tt, "intProperty");
QVERIFY(r.isValid() == false);
QVERIFY(r.object() == 0);
QVERIFY(r.listElementType() == 0);
QVERIFY(r.canAt() == false);
QVERIFY(r.canClear() == false);
QVERIFY(r.canCount() == false);
QVERIFY(r.append(0) == false);
QVERIFY(r.at(10) == 0);
QVERIFY(r.clear() == false);
QVERIFY(r.count() == 0);
}
}
示例3: isValid
void tst_qdeclarativelistreference::isValid()
{
TestType *tt = new TestType;
{
QDeclarativeListReference ref;
QVERIFY(ref.isValid() == false);
}
{
QDeclarativeListReference ref(tt, "blah");
QVERIFY(ref.isValid() == false);
}
{
QDeclarativeListReference ref(tt, "data");
QVERIFY(ref.isValid() == true);
delete tt;
QVERIFY(ref.isValid() == false);
}
}
示例4: hasFullImplementedListInterface
static bool hasFullImplementedListInterface(const QDeclarativeListReference &list)
{
return list.isValid() && list.canCount() && list.canAt() && list.canAppend() && list.canClear();
}