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: CompoundParam

Model 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 pyqtSignal emitted by instances of the class.

descriptionReplaced

A pyqtSignal emitted by instances of the class.

info_rowsChanged

A pyqtSignal emitted by instances of the class.

info_rowsReplaced

A pyqtSignal emitted by instances of the class.

nameChanged

A pyqtSignal emitted by instances of the class.

nameReplaced

A pyqtSignal emitted by instances of the class.

show_placeholderChanged

A pyqtSignal emitted by instances of the class.

show_placeholderReplaced

A pyqtSignal emitted by instances of the class.

class schrodinger.application.models.gui.details_widget.DetailsWidget(*args, **kwargs)

Bases: MapperMixin, BaseWidget

Widget 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 pyqtSignal emitted by instances of the class.

initSetUp()

Creates widget from ui and stores it ui_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:

  1. a basic widget, like QLineEdit or QComboBox

  2. a custom object that inherits MapperMixin or TargetMixin

  3. a TargetSpec instance

  4. a 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 TargetSpec object, 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.