diff options
-rw-r--r-- | tests/auto/qdirmodel/tst_qdirmodel.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/auto/qdirmodel/tst_qdirmodel.cpp b/tests/auto/qdirmodel/tst_qdirmodel.cpp index a8c298d..7ecadfc 100644 --- a/tests/auto/qdirmodel/tst_qdirmodel.cpp +++ b/tests/auto/qdirmodel/tst_qdirmodel.cpp @@ -611,27 +611,24 @@ void tst_QDirModel::task196768_sorting() QString path = SRCDIR; QDirModel model; - QTreeView view; - QPersistentModelIndex index = model.index(path); - qDebug() << "Path" << path << "count" << model.rowCount(index) << "index" << index; + /* QDirModel has a bug if we show the content of the subdirectory inside a hidden directory + and we don't add QDir::Hidden. But as QDirModel is deprecated, we decided not to fix it. */ + model.setFilter(QDir::AllEntries | QDir::Hidden | QDir::AllDirs); + QTreeView view; + QPersistentModelIndex index = model.index(path); view.setModel(&model); - qDebug() << "After setModel" << index; QModelIndex index2 = model.index(path); - qDebug() << "A" << index << index2; QCOMPARE(index.data(), index2.data()); view.setRootIndex(index); index2 = model.index(path); - qDebug() << "B" << index << index2; QCOMPARE(index.data(), index2.data()); view.setCurrentIndex(index); index2 = model.index(path); - qDebug() << "C" << index << index2; QCOMPARE(index.data(), index2.data()); view.setSortingEnabled(true); index2 = model.index(path); - qDebug() << "After sorting" << index << index2 << "count" << model.rowCount(index2); QCOMPARE(index.data(), index2.data()); } |