Qt World Summit: Submit your Presentation

File modes of QFileDialog

  • Hello!
    I'm new to Qt, having made the decision to use PyQt to lay out the interface of a small Python application. But although I have a question about PyQt, I will submit that question directly to their mailing list. For you, the question regards the modes of QFileDialog.

    The basic gist of my application is to grab a selection of one or more files or directories and for each:

    • If the item is a file, all spaces in the filename will be converted to underscores.

    • It the item is a directory, all spaces in the directory name will be replaced by underscores. Then the algorithm will be performed recursively by walking the directory tree top-down.

    What I want to know is, do the AnyFile, ExistingFile, and ExistingFiles modes of QFileDialog::FileMode allow for selecting directories as well as files on Windows? on Mac? If the ExistingFiles mode allows for selecting directories, does it allow for selecting files and directories at the same time on Windows? on Mac?

    I have alternative structures for my application in mind; I just need to make sure I don't miss any capability that is not documented. Thank you!


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    IIRC, you can select one or the other but not both at the same time.

Log in to reply