eric7.EricWidgets.EricPathPicker

Module implementing a path picker widget.

Global Attributes

None

Classes

EricComboPathPicker Class implementing a path picker widget consisting of a combobox and a tool button to open a file dialog.
EricPathPicker Class implementing a path picker widget consisting of a line edit and a tool button to open a file dialog.
EricPathPickerBase Class implementing the base of a path picker widget consisting of a line edit or combo box and a tool button to open a file dialog.
EricPathPickerModes Class implementing the path picker modes.

Functions

None


EricComboPathPicker

Class implementing a path picker widget consisting of a combobox and a tool button to open a file dialog.

Derived from

EricPathPickerBase

Class Attributes

None

Class Methods

None

Methods

EricComboPathPicker Constructor
getPathItems Public method to get the list of remembered paths.
getPathLibItems Public method to get the list of remembered paths.

Static Methods

None

EricComboPathPicker (Constructor)

EricComboPathPicker(parent=None)

Constructor

parent (QWidget)
reference to the parent widget

EricComboPathPicker.getPathItems

getPathItems()

Public method to get the list of remembered paths.

Return:
list of remembered paths
Return Type:
list of str

EricComboPathPicker.getPathLibItems

getPathLibItems()

Public method to get the list of remembered paths.

Return:
list of remembered paths
Return Type:
list of pathlib.Path
Up


EricPathPicker

Class implementing a path picker widget consisting of a line edit and a tool button to open a file dialog.

Derived from

EricPathPickerBase

Class Attributes

None

Class Methods

None

Methods

EricPathPicker Constructor

Static Methods

None

EricPathPicker (Constructor)

EricPathPicker(parent=None)

Constructor

parent (QWidget)
reference to the parent widget
Up


EricPathPickerBase

Class implementing the base of a path picker widget consisting of a line edit or combo box and a tool button to open a file dialog.

Signals

aboutToShowPathPickerDialog
emitted before the file dialog is shown
editTextChanged(path)
emitted when the entered path has changed (combo box based widget)
pathSelected(path)
emitted after a path has been selected via the file dialog
pickerButtonClicked
emitted when the picker button was pressed and the widget mode is custom
textChanged(path)
emitted when the entered path has changed (line edit based widget)

Derived from

QWidget

Class Attributes

DefaultMode

Class Methods

None

Methods

EricPathPickerBase Constructor
__pathEdited Private slot handling editing of the path.
__showPathPickerDialog Private slot to show the path picker dialog.
_editorText Protected method to get the text of the editor.
_setEditorText Protected method to set the text of the editor.
addItem Public method to add a paths to the current list.
addItems Public method to add paths to the current list.
buttonToolTip Public method to get the tool button tool tip.
clear Public method to clear the current path or list of paths.
clearEditText Public method to clear the current path.
currentText Public method to get the current path.
defaultDirectory Public method to get the default directory.
defaultDirectoryPath Public method to get the default directory as a pathlib.Path object.
editorEnabled Public method to get the path editor's enabled state.
editorToolTip Public method to get the editor tool tip.
filters Public methods to get the filter string.
firstPath Public method to get the first path of a list of entered paths.
isPickerEnabled Public method to get the file dialog button enabled state.
isReadOnly Public method to check the path picker for read only mode.
lastPath Public method to get the last path of a list of entered paths.
mode Public method to get the path picker mode.
path Public method to get the current path.
paths Public method to get the list of entered paths.
setButtonToolTip Public method to set the tool button tool tip.
setCurrentIndex Public slot to set the current index.
setCurrentPath Public method to set the current path.
setCurrentText Public slot to set the current text.
setDefaultDirectory Public method to set the default directory.
setEditText Public method to set the current path.
setEditorEnabled Public method to set the path editor's enabled state.
setEditorToolTip Public method to set the editor tool tip.
setFilters Public method to set the filters for the path picker dialog.
setInsertPolicy Public method to set the insertion policy of the combo box.
setMode Public method to set the path picker mode.
setNameFilters Public method to set the name filters for the completer.
setPath Public method to set the current path.
setPathsList Public method to set the paths list.
setPickerEnabled Public method to set the enabled state of the file dialog button.
setReadOnly Public method to set the path picker to read only mode.
setSizeAdjustPolicy Public method to set the size adjust policy of the combo box.
setText Public method to set the current path.
setWindowTitle Public method to set the path picker dialog window title.
text Public method to get the current path.
windowTitle Public method to get the path picker dialog's window title.

Static Methods

None

EricPathPickerBase (Constructor)

EricPathPickerBase(parent=None, useLineEdit=True)

Constructor

parent (QWidget)
reference to the parent widget
useLineEdit (bool)
flag indicating the use of a line edit

EricPathPickerBase.__pathEdited

__pathEdited(fpath)

Private slot handling editing of the path.

fpath (str)
current text of the path line edit

EricPathPickerBase.__showPathPickerDialog

__showPathPickerDialog()

Private slot to show the path picker dialog.

EricPathPickerBase._editorText

_editorText()

Protected method to get the text of the editor.

Return:
text of the editor
Return Type:
str

EricPathPickerBase._setEditorText

_setEditorText(text)

Protected method to set the text of the editor.

text (str)
text to set

EricPathPickerBase.addItem

addItem(fpath)

Public method to add a paths to the current list.

fpath (str or pathlib.Path)
path to add

EricPathPickerBase.addItems

addItems(pathsList)

Public method to add paths to the current list.

pathsList (list of str or pathlib.Path)
list of paths

EricPathPickerBase.buttonToolTip

buttonToolTip()

Public method to get the tool button tool tip.

Return:
tool tip text
Return Type:
str

EricPathPickerBase.clear

clear()

Public method to clear the current path or list of paths.

EricPathPickerBase.clearEditText

clearEditText()

Public method to clear the current path.

EricPathPickerBase.currentText

currentText(toNative=True)

Public method to get the current path.

toNative (bool)
flag indicating to convert the path into a native format
Return:
current path
Return Type:
str

EricPathPickerBase.defaultDirectory

defaultDirectory()

Public method to get the default directory.

Return:
default directory
Return Type:
str

EricPathPickerBase.defaultDirectoryPath

defaultDirectoryPath()

Public method to get the default directory as a pathlib.Path object.

Return:
default directory
Return Type:
pathlib.Path

EricPathPickerBase.editorEnabled

editorEnabled()

Public method to get the path editor's enabled state.

Return:
flag indicating the enabled state
Return Type:
bool

EricPathPickerBase.editorToolTip

editorToolTip()

Public method to get the editor tool tip.

Return:
tool tip text
Return Type:
str

EricPathPickerBase.filters

filters()

Public methods to get the filter string.

Return:
filter string
Return Type:
str

EricPathPickerBase.firstPath

firstPath()

Public method to get the first path of a list of entered paths.

Return:
first path
Return Type:
pathlib.Path

EricPathPickerBase.isPickerEnabled

isPickerEnabled()

Public method to get the file dialog button enabled state.

Return:
flag indicating the enabled state
Return Type:
bool

EricPathPickerBase.isReadOnly

isReadOnly()

Public method to check the path picker for read only mode.

Return:
flg indicating read only mode
Return Type:
bool

EricPathPickerBase.lastPath

lastPath()

Public method to get the last path of a list of entered paths.

Return:
last path
Return Type:
pathlib.Path

EricPathPickerBase.mode

mode()

Public method to get the path picker mode.

Return:
path picker mode
Return Type:
EricPathPickerModes

EricPathPickerBase.path

path()

Public method to get the current path.

Return:
current path
Return Type:
pathlib.Path

EricPathPickerBase.paths

paths()

Public method to get the list of entered paths.

Return:
entered paths
Return Type:
list of pathlib.Path

EricPathPickerBase.setButtonToolTip

setButtonToolTip(tooltip)

Public method to set the tool button tool tip.

tooltip (str)
text to be set as a tool tip

EricPathPickerBase.setCurrentIndex

setCurrentIndex(index)

Public slot to set the current index.

index (int)
index of the item to set current

EricPathPickerBase.setCurrentPath

setCurrentPath(fpath)

Public method to set the current path.

fpath (pathlib.Path)
current path

EricPathPickerBase.setCurrentText

setCurrentText(text)

Public slot to set the current text.

text (str)
text of the item to set current

EricPathPickerBase.setDefaultDirectory

setDefaultDirectory(directory)

Public method to set the default directory.

directory (str or pathlib.Path)
default directory

EricPathPickerBase.setEditText

setEditText(fpath, toNative=True)

Public method to set the current path.

fpath (str)
path to be set
toNative (bool)
flag indicating to convert the path into a native format

EricPathPickerBase.setEditorEnabled

setEditorEnabled(enable)

Public method to set the path editor's enabled state.

enable (bool)
flag indicating the enable state

EricPathPickerBase.setEditorToolTip

setEditorToolTip(tooltip)

Public method to set the editor tool tip.

tooltip (str)
text to be set as a tool tip

EricPathPickerBase.setFilters

setFilters(filters)

Public method to set the filters for the path picker dialog.

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

filters (str)
string containing the file filters

EricPathPickerBase.setInsertPolicy

setInsertPolicy(policy)

Public method to set the insertion policy of the combo box.

policy (QComboBox.InsertPolicy)
insertion policy

EricPathPickerBase.setMode

setMode(mode)

Public method to set the path picker mode.

mode (EricPathPickerModes)
picker mode
Raises ValueError:
raised to indicate a bad parameter value

EricPathPickerBase.setNameFilters

setNameFilters(filters)

Public method to set the name filters for the completer.

filters (list of str)
list of file name filters

EricPathPickerBase.setPath

setPath(fpath)

Public method to set the current path.

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

EricPathPickerBase.setPathsList

setPathsList(pathsList)

Public method to set the paths list.

pathsList (list of str or pathlib.Path)
list of paths

EricPathPickerBase.setPickerEnabled

setPickerEnabled(enable)

Public method to set the enabled state of the file dialog button.

enable (bool)
flag indicating the enabled state

EricPathPickerBase.setReadOnly

setReadOnly(readOnly)

Public method to set the path picker to read only mode.

readOnly (bool)
flag indicating read only mode

EricPathPickerBase.setSizeAdjustPolicy

setSizeAdjustPolicy(policy)

Public method to set the size adjust policy of the combo box.

policy (QComboBox.SizeAdjustPolicy)
size adjust policy

EricPathPickerBase.setText

setText(fpath, toNative=True)

Public method to set the current path.

fpath (str)
path to be set
toNative (bool)
flag indicating to convert the path into a native format

EricPathPickerBase.setWindowTitle

setWindowTitle(title)

Public method to set the path picker dialog window title.

title (str)
window title

EricPathPickerBase.text

text(toNative=True)

Public method to get the current path.

toNative (bool)
flag indicating to convert the path into a native format
Return:
current path
Return Type:
str

EricPathPickerBase.windowTitle

windowTitle()

Public method to get the path picker dialog's window title.

Return:
window title
Return Type:
str
Up


EricPathPickerModes

Class implementing the path picker modes.

Derived from

enum.Enum

Class Attributes

CUSTOM_MODE
DIRECTORY_MODE
DIRECTORY_SHOW_FILES_MODE
NO_MODE
OPEN_FILES_AND_DIRS_MODE
OPEN_FILES_MODE
OPEN_FILE_MODE
SAVE_FILE_ENSURE_EXTENSION_MODE
SAVE_FILE_MODE
SAVE_FILE_OVERWRITE_MODE

Class Methods

None

Methods

None

Static Methods

None
Up