# eric7.EricWidgets.EricPathPickerDialog

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

### Global Attributes

None

### Classes

EricPathPickerDialog | 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.
getStrPath | Function to get a file or directory path from the user.

## EricPathPickerDialog

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

### Derived from

QDialog

### Class Attributes

None

### Class Methods

None

### Methods

EricPathPickerDialog | Constructor
getPath | Public method to get the current path as a pathlib.Path object.
getText | Public method to get the current path as text.
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

#### EricPathPickerDialog (Constructor)

EricPathPickerDialog(parent=None)

Constructor

parent (QWidget)
  reference to the parent widget

#### EricPathPickerDialog.getPath

getPath()

Public method to get the current path as a pathlib.Path object.

Return:
  current path

Return Type:
  pathlib.Path

#### EricPathPickerDialog.getText

getText()

Public method to get the current path as text.

Return:
  current path

Return Type:
  str

#### EricPathPickerDialog.setDefaultDirectory

setDefaultDirectory(directory)

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

directory (str or pathlib.Path)
  default directory

#### EricPathPickerDialog.setLabelText

setLabelText(text)

Public method to set the label text.

text (str)
  label text

#### EricPathPickerDialog.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

#### EricPathPickerDialog.setPickerMode

setPickerMode(mode)

Public method to set the mode of the path picker.

mode (EricPathPickerModes)
  picker mode

#### EricPathPickerDialog.setPickerPath

setPickerPath(fpath)

Public method to set the path of the path picker.

fpath (str or pathlib.Path)
  path to be set

#### EricPathPickerDialog.setTitle

setTitle(title)

Public method to set the window title.

title (str)
  window title

Up

## getPath

getPath(parent, title, label, mode=EricPathPickerModes.OPEN_FILE_MODE, pathlibPath=None, defaultDirectory=None, 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 (EricPathPickerModes (optional))
  mode of the path picker (defaults to EricPathPickerModes.OPEN_FILE_MODE)
pathlibPath (pathlib.Path (optional))
  initial path to be shown (defaults to None)
defaultDirectory (pathlib.Path (optional))
  default directory of the path picker selection dialog (defaults to None)
filters (list of str (optional))
  list of file filters (defaults to None)

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

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

Up

## getStrPath

getStrPath(parent, title, label, mode=EricPathPickerModes.OPEN_FILE_MODE, strPath=None, defaultDirectory=None, 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 (EricPathPickerModes (optional))
  mode of the path picker (defaults to EricPathPickerModes.OPEN_FILE_MODE)
strPath (str (optional))
  initial path to be shown (defaults to None)
defaultDirectory (str (optional))
  default directory of the path picker selection dialog (defaults to None)
filters (list of str (optional))
  list of file filters (defaults to None)

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

Return Type:
  tuple of (str, bool)

Up