diff options
Diffstat (limited to 'tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp')
-rw-r--r-- | tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp index b7600351b7..ae99e35467 100644 --- a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp +++ b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp @@ -75,6 +75,7 @@ private slots: void introspectQrc(); void sortCaseSensitive_data(); void sortCaseSensitive(); + void updateProperties(); private: void checkNoErrors(const QQmlComponent& component); QQmlEngine engine; @@ -425,6 +426,47 @@ void tst_qquickfolderlistmodel::sortCaseSensitive() QTRY_COMPARE(flm->data(flm->index(i),FileNameRole).toString(), expectedOrder.at(i)); } +void tst_qquickfolderlistmodel::updateProperties() +{ + QQmlComponent component(&engine, testFileUrl("basic.qml")); + checkNoErrors(component); + + QObject *folderListModel = component.create(); + QVERIFY(folderListModel); + + QVariant caseSensitive = folderListModel->property("caseSensitive"); + QVERIFY(caseSensitive.isValid()); + QCOMPARE(caseSensitive.toBool(), true); + folderListModel->setProperty("caseSensitive", false); + caseSensitive = folderListModel->property("caseSensitive"); + QVERIFY(caseSensitive.isValid()); + QCOMPARE(caseSensitive.toBool(), false); + + QVariant showOnlyReadable = folderListModel->property("showOnlyReadable"); + QVERIFY(showOnlyReadable.isValid()); + QCOMPARE(showOnlyReadable.toBool(), false); + folderListModel->setProperty("showOnlyReadable", true); + showOnlyReadable = folderListModel->property("showOnlyReadable"); + QVERIFY(showOnlyReadable.isValid()); + QCOMPARE(showOnlyReadable.toBool(), true); + + QVariant showDotAndDotDot = folderListModel->property("showDotAndDotDot"); + QVERIFY(showDotAndDotDot.isValid()); + QCOMPARE(showDotAndDotDot.toBool(), false); + folderListModel->setProperty("showDotAndDotDot", true); + showDotAndDotDot = folderListModel->property("showDotAndDotDot"); + QVERIFY(showDotAndDotDot.isValid()); + QCOMPARE(showDotAndDotDot.toBool(), true); + + QVariant showHidden = folderListModel->property("showHidden"); + QVERIFY(showHidden.isValid()); + QCOMPARE(showHidden.toBool(), false); + folderListModel->setProperty("showHidden", true); + showHidden = folderListModel->property("showHidden"); + QVERIFY(showHidden.isValid()); + QCOMPARE(showHidden.toBool(), true); +} + QTEST_MAIN(tst_qquickfolderlistmodel) #include "tst_qquickfolderlistmodel.moc" |