I'm using a QFileSystemModel to show data on both QTableView & QListView. Instead of default data, I want to show the data from 3nd column in the model on QListView.
How can I do that?
fsmodel.jpg
int main(int argc, char *argv[])
{
numbers << "One" << "Two" << "Three" << "Four" << "Five";
QFileSystemModel *model = new QFileSystemModel;
model
->setRootPath
(QDir::currentPath());
table->setModel(model);
list->setModel(model);
splitter->show();
return a.exec();
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QStringList numbers;
numbers << "One" << "Two" << "Three" << "Four" << "Five";
QFileSystemModel *model = new QFileSystemModel;
model->setRootPath(QDir::currentPath());
QSplitter * splitter = new QSplitter;
QTableView *table = new QTableView(splitter);
QListView * list = new QListView(splitter);
table->setModel(model);
list->setModel(model);
splitter->show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks