schrodinger.ui.qt.mapperwidgets.plpwidget module¶
- class schrodinger.ui.qt.mapperwidgets.plpwidget.BaseItemWidget(*args, **kwargs)¶
Bases:
MapperMixin,BaseWidgetBase class for widgets that represent a single item in a PLP. The widget’s model_class should be set to the item class of the PLP, and mapped as usual using defineMappings.
If the PLPWidget (for the whole PLP) supports selection, this widget class should implement
isSelectedandsetSelected, as well as emit theselectionChangedsignal when the selection state changes (e.g. when a checkbox is toggled).The delete method allows the widget to contain its own delete button (e.g. a trash can or “X” icon) to trigger deletion of its model from the PLP.
- deleteRequested¶
A
pyqtSignalemitted by instances of the class.
- selectionChanged¶
A
pyqtSignalemitted by instances of the class.
- delete()¶
Connect this slot to a delete button in the widget to allow deletion of an item from the PLP.
- isSelected()¶
- setSelected(selected: bool)¶
- Default = 'default'¶
- Panel = 'panel'¶
- class schrodinger.ui.qt.mapperwidgets.plpwidget.PLPCompositeWidget(*args, spec=None, **kwargs)¶
Bases:
PLPTargetMixin,BaseWidgetBase class for a widget that represents a ParamListParam (PLP) as a list of item widgets (BaseItemWidget). Subclasses must implement makeItemWidget and insertItemWidget to create and add item widgets to the layout.
- initSetUp()¶
Creates widget from
uiand stores itui_widget.Suggested subclass use: create and initialize subwidgets, and connect signals.
- makeItemWidget(param) BaseItemWidget¶
Override to return a new instance of a BaseItemWidget subclass for displaying an item in the PLP.
The actual item is passed in as
param. In the simple case of returning a standard widget for all items, this parameter can be ignored. It can however be used to customize the widget based on the param.
- insertItemWidget(idx, item_widget)¶
Override to insert the item_widget into the PLPWidget. Typically this means adding it to a layout using insertWidget.
- deleteParam(param)¶
- selectedParams()¶
This method is called by the selection target to get the currently selected params based on the item widgets’ selection state.
- setSelectedParams(params: list[CompoundParam])¶
This method is called by the selection target to set item widgets’ selection state based on the given list of selected params.
- Default = 'default'¶
- Panel = 'panel'¶