| 192 | } |
| 193 | |
| 194 | void TestProjectModel::testChangeWithProxyModel() |
| 195 | { |
| 196 | QString projectFolderPath = QDir::rootPath() + QStringLiteral("folder1"); |
| 197 | QString projectFilePath = QDir::rootPath() + QStringLiteral("folder1/file1"); |
| 198 | auto* proxy = new QSortFilterProxyModel( this ); |
| 199 | proxy->setSourceModel( model ); |
| 200 | auto* root = new ProjectFolderItem( nullptr, Path(QUrl::fromLocalFile(projectFolderPath)) ); |
| 201 | root->appendRow( new ProjectFileItem( nullptr, Path(QUrl::fromLocalFile(projectFilePath)) ) ); |
| 202 | model->appendRow( root ); |
| 203 | |
| 204 | QCOMPARE( model->rowCount(), 1 ); |
| 205 | QCOMPARE( proxy->rowCount(), 1 ); |
| 206 | |
| 207 | model->removeRow( 0 ); |
| 208 | |
| 209 | QCOMPARE( model->rowCount(), 0 ); |
| 210 | QCOMPARE( proxy->rowCount(), 0 ); |
| 211 | } |
| 212 | |
| 213 | void TestProjectModel::testCreateSimpleHierarchy() |
| 214 | { |
nothing calls this directly
no test coverage detected