Results 1 to 2 of 2

Thread: Multiple folder and file selection

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2020
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Multiple folder and file selection

    Hello all,

    I am currently working on GUI where I need to select multiple files from multiple folders using getOpenFileNames() of QFileDialog. But I couldn't find a proper source to load files from multiple folders. Is this possible? If so, can I get some assistance in solving this? Thank you.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Multiple folder and file selection

    I don't think this is possible with QFileDialog, especially using the static getOpen...() methods. You could try using the non-static version, with fileMode() set to ExistingFiles and see if the dialog will let you select multiple files (probably with CTRL-click) while navigating the directory tree.

    If that doesn't work, then the only solution I can imagine is to roll your own interface using QFileSystemModel along with a QTreeView set for extended selection, and QItemSelectionModel to hold the selections. You might be able to find an example online where this has already been done.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 1
    Last Post: 1st June 2017, 23:39
  2. 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, 15:48
  3. Open file/folder in finder with selection
    By anjul.chauhan in forum Qt Programming
    Replies: 0
    Last Post: 20th June 2011, 08:10
  4. Multiple selection ??
    By marc2050 in forum Newbie
    Replies: 1
    Last Post: 9th May 2011, 03:10
  5. QGraphicsScene and multiple selection
    By Bill in forum Newbie
    Replies: 1
    Last Post: 4th August 2009, 16:19

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.