# eric7.EricWidgets.EricDirFileDialog

Module implementing a dialog to select files and directories simultaneously.

### Global Attributes

None

### Classes

EricDirFileDialog | Derived QFileDialog to select files and directories simultaneously.

### Functions

None

## EricDirFileDialog

Derived QFileDialog to select files and directories simultaneously.

For this purpose the none native file dialog is used.

### Derived from

QFileDialog

### Class Attributes

None

### Class Methods

None

### Methods

EricDirFileDialog | Constructor
accept | Public slot to update the list with the selected files and folders.
exec | Public slot to finalize initialization and start the event loop.
on_directoryEntered | Private slot to reset selections if another directory was entered.
on_selectionChanged | Private method to determine the selected files and folders and update the line edit.

### Static Methods

getOpenFileAndDirNames | Static method to get the names of files and directories for opening it.

#### EricDirFileDialog (Constructor)

EricDirFileDialog(parent=None, caption="", directory="", filterStr="")

Constructor

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

#### EricDirFileDialog.accept

accept()

Public slot to update the list with the selected files and folders.

#### EricDirFileDialog.exec

exec()

Public slot to finalize initialization and start the event loop.

Return:
  accepted or rejected

Return Type:
  QDialog.DialogCode

#### EricDirFileDialog.on_directoryEntered

on_directoryEntered(directory)

Private slot to reset selections if another directory was entered.

directory (str)
  name of the directory entered

#### EricDirFileDialog.on_selectionChanged

on_selectionChanged(selected, deselected)

Private method to determine the selected files and folders and update the line edit.

selected (QItemSelection)
  newly selected entries
deselected (QItemSelection)
  deselected entries

#### EricDirFileDialog.getOpenFileAndDirNames (static)

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

Static method to get the names of files and directories 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:
  names of the selected files and folders

Return Type:
  list of str

Up