Results 1 to 3 of 3

Thread: How to find file using Qt?

  1. #1
    Join Date
    Jun 2007
    Location
    India/Bangalore
    Posts
    156
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up How to find file using Qt?

    Hi all,

    I want to fiind file from my disk like CFindFile::findFile . and CFindFile::nextFile

    How to achieve this?

    I searched in qFileInfo , I didn't get any clear picture.

    Please help me?
    Thanks,
    Rajesh.S

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to find file using Qt?

    There are no such functions in Qt, but you can implement them very easy.
    Take a look at QDir::entryList and QStringList::indexOf().
    Given a directory and a file name, you should recursively parse the directory tree rooted at the given dir and search for the given file using the functions mentioned earlier.

  3. The following user says thank you to marcel for this useful post:

    rajeshs (1st January 2008)

  4. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to find file using Qt?

    Or use QDirIterator with name filter(s).
    J-P Nurmi

  5. The following user says thank you to jpn for this useful post:

    rajeshs (2nd January 2008)

Similar Threads

  1. File Binary Upload QHttp find the bug/s
    By patrik08 in forum Qt Programming
    Replies: 13
    Last Post: 10th June 2008, 07:51
  2. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  3. Cannot find file: winmain.pro in Qt installation
    By jivanr in forum Installation and Deployment
    Replies: 3
    Last Post: 11th June 2007, 12:22
  4. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  5. Replies: 13
    Last Post: 1st June 2006, 14:01

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.