schrodinger.ui.qt.standard_widgets.sketcher_text_widget module

class schrodinger.ui.qt.standard_widgets.sketcher_text_widget.SketcherTextWidget(parent=None, allow_disconnected_smarts=False)

Bases: MapperMixin, BaseWidget

Widget that allows for displaying a LineEdit and a button that opens a sketcher dialog. The LineEdit can be edited directly or populated using the SMARTS pattern returned by sketcher.

Variables:

allow_disconnected_smarts – Whether a sketched structure may produce a disconnected SMARTS (multiple fragments joined by ‘.’). When False, the user is warned and the value is discarded.

ui_module = <module 'schrodinger.ui.qt.standard_widgets.sketcher_text_widget_ui' from '/scr/buildbot/builds/build/internal/lib/python3.11/site-packages/schrodinger/ui/qt/standard_widgets/sketcher_text_widget_ui.py'>
__init__(parent=None, allow_disconnected_smarts=False)
initSetUp()

Creates widget from ui and stores it ui_widget.

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

value() str

Get the text that is currently displayed

setValue(data: str)

Set the text displayed in the LineEdit

Parameters:

data – new text to display

onSketcherBtnClicked()

Open sketcher and set the LineEdit’s text to the returned SMARTS pattern.

Unless allow_disconnected_smarts is set, a disconnected SMARTS (multiple fragments joined by ‘.’) is rejected with a warning.