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.


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

Return:
current path
Return Type:
str

EricPathPickerDialog.setDefaultDirectory

setDefaultDirectory(directory)

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

directory (str)
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(path)

Public method to set the path of the path picker.

path (str)
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, 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 (EricPathPickerModes)
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
Return:
tuple containing the entered path and a flag indicating that the user pressed the OK button
Return Type:
tuple of (str, bool)
Up