schrodinger.ui.sketcher_smarts_dialog module

class schrodinger.ui.sketcher_smarts_dialog.SketcherSMARTSDialog(title: str, parent=None)

Bases: schrodinger.ui.qt.basewidgets.BaseDialog

This class provides the functionality to get smarts from sketcher. Uses title to store/restore the geometry of dialog.

ui_module = <module 'schrodinger.ui.sketcher_smarts_dialog_ui' from '/scr/buildbot/savedbuilds/2024-2/NB/build-134/internal/lib/python3.11/site-packages/schrodinger/ui/sketcher_smarts_dialog_ui.py'>
__init__(title: str, parent=None)
Parameters
  • title – is title of the dialog.

  • parent – is parent widget.

setSmartsToSketcher(smarts: str)

Sets the smarts to sketcher. :param smarts: smarts to be shown in sketcher.

showSketcher(smarts: str) PyQt6.QtWidgets.QDialog.DialogCode

Shows the dialog. :param smarts: smarts to be shown in sketcher. :return: QDialog.Accepted or QDialog.Rejected when clicked on OK or Cancel button respectively.

getSMARTS() str

Gets the smarts from sketcher. :return: smarts if valid otherwise empty string.

setupDialogConnections()

Sets up the dialog connections.

onOKPressed()

Gets the structure from sketcher and if structure is invalid, shows the error message box and otherwise accepts the dialog.

clearSketcher()

Clears the sketcher structure.

schrodinger.ui.sketcher_smarts_dialog.get_smarts_from_sketcher(dialog_title: str, parent: PyQt6.QtWidgets.QWidget = None, initial_smarts: str = '') str

Gets the smarts from sketcher. :param dialog_title: is title of the dialog. :param parent: is parent widget. :param initial_smarts: smarts to be shown in sketcher. :return: smarts if valid otherwise empty string.