Results 1 to 2 of 2

Thread: QFileDialog::getopenFileNames - File select order

  1. #1
    Join Date
    Mar 2013
    Qt products

    Default QFileDialog::getopenFileNames - File select order

    I'm writing a small PyQt code to create a batch file listing the order which the files on my drive are processed
    Using the QFiledialog getopenFilenames method I can select the files, however the order in which I selected the files is not preserved

    It's important that I get the order of the users selection EXACTLY right, as I want to process the files in the selected order. But I see that the list returned by getOpenFileNames does not preserve the selection order.

    Does anybody have any suggestion to capture the selection order?

    I am using pyqt4 on windows

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

    Default Re: QFileDialog::getopenFileNames - File select order

    For that to work you need to keep track of selection as it happens.
    I.e. you need to follow what is added or removed, not just whether something is selected or not.

    For that you will have to handle the selection signals appropriately, e.g. using a QListView and connecting to the view's item selection model.
    Once you have that it should be easy to put into a dialog that can then serve as your file dialog.


Similar Threads

  1. Replies: 8
    Last Post: 15th May 2012, 05:21
  2. how select whole directory also in QFileDialog?
    By aurora in forum Qt Programming
    Replies: 4
    Last Post: 19th October 2011, 09:30
  3. How to select folders from QFileDialog???
    By IndikaU in forum Newbie
    Replies: 4
    Last Post: 30th September 2011, 09:19
  4. Replies: 1
    Last Post: 30th October 2009, 03:42
  5. QFileDialog filename list order
    By joelthelion in forum Qt Programming
    Replies: 1
    Last Post: 28th January 2009, 14:58

Tags for this Thread


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.