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

Qt Code:
  1. QDirModel model;
  2. QTreeView tree;
  3. tree.setModel(&model);
  4.  
  5. // Demonstrating look and feel features
  6. tree.setAnimated(true);
  7. tree.setIndentation(20);
  8. tree.setSortingEnabled(true);
  9.  
  10. tree.setAllColumnsShowFocus(false);
  11.  
  12.  
  13. QString directory = "/mnt";
  14. tree.setRootIndex(model.index(directory));
  15.  
  16. tree.setWindowTitle(QObject::tr("Dir View"));
  17. tree.resize(320, 240);
  18. tree.show();
  19.  
  20. tree.hideColumn(1);
  21. tree.hideColumn(2);
  22. tree.hideColumn(3);
  23.  
  24. return app.exec();
To copy to clipboard, switch view to plain text mode