- fix: create file in the files view should auto scroll to the new created file

This commit is contained in:
Roy Qu 2022-03-17 15:17:04 +08:00
parent 8cbcbb4b98
commit 55126ebebe
1 changed files with 1 additions and 1 deletions

View File

@ -3650,7 +3650,7 @@ void MainWindow::onFilesViewCreateFile()
QFile file(dir.filePath(fileName));
file.open(QFile::NewOnly);
QModelIndex newIndex = mFileSystemModel.index(fileName);
ui->treeFiles->selectionModel()->select(newIndex, QItemSelectionModel::SelectionFlag::Rows);
ui->treeFiles->setCurrentIndex(newIndex);
}