Unsolved How to select row in QListView of QFileSystemModel ?
-
When I create a new file, the listview will update, but how can I use code to select the new file at row 0 ?
directory = QStandardPaths::standardLocations(QStandardPaths::MusicLocation).first() + "/HTYAR"; model = new QFileSystemModel; model->setRootPath(directory); model->setNameFilterDisables(false); model->sort(3,Qt::DescendingOrder); ui->listView->setModel(model); ui->listView->setRootIndex(model->index(directory));
-