Example #1
0
void tst_qqmllistreference::canAppend()
{
    TestType *tt = new TestType;

    {
    QQmlListReference ref;
    QVERIFY(ref.canAppend() == false);
    }

    {
    QQmlListReference ref(tt, "blah");
    QVERIFY(ref.canAppend() == false);
    }

    {
    QQmlListReference ref(tt, "data");
    QVERIFY(ref.canAppend() == true);
    delete tt;
    QVERIFY(ref.canAppend() == false);
    }

    {
    TestType tt;
    tt.property.append = 0;
    QQmlListReference ref(&tt, "data");
    QVERIFY(ref.canAppend() == false);
    }
}
static bool hasFullImplementedListInterface(const QQmlListReference &list)
{
    return list.isValid() && list.canCount() && list.canAt() && list.canAppend() && list.canClear();
}