schrodinger.application.models.gui.components.model_tree_view module

Tree view widget for displaying model configurations.

Provides a hierarchical view of configurations with context menu support and selection signals.

class schrodinger.application.models.gui.components.model_tree_view.ConfigurationItem(config: ModelConfiguration)

Bases: QStandardItem

Tree item for a model configuration.

Stores a reference to the configuration and provides display data.

__init__(config: ModelConfiguration)
class schrodinger.application.models.gui.components.model_tree_view.ConfigurationsTreeModel(parent=None)

Bases: QStandardItemModel

Tree model that displays configurations for a single model definition.

Root level contains top-level configurations (children of the definition), with nested configurations shown as children of their parent configs.

__init__(parent=None)
setModelTree(model_tree: ModelTree) None

Set the model tree and build the configuration hierarchy.

Parameters:

model_tree – The model tree containing the definition and configs

getConfigFromIndex(index: QModelIndex) ModelConfiguration | None

Get the configuration for a given index.

Parameters:

index – The model index

Returns:

The ModelConfiguration, or None if invalid

data(index: QModelIndex, role: int = ItemDataRole.DisplayRole)

Override to provide validation-aware display.

headerData(section: int, orientation: Orientation, role: int = ItemDataRole.DisplayRole)

Override to provide header data.

class schrodinger.application.models.gui.components.model_tree_view.ConfigurationsTreeView(parent=None)

Bases: TreeView

Tree view widget for displaying configurations of a single definition.

Provides a hierarchical view of configurations with context menu support and selection signals.

configurationSelected

A pyqtSignal emitted by instances of the class.

runModelClicked

A pyqtSignal emitted by instances of the class.

viewReceiptsClicked

A pyqtSignal emitted by instances of the class.

copyConfigurationClicked

A pyqtSignal emitted by instances of the class.

editConfigurationClicked

A pyqtSignal emitted by instances of the class.

createChildConfigClicked

A pyqtSignal emitted by instances of the class.

deleteConfigurationClicked

A pyqtSignal emitted by instances of the class.

__init__(parent=None)
setRunModelEnabled(enabled: bool) None

Enable or disable the “Run model” action for both double-click and context menu.

Parameters:

enabled – Whether the run model action should be enabled

setReceiptsVisible(visible: bool) None

Show or hide receipt-related actions in the context menu.

Parameters:

visible – Whether receipt actions should be visible

setModelTree(model_tree: ModelTree) None

Set the model tree and refresh the tree display.

Parameters:

model_tree – The model tree to display

setFilterString(filter_str: str) None

Filter tree items by name.

Parameters:

filter_str – The filter string (case-insensitive)

selectConfiguration(config: ModelConfiguration) None

Select the given configuration in the tree.

Parameters:

config – The configuration to select

clearSelection() None

Clear the current selection and current index.

selectionChanged(selected, deselected) None

Emit selection signal when selection changes.