×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    76

    Question Regarding filesearch

    Hi every body,
    i have some files with extensios like .3gp_128*96 in particular folder.but now i want to search the file with only provding filename of file without extention.In my code i have used full name of filename.
    but now i want to do the search file name without extension giving.

    Plz let me know how to do this

    Regards,
    venkat

  2. #2
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Regarding filesearch

    Have you looked at QDir?

  3. #3
    Registered User
    Join Date
    Aug 2008
    Location
    Warsaw
    Posts
    11

    Re: Regarding filesearch

    - use QDir to get the list of the files for selected folder
    - use QFileInfo to get the file name details
    - use QRegExp to test if it's the file you look for.
    QRegExp rx("XXXX.*");
    rx.exactMatch("XXXX.*"); // returns true

    where XXXX is your file name.

  4. #4
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    76

    Re: Regarding filesearch

    hi igo,
    i have onemore dought regarding QDir that is how to get list of all files withouht thier extension using QDir functions.

    Regards,
    venkat

  5. #5
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Regarding filesearch

    Quote Originally Posted by venkatesh.pampana View Post
    hi igo,
    i have onemore dought regarding QDir that is how to get list of all files withouht thier extension using QDir functions.

    Regards,
    venkat
    List the files and then remove the extensions -- find the last dot and substring out to that point.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×