i have a QTableView and i want to use QFileSystemModel as its model.
so i tried this code ;
QFileSystemModel *model = new QFileSystemModel;
model
->setRootPath
(QDir::currentPath());
model
->setFilter
(QDir::Files);
tableView->setModel(model);
QFileSystemModel *model = new QFileSystemModel;
model->setRootPath(QDir::currentPath());
model->setFilter(QDir::Files);
tableView->setModel(model);
To copy to clipboard, switch view to plain text mode
but the table does not show the files that are in the path. It just show one raw.
so, what is wrong am i doing ??? how can i make it get all the files ALSO how can I filter the files with a specific string , so it wont get ALL the files just the ones that meet my filter.
Thanks.
Added after 37 minutes:
ooh i was not using
tableView
->setRootIndex
(model
->index
(QDir::currentPath());
tableView->setRootIndex(model->index(QDir::currentPath());
To copy to clipboard, switch view to plain text mode
for filtering the files with name, i can use model->setNameFilters(QStringList filters).
Bookmarks