schrodinger.ui.qt.directory_selector module¶
Module containing DirectorySelector. The widget’s directory selection can be obtained by mapping the widget to a param or alternatively by connecting a slot to the directoryChanged signal.
To use without mapping, hook up the directoryChanged signal to a
slot that calls DirectorySelector.getDirPath().
- class schrodinger.ui.qt.directory_selector.DirectorySelector(parent: Optional[QWidget] = None, initial_dir: Optional[str] = None)¶
Bases:
TargetMixin,BaseWidgetWidget for showing an entry field and a browse button to let the user specify a single directory.
- Variables:
directoryChanged (QtCore.pyqtSignal) – Signal emitted when the directory selection changes.
- directoryChanged¶
A
pyqtSignalemitted by instances of the class.
- __init__(parent: Optional[QWidget] = None, initial_dir: Optional[str] = None)¶
- Parameters:
parent – Parent widget.
initial_dir – Initial directory. Default is CWD.
- initSetUp()¶
Creates widget from
uiand stores itui_widget.Suggested subclass use: create and initialize subwidgets, and connect signals.
- initLayOut()¶
Create a vertical layout for the widget (
widget_layout) and populate it with two vertical sub-layouts:main_layoutandbottom_layout.If the user has specified the
uidata member, insert the resultantui_widgetintomain_layout.If the widget already has a layout defined, this method will produce a warning (but not a traceback).
main_layoutandbottom_layoutwill be inserted into the existing widget layout, which will not be the same aswidget_layout. It is therefore recommended that this mixin is used only with widgets that do not already have a layout.Suggested subclass use: create, initialize, and populate layouts.
- setLabelText(text: str)¶
Set the label text to the left of the line edit.
- getDirectoryPath() str¶
Return the currently selected directory path. Allows access to target
- targetGetValue() str¶
Return the line edit text.
- targetSetValue(value: str)¶
Set the line edit text based for a valid
valueand emit two signals: targetValueChanged for when this widget mapped to a param, and directoryChanged for when it is not.- Parameters:
value – The directory path to set to the line edit.