schrodinger.ui.qt.appframework2.wizards module

schrodinger.ui.qt.appframework2.wizards.Actions

alias of schrodinger.ui.qt.appframework2.wizards.Action

class schrodinger.ui.qt.appframework2.wizards.BaseWizardPanel(*args, **kwargs)

Bases: schrodinger.ui.qt.appframework2.settings.SettingsPanelMixin, schrodinger.ui.qt.basewidgets.BaseWidget

finished

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

initSetOptions()

Suggested subclass use: set instance variables, excluding layouts and subwidgets. Also use here to (optionally) apply the legacy stylesheet spacing settings (PANEL-19101).

initSetUp()

Creates widget from ui and stores it ui_widget.

Suggested subclass use: create and initialize subwidgets, and connect signals.

initLayOut()

Create a vertical layout for the widget (widget_layout) and populate it with two vertical sub-layouts: main_layout and bottom_layout.

If the user has specified the ui data member, insert the resultant ui_widget into main_layout.

If the widget already has a layout defined, this method will produce a warning (but not a traceback). main_layout and bottom_layout will be inserted into the existing widget layout, which will not be the same as widget_layout. It is therefore recommended that this mixin is used only with widgets that do not already have a layout.

Suggested subclass use: create, initialize, and populate layouts.

initSetDefaults()

Set widget to its default state. If the widget uses a model/mapper, it’s preferable to reset the widget state by resetting the model.

onBackClicked()
onNextClicked()
onCancelClicked()
run(prev_panel_state=None)

Runs the panel. If the panel is being invoked by clicking “Next” on the previous panel, pass in the previous panel’s state so it can be processed.

Parameters

prev_panel_state (settings.PanelState or None) – the previous panel’s state

closeEvent(event)

Ensures proper handling of OK, Cancel, and [X] button clicks

show()

Override the show method to clear and previous value of self.accepted

processPrevPanel(state)

Override this method to receive the settings from the previous panel and processes them appropriately.

Parameters

state (settings.PanelState) – the state from the previous panel

processBack()

Override this method to perform necessary actions when going back

processNext()

Override this method to perform necessary actions when going to next A return value of False will stay in the current panel, any other value will continue to the next.

class schrodinger.ui.qt.appframework2.wizards.MultiPanelWizard

Bases: PyQt6.QtCore.QObject

The MultiPanelWizard allows a series of BaseWizardPanel instances to be chained together to create a wizard. It manages navigation between the panels as well as passing information from one panel to the next.

This class can be instantiated and used directly, or it can be subclassed for more complex cases.

finished

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

classmethod panel(run=True)

Launch a singleton instance of this class. If the wizard has already been instantiated, the existing wizard instance will be re-opened and brought to the front.

Parameters

run (bool) – Whether to launch the panel

Returns

The singleton panel instance

Return type

MultiPanelWizard

__init__()
addPanel(panel)

Add a panel to the wizard. Panels are chained in the order they are added.

Parameters

panel (BaseWizardPanel) – the panel to be added to the wizard’s chain

run()

Run the wizard.

currentPanel()

Returns the current panel or None if the wizard has not been started.

runCurrentPanel()

Runs the current panel.

processPanel()

This method will get called whenever a panel is dismissed (via Next, Back, or Cancel) and depending on the action chosen, will update the current panel index to the appropriate value and run it or terminate the wizard.

quit()

Exit the wizard

setup()

If subclassing, override this method to add logic to be run during initialization, such as adding wizard panels.

startup()

If subclassing, override this method to add logic to be run right before starting the wizard.

postProcess()

If subclassing, override this method to add logic to be run after the wizard has run. This method will be called whether the user finishes the wizard or stops midway. To determine what to do, check the value of self.current_panel_index.