Results 1 to 4 of 4

Thread: Read FileName from a directory

  1. #1
    Join Date
    May 2009
    Posts
    94
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Post Read FileName from a directory

    1. A directory contains more number of file. How can i get each file name in a QString till i finished reading all file.
    2. What is the process_line(line); Writtern in QFIle example of reading a file.
    I am getting a error that:
    "process_line undeclared identifier".

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Read FileName from a directory

    Quote Originally Posted by bismitapadhy View Post
    1. A directory contains more number of file. How can i get each file name in a QString till i finished reading all file.
    use this
    Qt Code:
    1. ...
    2. QDir dir("d:/");
    3. const QStringList entities = dir.entryList(QDir::Files);
    4. ...
    To copy to clipboard, switch view to plain text mode 

    Quote Originally Posted by bismitapadhy View Post
    2. What is the process_line(line); Writtern in QFIle example of reading a file.
    I am getting a error that:
    "process_line undeclared identifier".
    it's just an example, i.e. you must write your own process_line or whatever you like to call it.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    May 2006
    Location
    Bangalore,India
    Posts
    235
    Thanks
    7
    Thanked 25 Times in 24 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Read FileName from a directory

    1. check void Window::find() in http://doc.trolltech.com/4.5/dialogs-findfiles.html

  4. #4
    Join Date
    May 2006
    Location
    Bangalore,India
    Posts
    235
    Thanks
    7
    Thanked 25 Times in 24 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Read FileName from a directory

    2. process_line is user defined function. you can write own function to process selected file.

Similar Threads

  1. some questions about install qwt
    By dycjiaoda in forum Qwt
    Replies: 1
    Last Post: 8th February 2011, 01:37
  2. install help nedded.
    By aj2903 in forum Installation and Deployment
    Replies: 9
    Last Post: 13th November 2008, 07:57
  3. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  4. QIODevice read()
    By ShaChris23 in forum Newbie
    Replies: 1
    Last Post: 3rd May 2007, 00:29
  5. Am I the only one with "make" error ?
    By probine in forum Installation and Deployment
    Replies: 1
    Last Post: 13th February 2006, 12:54

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.