FileDialog: table of contents
Classes | GUI > Accessories

FileDialog : QObject : Object

Operating system interface for Open file, save file, select directory dialogs
Subclasses: QFileDialog


This is the interface for your standard operating system modal file dialogs to open files, save files and select directories.

See also Dialog which makes it a bit simpler without the need to set fileMode and acceptMode manually.

At the moment selecting a directory is only possible with FileDialog.

Class Methods, cancelFunc, fileMode, acceptMode, stripResult: false)

Open a modal dialog



handler function for: user selected a file and clicked ok. Argument to the function is either a single path, an array of paths, or multiple paths passed in as separate arguments. This depends on what fileMode and stripResult were specified.


handler function for: user cancelled



Determines the type of dialog.

  • 0 QFileDialog AnyFile The name of a file, whether it exists or not.
  • 1 QFileDialog ExistingFile The name of a single existing file.
  • 2 QFileDialog Directory The name of a directory. Both files and directories are displayed.
  • 3 QFileDialog ExistingFiles The names of zero or more existing files.

0 or 3 implies that the user can type in a new file name.


Integer This determines what the accept button says: "Open" or "Save"

  • 0 QFileDialog AcceptOpen
  • 1 QFileDialog AcceptSave

If selecting multiple files (using fileMode 3) then you have the choice of having your okFunc called with a list or with each of the paths as separate items.

If you want to select only one item then use stripResult = true so that your okFunc will be passed the item instead of a list.

  • true: okFunc(path1, path2, path3)
  • false: okFunc(paths)


a FileDialog



Inherited class methods

Instance Methods

Inherited instance methods


FileDialog({ |path|

}, {