# eric6.E5Gui.E5PathPickerDialog

Module implementing a dialog to enter a file system path using a file picker.

### Global Attributes

None

### Classes

E5PathPickerDialog | Class implementing a dialog to enter a file system path using a file picker.

### Functions

getPath | Function to get a file or directory path from the user.

## E5PathPickerDialog

Class implementing a dialog to enter a file system path using a file picker.

### Derived from

QDialog

### Class Attributes

None

### Class Methods

None

### Methods

E5PathPickerDialog | Constructor
getPath | Public method to get the current path.
setDefaultDirectory | Public method to set the default directory of the path picker.
setLabelText | Public method to set the label text.
setPickerFilters | Public method to set the filters of the path picker.
setPickerMode | Public method to set the mode of the path picker.
setPickerPath | Public method to set the path of the path picker.
setTitle | Public method to set the window title.

### Static Methods

None

#### E5PathPickerDialog (Constructor)

E5PathPickerDialog(parent=None)

Constructor

parent (QWidget)
  reference to the parent widget

#### E5PathPickerDialog.getPath

getPath()

Public method to get the current path.

Returns:
  current path

Return Type:
  str

#### E5PathPickerDialog.setDefaultDirectory

setDefaultDirectory(directory)

Public method to set the default directory of the path picker.

directory (str)
  default directory

#### E5PathPickerDialog.setLabelText

setLabelText(text)

Public method to set the label text.

text (str)
  label text

#### E5PathPickerDialog.setPickerFilters

setPickerFilters(filters)

Public method to set the filters of the path picker.

Note: Multiple filters must be separated by ';;'.

filters (str)
  string containing the file filters

#### E5PathPickerDialog.setPickerMode

setPickerMode(mode)

Public method to set the mode of the path picker.

mode (E5PathPickerModes)
  picker mode

#### E5PathPickerDialog.setPickerPath

setPickerPath(path)

Public method to set the path of the path picker.

path (str)
  path to be set

#### E5PathPickerDialog.setTitle

setTitle(title)

Public method to set the window title.

title (str)
  window title

Up

## getPath

getPath(parent, title, label, mode=E5PathPickerModes.OpenFileMode, path="", defaultDirectory="", filters=None)

Function to get a file or directory path from the user.

parent (QWidget)
  reference to the parent widget
title (str)
  title of the dialog
label (str)
  text to be shown above the path picker
mode (E5PathPickerModes)
  mode of the path picker
path (str)
  initial path to be shown
defaultDirectory (str)
  default directory of the path picker selection dialog
filters (list of str)
  list of file filters

Returns:
  tuple containing the entered path and a flag indicating that the user pressed the OK button

Return Type:
  tuple of (str, bool)

Up