schrodinger.ui.qt.mapperwidgets.plpsearchableselector module

A searchable selector widget for ParamListParam items. Shows a read-only line edit displaying the currently selected item; clicking it opens a popup with a search field and a filterable PLPTable.

Usage mirrors PLPComboBox — see scripts/examples/plpsearchableselector_gui.py for a working example.

class schrodinger.ui.qt.mapperwidgets.plpsearchableselector.SearchableSelectorSpec(*args, _param_type=<object object>, **kwargs)

Bases: TableSpec

Single-column table spec for the searchable selector. Subclass this and override makeItemText to control the display string for each item.

max_popup_rows: int

A parameter of the class.

item_col = <schrodinger.ui.qt.mapperwidgets.plptable.ParamColumn object>
makeItemText(param: CompoundParam) str

Return the display string for the given param.

Parameters:

param – a single item from the PLP

Raises:

NotImplementedError – subclasses must override this

columnsChanged

A pyqtSignal emitted by instances of the class.

columnsReplaced

A pyqtSignal emitted by instances of the class.

max_popup_rowsChanged

A pyqtSignal emitted by instances of the class.

max_popup_rowsReplaced

A pyqtSignal emitted by instances of the class.

class schrodinger.ui.qt.mapperwidgets.plpsearchableselector.PLPSearchableSelector

Bases: PLPTargetMixin, QWidget

Searchable selector for ParamListParam items.

Usage mirrors PLPComboBox:

selector = PLPSearchableSelector()
selector.setSpec(MySpec())

# In defineMappings:
(selector, M.items),
(selector.selection_target, M.selected_items),
__init__() None
setSpec(spec: SearchableSelectorSpec)
selectedParams() list[CompoundParam]
setSelectedParams(params: list[CompoundParam])
getDisplayText(param: CompoundParam) str

Return the text shown in the display line edit for the selected item.

Defaults to spec.makeItemText. Override to show a different string in the line edit than in the dropdown rows.

Parameters:

param – the currently selected item

eventFilter(self, a0: Optional[QObject], a1: Optional[QEvent]) bool