Results 1 to 4 of 4

Thread: How to list all the files/folder in a direcotry in QlistWidget?

  1. #1
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question How to list all the files/folder in a direcotry in QlistWidget?

    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.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to list all the files/folder in a direcotry in QlistWidget?

    Best would be using QFileSystemModelwith QListView.
    Check the documentation for examples. You can also refer Qt Demos for the Dir View example

  3. #3
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to list all the files/folder in a direcotry in QlistWidget?

    And what about the event capture when a particular item is selected in the list view?

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to list all the files/folder in a direcotry in QlistWidget?

    Read the model and view classes in assistant.
    Check out their signals.

Similar Threads

  1. Replies: 2
    Last Post: 19th February 2010, 12:58
  2. Replies: 1
    Last Post: 19th March 2009, 16:15
  3. Reading files from a perticular folder
    By suneel1310 in forum Qt Programming
    Replies: 2
    Last Post: 10th March 2009, 10:02
  4. How to access files from specific folder using QContentSet
    By hrudhay in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 30th June 2008, 19:57
  5. Avoiding unnecessary files and folder in Impelementation
    By salmanmanekia in forum Qt Programming
    Replies: 2
    Last Post: 30th May 2008, 14:54

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.