PDA

View Full Version : How to list all the files/folder in a direcotry in QlistWidget?



vjsharma_30
25th February 2010, 18:08
How can i list all the files and folders of a directory in the QlistWidget. LIke i want to list all the files and folders in /media/USB folder.
And also i want to know how can i capture the double click event of a item in a QlistWidget. Because i have two QlistWidget,in one widget directory path is shown and in another widget i want to list all the files/folders when i select the directory path from first widget. Please provide code example if any.

aamer4yu
25th February 2010, 18:12
Best would be using QFileSystemModel with QListView.
Check the documentation for examples. You can also refer Qt Demos for the Dir View example

vjsharma_30
25th February 2010, 18:21
And what about the event capture when a particular item is selected in the list view?

aamer4yu
25th February 2010, 18:52
Read the model and view classes in assistant.
Check out their signals.