Results 1 to 2 of 2

Thread: select folder which contain the n number of .bin file

  1. #1
    Join Date
    Oct 2014
    Posts
    71
    Thanks
    13
    Qt products
    Qt5
    Platforms
    Windows

    Question select folder which contain the n number of .bin file

    I had a requirement where i have to select n number of .bin file for reading purpose.
    So I implemented the code like below which is working fine
    Qt Code:
    1. QDir directory("Documents");
    2. QString path = directory.filePath(" ");
    3. QStringList BinFileNames = QFileDialog::getOpenFileNames(this,tr("Open File"),path,tr(".bin"));
    4. BinFileSize = BinFileNames.size();
    To copy to clipboard, switch view to plain text mode 
    but now the requirement is like i have to select only the folder which contain all the .bin file.
    So i tired to implement like below
    Qt Code:
    1. QString Directory = QFileDialog::getExistingDirectory(this, tr("Choose Or Create Directory"),
    2. "/home",
    3. QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
    To copy to clipboard, switch view to plain text mode 
    but not getting how can i save all file path in a QStringList.
    So in shot how can I get all the file form the selected folder and open for read purpose

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: select folder which contain the n number of .bin file

    QDir::entryList().

    Cheers,
    _

Similar Threads

  1. Qt 5.1 : Want to put qt.conf file in different folder that application exe folder
    By Rajesh.Rathod in forum Installation and Deployment
    Replies: 1
    Last Post: 20th July 2014, 14:48
  2. Replies: 7
    Last Post: 3rd February 2014, 14:27
  3. Release folder - 1 .exe file only
    By Swankee in forum Qt Tools
    Replies: 6
    Last Post: 21st December 2009, 22:43
  4. Number of folder
    By Benjamin in forum Qt Programming
    Replies: 1
    Last Post: 3rd December 2008, 10:33
  5. qdirmodel question: show file number of a folder?
    By zl2k in forum Qt Programming
    Replies: 3
    Last Post: 7th November 2008, 07:07

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.