schrodinger.application.models.gui.details_widget module¶
Details widget for Model Hub.
A generic widget that displays name, description, and key-value info rows. The panel controls what data is displayed based on the current selection.
- class schrodinger.application.models.gui.details_widget.DetailsModel(*args, _param_type=<object object>, **kwargs)¶
Bases:
CompoundParamModel for the details widget.
- Variables:
name – The name to display in the header.
description – The description text.
info_rows – List of (label, value) tuples to display in the info grid.
show_placeholder – If True, show the placeholder instead of details.
- name: str¶
A parameter of the class.
- description: str¶
A parameter of the class.
- info_rows: list¶
A parameter of the class.
- show_placeholder: bool¶
A parameter of the class.
- descriptionChanged¶
A
pyqtSignalemitted by instances of the class.
- descriptionReplaced¶
A
pyqtSignalemitted by instances of the class.
- info_rowsChanged¶
A
pyqtSignalemitted by instances of the class.
- info_rowsReplaced¶
A
pyqtSignalemitted by instances of the class.
- nameChanged¶
A
pyqtSignalemitted by instances of the class.
- nameReplaced¶
A
pyqtSignalemitted by instances of the class.
- show_placeholderChanged¶
A
pyqtSignalemitted by instances of the class.
- show_placeholderReplaced¶
A
pyqtSignalemitted by instances of the class.
- class schrodinger.application.models.gui.details_widget.DetailsWidget(*args, **kwargs)¶
Bases:
MapperMixin,BaseWidgetWidget that displays details about a selected item.
Shows a name, description, and a grid of info rows. When nothing is selected, shows a placeholder message.
- Signal moreOptionsClicked:
Emitted when the more options button is clicked. The parent widget should handle showing the appropriate context menu.
- model_class¶
alias of
DetailsModel
- moreOptionsClicked¶
A
pyqtSignalemitted by instances of the class.
- initSetUp()¶
Creates widget from
uiand stores itui_widget.Suggested subclass use: create and initialize subwidgets, and connect signals.
- initLayOut()¶
@overrides: widgetmixins.InitMixin
- defineMappings()¶
Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:
a basic widget, like
QLineEditorQComboBoxa custom object that inherits
MapperMixinorTargetMixina
TargetSpecinstancea slot
For common widgets, standard signals and getter/setter methods will be used, as defined in
mappers._get_default_access_names().For more fine-grained custom control, instantiate a
TargetSpecobject, which allows custom setters, getters, and signals to be specified.Supplying a slot as the first element of the tuple is equivalent to providing
TargetSpec(slot=my_slot).Note that all target slots are triggered on
setModel()as well as in response to the specified signal.The param is an abstract param reference, e.g. MyModel.my_param.
Example:
def defineMappings(self): combo = self.style_combo return [(self.name_le, MyModel.name), (TargetSpec(combo, getter=combo.currentText, setter=combo.setCurrentText), MyModel.style), (self.coord_widget, MyModel.coord), (self._onASLTextChanged, MyModel.asl_text)]
- setShowPlaceholder(show: bool) None¶
Show or hide the placeholder view.
- Parameters:
show – If True, show the placeholder; otherwise show details.
- setName(name: str) None¶
Set the name displayed in the header.
- Parameters:
name – The name to display.
- setDescription(description: str) None¶
Set the description text.
- Parameters:
description – The description to display.
- setInfoRows(rows: list[tuple[str, str]]) None¶
Set the info rows displayed in the grid.
- Parameters:
rows – List of (label, value) tuples to display.