# eric7.EricWidgets.EricFileDialog

Module implementing alternative functions for the QFileDialog static methods.

### Global Attributes

DontConfirmOverwrite
DontResolveSymlinks
DontUseCustomDirectoryIcons
DontUseNativeDialog
HideNameFilterDetails
Option
ReadOnly
ShowDirsOnly

### Classes

None

### Functions

__reorderFilter | Private function to reorder the file filter to cope with a KDE issue introduced by distributor's usage of KDE file dialogs.
getExistingDirectory | Module function to get the name of a directory.
getExistingDirectoryPath | Module function to get the path of a directory.
getOpenFilPathsAndFilter | Module function to get a list of paths of files for opening and the selected file name filter.
getOpenFileAndDirNames | Module function to get the names of files and directories for opening.
getOpenFileAndDirPaths | Module function to get the paths of files and directories for opening.
getOpenFileName | Module function to get the name of a file for opening it.
getOpenFileNameAndFilter | Module function to get the name of a file for opening it and the selected file name filter.
getOpenFileNames | Module function to get a list of names of files for opening.
getOpenFileNamesAndFilter | Module function to get a list of names of files for opening and the selected file name filter.
getOpenFilePath | Module function to get the path of a file for opening it.
getOpenFilePathAndFilter | Module function to get the path of a file for opening it and the selected file name filter.
getOpenFilePaths | Module function to get a list of paths of files for opening.
getSaveFileName | Module function to get the name of a file for saving.
getSaveFileNameAndFilter | Module function to get the name of a file for saving and the selected file name filter.
getSaveFilePath | Module function to get the path of a file for saving.
getSaveFilePathAndFilter | Module function to get the path of a file for saving and the selected file name filter.

## __reorderFilter

__reorderFilter(filterStr, initialFilter="")

Private function to reorder the file filter to cope with a KDE issue introduced by distributor's usage of KDE file dialogs.

filterStr (str)
  Qt file filter
initialFilter (str)
  initial filter

Return:
  the rearranged Qt file filter

Return Type:
  str

Up

## getExistingDirectory

getExistingDirectory(parent=None, caption="", directory="", options=QFileDialog.Option.ShowDirsOnly)

Module function to get the name of a directory.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str)
  working directory of the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  name of selected directory

Return Type:
  str

Up

## getExistingDirectoryPath

getExistingDirectoryPath(parent=None, caption="", directory="", options=QFileDialog.Option.ShowDirsOnly)

Module function to get the path of a directory.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str or pathlib.Path)
  working directory of the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  path of selected directory

Return Type:
  pathlib.Path

Up

## getOpenFilPathsAndFilter

getOpenFilPathsAndFilter(parent=None, caption="", directory="", filterStr="", initialFilter="", options=None)

Module function to get a list of paths of files for opening and the selected file name filter.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str or pathlib.Path)
  working directory of the dialog
filterStr (str)
  filter string for the dialog
initialFilter (str)
  initial filter for the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  list of file paths to be opened and selected filter

Return Type:
  tuple of (list of pathlib.Path, str)

Up

## getOpenFileAndDirNames

getOpenFileAndDirNames(parent=None, caption="", directory="", filterStr="", options=None)

Module function to get the names of files and directories for opening.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str)
  working directory of the dialog
filterStr (str)
  filter string for the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  names of the selected files and folders

Return Type:
  list of str

Up

## getOpenFileAndDirPaths

getOpenFileAndDirPaths(parent=None, caption="", directory="", filterStr="", options=None)

Module function to get the paths of files and directories for opening.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str or pathlib.Path)
  working directory of the dialog
filterStr (str)
  filter string for the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  paths of the selected files and folders

Return Type:
  list of pathlib.Path

Up

## getOpenFileName

getOpenFileName(parent=None, caption="", directory="", filterStr="", options=None)

Module function to get the name of a file for opening it.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str)
  working directory of the dialog
filterStr (str)
  filter string for the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  name of file to be opened

Return Type:
  str

Up

## getOpenFileNameAndFilter

getOpenFileNameAndFilter(parent=None, caption="", directory="", filterStr="", initialFilter="", options=None)

Module function to get the name of a file for opening it and the selected file name filter.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str)
  working directory of the dialog
filterStr (str)
  filter string for the dialog
initialFilter (str)
  initial filter for the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  name of file to be opened and selected filter

Return Type:
  tuple of (str, str)

Up

## getOpenFileNames

getOpenFileNames(parent=None, caption="", directory="", filterStr="", options=None)

Module function to get a list of names of files for opening.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str)
  working directory of the dialog
filterStr (str)
  filter string for the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  list of file names to be opened

Return Type:
  list of str

Up

## getOpenFileNamesAndFilter

getOpenFileNamesAndFilter(parent=None, caption="", directory="", filterStr="", initialFilter="", options=None)

Module function to get a list of names of files for opening and the selected file name filter.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str)
  working directory of the dialog
filterStr (str)
  filter string for the dialog
initialFilter (str)
  initial filter for the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  list of file names to be opened and selected filter

Return Type:
  tuple of (list of str, str)

Up

## getOpenFilePath

getOpenFilePath(parent=None, caption="", directory="", filterStr="", options=None)

Module function to get the path of a file for opening it.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str or pathlib.Path)
  working directory of the dialog
filterStr (str)
  filter string for the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  path of file to be opened

Return Type:
  pathlib.Path

Up

## getOpenFilePathAndFilter

getOpenFilePathAndFilter(parent=None, caption="", directory="", filterStr="", initialFilter="", options=None)

Module function to get the path of a file for opening it and the selected file name filter.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str or pathlib.Path)
  working directory of the dialog
filterStr (str)
  filter string for the dialog
initialFilter (str)
  initial filter for the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  path of file to be opened and selected filter

Return Type:
  tuple of (pathlib.Path, str)

Up

## getOpenFilePaths

getOpenFilePaths(parent=None, caption="", directory="", filterStr="", options=None)

Module function to get a list of paths of files for opening.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str or pathlib.Path)
  working directory of the dialog
filterStr (str)
  filter string for the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  list of file paths to be opened

Return Type:
  list of pathlib.Path

Up

## getSaveFileName

getSaveFileName(parent=None, caption="", directory="", filterStr="", options=None)

Module function to get the name of a file for saving.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str)
  working directory of the dialog
filterStr (str)
  filter string for the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  name of file to be saved

Return Type:
  str

Up

## getSaveFileNameAndFilter

getSaveFileNameAndFilter(parent=None, caption="", directory="", filterStr="", initialFilter="", options=None)

Module function to get the name of a file for saving and the selected file name filter.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str)
  working directory of the dialog
filterStr (str)
  filter string for the dialog
initialFilter (str)
  initial filter for the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  name of file to be saved and selected filte

Return Type:
  tuple of (str, str)

Up

## getSaveFilePath

getSaveFilePath(parent=None, caption="", directory="", filterStr="", options=None)

Module function to get the path of a file for saving.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str or pathlib.Path)
  working directory of the dialog
filterStr (str)
  filter string for the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  path of file to be saved

Return Type:
  pathlib.Path

Up

## getSaveFilePathAndFilter

getSaveFilePathAndFilter(parent=None, caption="", directory="", filterStr="", initialFilter="", options=None)

Module function to get the path of a file for saving and the selected file name filter.

parent (QWidget)
  parent widget of the dialog
caption (str)
  window title of the dialog
directory (str or pathlib.Path)
  working directory of the dialog
filterStr (str)
  filter string for the dialog
initialFilter (str)
  initial filter for the dialog
options (QFileDialog.Options)
  various options for the dialog

Return:
  path of file to be saved and selected filte

Return Type:
  tuple of (pathlib.Path, str)

Up