diff options
author | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-03-06 19:27:22 +0100 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-03-22 16:20:29 +0000 |
commit | 0271609d5136fa681306c2647973a26dadc7acb3 (patch) | |
tree | 4889a233a919266fbf38551a056cf8b49d7f2bd4 /tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp | |
parent | ae1c3eba3e7e11a9b1ab4d18792c82c9bb6e62de (diff) |
Remove QItemSelection value-type, use Array instead
We implement this by adding QItemSelection to the
set of sequence types.
Change-Id: Ia3db376c806d8f062639e22c7f4bf392f114c266
Reviewed-by: Stephen Kelly <steveire@gmail.com>
Diffstat (limited to 'tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp')
-rw-r--r-- | tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp b/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp index cd00593ee6..637b9e4b90 100644 --- a/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp +++ b/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp @@ -184,14 +184,18 @@ void tst_qqmlitemmodels::itemSelection() TestModel model(10, 10); object->setModel(&model); - QCOMPARE(object->property("count").toInt(), 8); + QCOMPARE(object->property("count").toInt(), 5); QCOMPARE(object->property("contains").toBool(), true); - QVariant milVariant = object->property("itemSelection"); - QCOMPARE(milVariant.userType(), qMetaTypeId<QItemSelection>()); + const char *propNames[] = { "itemSelectionRead", "itemSelectionBinding", 0 }; + for (const char **name = propNames; *name; name++) { + QVariant isVariant = object->property(*name); + QCOMPARE(isVariant.userType(), qMetaTypeId<QItemSelection>()); - const QItemSelection &mil = milVariant.value<QItemSelection>(); - QCOMPARE(mil.count(), 5); + const QItemSelection &sel = isVariant.value<QItemSelection>(); + QCOMPARE(sel.count(), object->itemSelection().count()); + QCOMPARE(sel, object->itemSelection()); + } } void tst_qqmlitemmodels::modelIndexList() |