Hi ,
I am using the below code to show a particular path in tree view. Now when i click a file or select or focused file , i need to get the file path location and file info. How do i get it? Help me
tree.setModel(&model);
// Demonstrating look and feel features
tree.setAnimated(true);
tree.setIndentation(20);
tree.setSortingEnabled(true);
tree.setAllColumnsShowFocus(false);
tree.setRootIndex(model.index(directory));
tree.
setWindowTitle(QObject::tr("Dir View"));
tree.resize(320, 240);
tree.show();
tree.hideColumn(1);
tree.hideColumn(2);
tree.hideColumn(3);
return app.exec();
QDirModel model;
QTreeView tree;
tree.setModel(&model);
// Demonstrating look and feel features
tree.setAnimated(true);
tree.setIndentation(20);
tree.setSortingEnabled(true);
tree.setAllColumnsShowFocus(false);
QString directory = "/mnt";
tree.setRootIndex(model.index(directory));
tree.setWindowTitle(QObject::tr("Dir View"));
tree.resize(320, 240);
tree.show();
tree.hideColumn(1);
tree.hideColumn(2);
tree.hideColumn(3);
return app.exec();
To copy to clipboard, switch view to plain text mode
Bookmarks