schrodinger.ui.qt.delegates module

class schrodinger.ui.qt.delegates.CenteredIconDelegate[source]

Bases: PyQt5.QtWidgets.QStyledItemDelegate

Displays a center-aligned icon based on a QPixmap received from Qt.DecorationRole. Does nothing if Qt.DecorationRole returns None.

paint(painter, option, index)[source]

Paint the icon supplied by QDecorationRole into each cell.

Parameters
  • painter (QPainter) – The painter being used to render the delegate

  • option (QStyleOptionViewItem) – The style options to use when painting

  • index (QtCore.QModelIndex) – The index being represented

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(self, QEvent, QAbstractItemModel, QStyleOptionViewItem, QModelIndex) → bool
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.AbstractDelegateWithEditIcon(*args, **kwargs)[source]

Bases: PyQt5.QtWidgets.QStyledItemDelegate

A base class for delegates that paint an edit icon.

Variables

EDIT_ICON (str) – The file name for the icon to paint on editable cells. This file must be in the same directory as this module.

EDIT_ICON = ':/schrodinger/ui/qt/icons_dir/pencil_icon.ico'
__init__(*args, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(self, QEvent, QAbstractItemModel, QStyleOptionViewItem, QModelIndex) → bool
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

paint(self, QPainter, QStyleOptionViewItem, QModelIndex)
parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.LineEditDelegate(*args, **kwargs)[source]

Bases: schrodinger.ui.qt.delegates.AbstractDelegateWithEditIcon

Delegate recommended for use with all Schrodinger table model. It’s just like the standard Qt delegate, except that if a table cell has the ItemIsEditable flag set, it will draw a “pencil” icon on the right side of the cell.

QLineEdit widget will be shown for cells that return str values for data, and QSpinBox widget will be shown for cells that return int or float values. To limit allowed min/max values, use SpinBoxDelegate.

paint(self, QPainter, QStyleOptionViewItem, QModelIndex)[source]
EDIT_ICON = ':/schrodinger/ui/qt/icons_dir/pencil_icon.ico'
EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(self, QEvent, QAbstractItemModel, QStyleOptionViewItem, QModelIndex) → bool
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.MouseTrackingDelegateMixin(view)[source]

Bases: object

A mixin for a QtWidgets.QStyledItemDelegate that tracks which cell the mouse is in.

__init__(view)[source]
Parameters

view (QtWidgets.QTableView) – The view that this delegate will be added to. Note that mouse tracking will be enabled in the view

property mouse_data

Returns the data for the cell that the mouse is in.

Returns

the data for the cell that the mouse is on or None

Return type

object

createEditor(parent, option, index)[source]

This delegate does not have a separate editor widget, so we return None. All arguments are ignored, but are present for Qt compatibility.

eventFilter(viewport, event)[source]

The delegate does not receive Leave events or MouseMove events that don’t occur over an index (e.g. events that occur over a header or over blank space in the view), so we have to act as an event filter for the view’s viewport to observe these events.

Parameters
  • viewport (QtWidgets.QWidget) – The view’s viewport. Not used, but present for compatibility with Qt’s event filtering.

  • event (QtCore.QEvent) – The event to filter

Returns

True if the event was handled and does not need to be passed to the viewport. False otherwise. We want all events to be passed to the viewport, so we always return False.

Return type

bool

class schrodinger.ui.qt.delegates.PushButtonDelegate(view, role=None)[source]

Bases: schrodinger.ui.qt.delegates.MouseTrackingDelegateMixin, PyQt5.QtWidgets.QStyledItemDelegate

A delegate containing a clickable push button. The button name will be taken from the Qt.DisplayRole data. Then clicked, this delegate will emit a clicked signal with either:

  • If role is None, a QtCore.QModelIndex for the cell that was clicked.

  • Otherwise, the role data for the cell that was clicked.

clicked
__init__(view, role=None)[source]
Parameters
  • view (QtWidgets.QTableView) – The view that this delegate will be added to. Note that mouse tracking will be enabled in the view.

  • role (int or NoneType) – The role to emit data for when a button is clicked. If not given, the index that was clicked will be emitted instead. This value may be specified after instantiation using setRole.

setRole(role)[source]

Specify the role to emit data for when a button is clicked. If None, the index that was clicked will be emitted instead.

Parameters

role (int or NoneType) – The role

paint(self, QPainter, QStyleOptionViewItem, QModelIndex)[source]
editorEvent(event, model, option, index)[source]

Handle mouse clicks and key presses. Left clicking on the button or hitting the space bar will emit the clicked signal. Left clicks outside of the button will be handled as normal (i.e. selecting the cell).

See Qt documentation for documentation on arguments and return value.

eventFilter(viewport, event)[source]

The delegate does not receive Leave events or MouseMove events that don’t occur over an index (e.g. events that occur over a header or over blank space in the view), so we have to act as an event filter for the view’s viewport to observe these events. Without these events, we may not know when the mouse is no longer over a button, so we won’t know when to remove mouse-over highlighting on the button. Since this class has tokeep track of _btn_down and _mouse_over the parent class’ eventFilter can not be used.

Parameters
  • viewport (QtWidgets.QWidget) – The view’s viewport. Not used, but present for compatibility with Qt’s event filtering.

  • event (QtCore.QEvent) – The event to filter

Returns

True if the event was handled and does not need to be passed to the viewport. False otherwise. We want all events to be passed to the viewport, so we always return False.

Return type

bool

sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize[source]
sizeHintForText(txt)[source]

Generate a size hint using the specified text.

Parameters

txt (str) – The text to use for determining the button’s size

Returns

The calculated size hint

Return type

QtCore.QSize

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
createEditor(parent, option, index)

This delegate does not have a separate editor widget, so we return None. All arguments are ignored, but are present for Qt compatibility.

customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
event(self, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
property mouse_data

Returns the data for the cell that the mouse is in.

Returns

the data for the cell that the mouse is on or None

Return type

object

moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.SpinBoxDelegate(*args, **kwargs)[source]

Bases: schrodinger.ui.qt.delegates.LineEditDelegate

A delegate that provides a QtWidgets.QSpinBox as an editor. The minimum and maximum allowed values for the spin box are set using data retrieved via the SPINBOX_LIMITS_ROLE.

Editing is initiated when the cell is clicked. Note that the mouse down and up must both occur in the same cell; otherwise, editing will not be started. This allows the user to highlight multiple cells by clicking and dragging.

NOTE: Use STableView in order to enter the edit mode after a click.

SPINBOX_LIMITS_ROLE = 357
MOUSE_CLICK_STARTS_EDIT = True
createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget[source]
setEditorData(self, QWidget, QModelIndex)[source]
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)[source]
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)[source]
EDIT_ICON = ':/schrodinger/ui/qt/icons_dir/pencil_icon.ico'
EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(self, QEvent, QAbstractItemModel, QStyleOptionViewItem, QModelIndex) → bool
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

paint(self, QPainter, QStyleOptionViewItem, QModelIndex)
parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setItemEditorFactory(self, QItemEditorFactory)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
class schrodinger.ui.qt.delegates.ComboBoxDelegate(*args, **kwargs)[source]

Bases: schrodinger.ui.qt.delegates.AbstractDelegateWithEditIcon

A delegate that provides a _TableComboBox as an editor. The combo box is populated using a list or OrderedDict retrieved via the COMBOBOX_ROLE.

NOTE: Use STableView in order to open the combo menu with a single click.

COMBOBOX_ROLE = 358
MOUSE_PRESS_STARTS_EDIT = True
EDIT_ICON = ':/schrodinger/ui/qt/icons_dir/combobox_icon.ico'
paint(self, QPainter, QStyleOptionViewItem, QModelIndex)[source]
createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget[source]
setEditorData(self, QWidget, QModelIndex)[source]
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)[source]
EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(self, QEvent, QAbstractItemModel, QStyleOptionViewItem, QModelIndex) → bool
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setItemEditorFactory(self, QItemEditorFactory)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.MatplotlibDelegate(parent=None)[source]

Bases: PyQt5.QtWidgets.QStyledItemDelegate

A delegate that displays a matplotlib plot for all data of type PLOT_DATA_TYPE. Data of other types will be displayed normally (i.e. as a string). A small plot (generated in _genCellPlot) will be shown inside of the cell and a larger plot (generated in _genToolTipPlot) will be shown in a tool-tip-style pop up if the user hovers over a cell. Data for the small plot is retrieved using Qt.UserRole. Data for the tool tip plot is retrieved using Qt.ToolTipRole.

This class should not be instantiated directly and must be subclassed. Subclasses must redefine _genCellPlot and may also redefine _genToolTipPlot and the class variables.

Variables
  • TOOLTIP_PLOT (bool) – Whether the matplotlib tool tip pop up should be used. If this is False, all of the other TOOLTIP_PLOT_* constants will be ignored, as will _genToolTipPlot.

  • TOOLTIP_PLOT_WIDTH (int) – The width of the plots shown in the tool tip popup

  • TOOLTIP_PLOT_HEIGHT (int) – The height of the plots shown in the tool tip popup

  • TOOLTIP_FRAME_WIDTH (int) – The thickness of the border around the tool tip plot popup

  • PLOT_DATA_TYPE (type or tuple) – Data of this type (or tuple of types) will result in a matplotlib plot. Other data types will result in standard table behavior.

TOOLTIP_PLOT = True
TOOLTIP_PLOT_WIDTH = 640
TOOLTIP_PLOT_HEIGHT = 480
TOOLTIP_FRAME_WIDTH = 1
PLOT_DATA_TYPE = (<class 'list'>, <class 'tuple'>)
__init__(parent=None)[source]

Initialize self. See help(type(self)) for accurate signature.

createEditor(parent, option, index)[source]

This delegate does not have a separate editor widget, so we return None. All arguments are ignored, but are present for Qt compatibility.

paint(painter, option, index)[source]

Paint the cell contents

Parameters
  • painter (QPainter) – The painter being used to render the delegate

  • option (QStyleOptionViewItem) – The style options to use when painting

  • index (PyQt5.QtCore.QModelIndex) – The index being represented

helpEvent(event, view, option, index)[source]

Handle help events. If the index has data of type self.PLOT_DATA_TYPE for Qt.ToolTipRole, a pop up plot will be generated. All other events will be handled as usual. Before generating a pop up, make sure that a pop up for the given index isn’t already displayed. If it is, don’t do anything.

Parameters
  • event (QtGui.QHelpEvent) – The event to be handled

  • view (QtWidgets.QTableView) – The view that this delegate is used in

  • option – Ignored, but present for Qt compatibility.

  • index (QtCore.QModelIndex) – The index of the cell where the event occurred

Returns

True if the event was handled. False otherwise.

Return type

bool

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(self, QEvent, QAbstractItemModel, QStyleOptionViewItem, QModelIndex) → bool
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.ModelIndexFilter(data, index)[source]

Bases: PyQt5.QtCore.QModelIndex

An index that can override the data provided by a model.

Note

Qt’s QModelIndex functions are all inlined. As a result, any functions implemented in a QModelIndex subclass are bypassed when called from C++. Because of this, we have to implement this class using a real index to a dummy model (_DummyModel) rather than using a dummy index with its own data() method.

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

ModelIndexFilter.child(self, int, int) -> QModelIndex
column(self) → int
data(self, role: int = Qt.DisplayRole) → Any
flags(self) → Qt.ItemFlags
internalId(self) → int
internalPointer(self) → object
isValid(self) → bool
model(self) → QAbstractItemModel
parent(self) → QModelIndex
row(self) → int
ModelIndexFilter.sibling(self, int, int) -> QModelIndex
siblingAtColumn(self, int) → QModelIndex
siblingAtRow(self, int) → QModelIndex
class schrodinger.ui.qt.delegates.DefaultMessageDelegate(parent=None, message='Double-click to edit...')[source]

Bases: PyQt5.QtWidgets.QStyledItemDelegate

A delegate that displays a default “Double-click to edit” message when there is no data to display. This way, the model and the editor don’t have to treat no-data as a special case. Note that the model background color will still be used.

FONT = <PyQt5.QtGui.QFont object>
FOREGROUND = <PyQt5.QtGui.QBrush object>
__init__(parent=None, message='Double-click to edit...')[source]

Initialize self. See help(type(self)) for accurate signature.

paint(painter, option, index)[source]

If the DisplayRole data for index is empty, paint the default message instead.

See Qt documentation for an explanation of arguments.

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(self, QEvent, QAbstractItemModel, QStyleOptionViewItem, QModelIndex) → bool
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.AbstractCustomDelegate[source]

Bases: PyQt5.QtWidgets.QStyledItemDelegate

paintItemBackground(painter, option, index)[source]

Paints the item’s background.

Parameters
  • painter (QtGui.QPainter) – The painter to use

  • option (QtWidgets.QStyleOptionViewItem) – The options for the cell

  • index (QtCore.QModelIndex) – The index to paint

Returns

Instance of QtWidgets.QStyleOptionViewItem initialized using original option and an instance of QStyle

Return type

tuple of QtWidgets.QStyleOptionViewItem, QStyle

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(self, QEvent, QAbstractItemModel, QStyleOptionViewItem, QModelIndex) → bool
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

paint(self, QPainter, QStyleOptionViewItem, QModelIndex)
parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.WorkspaceInclusionDelegate(parent)[source]

Bases: schrodinger.ui.qt.delegates.AbstractCustomDelegate

A delegate for representing workspace inclusion as it is shown in the project table. This delegate allows an entry to be set as the only workspace entry by clicking, or allows workspace inclusion to be toggled by holding down Ctrl.

NOTE: If using schrodinger.ui.qt.delegates.WorkspaceInclusionDelegate, this delegate expects the model to provide the number of included entries for NUM_INCLUDED_ENTRIES_ROLE. If this data is not provided, a black inclusion icon will be used for any number of inclusions, including 1.

__init__(parent)[source]

Initialize self. See help(type(self)) for accurate signature.

createEditor(parent, option, index)[source]

This delegate does not have a separate editor widget, so we return None. All arguments are ignored, but are present for Qt compatibility.

paint(painter, option, index)[source]

Paint the appropriate icon

Parameters
  • painter (QPainter) – The painter being used to render the delegate

  • option (QStyleOptionViewItem) – The style options to use when painting

  • index (PyQt5.QtCore.QModelIndex) – The index being represented

editorEvent(event, model, option, index)[source]

Handle mouse clicks and key presses

Parameters
  • event (PyQt5.QtCore.QEvent) – The event that occurred

  • model (QAbstractTableModel) – The data model

  • option – Ignored, but present for Qt compatibility

  • index (PyQt5.QtCore.QModelIndex) – The index being edited

Returns

True if the event was handled. False otherwise.

Return type

bool

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

paintItemBackground(painter, option, index)

Paints the item’s background.

Parameters
  • painter (QtGui.QPainter) – The painter to use

  • option (QtWidgets.QStyleOptionViewItem) – The options for the cell

  • index (QtCore.QModelIndex) – The index to paint

Returns

Instance of QtWidgets.QStyleOptionViewItem initialized using original option and an instance of QStyle

Return type

tuple of QtWidgets.QStyleOptionViewItem, QStyle

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.PictureDelegate(parent=None, padding_factor=0.04, alignment=None)[source]

Bases: schrodinger.ui.qt.delegates.AbstractCustomDelegate

An abstract delegate class that can render images along with text.

This delegate queries the table’s Qt.DisplayRole for data that informs how it should render an image. This data must be an instance of DISPLAY_DATA_CLASS. If not, this delegate will revert to default delegate behavior.

This delegate also queries the custom PICTURE_TEXT_ROLE role for text to display along with the generated image. The text color can be set if the table returns the appropriate QtGui.QBrush when Qt.ForegroundRole is queried.

Images should be cached for faster rendering after the first render. They are stored in a cache that can be cleared via the clearImageCache method when the model’s data changes, if necessary.

Subclasses should define the following:
-DISPLAY_DATA_CLASS: class variable that indicates the expected type of

the display data to be received from the table.

-_getPicture(): method that actually generates the picture to be

rendered. Should only be accessed via the getPicture() method

Variables

padding_factor – The portion of a cell’s width and height to be used as padding on each side of the cell when drawing the image. Default value 0.04.

TEXT_MARGIN = 2
DISPLAY_DATA_CLASS = None
__init__(parent=None, padding_factor=0.04, alignment=None)[source]

Initialize a new delegate instance, optionally specifying the size of the padding in the cell around the image.

Parameters
  • padding_factor (float) – The portion of the cell’s width and height to be used as padding on each side of the cell when drawing the image.

  • alignment (QtCore.QAlignment) – The alignment of the text, if any text is provided by the cell data method. Vertical alignment specifies whether the text is displayed above or below the structure image.

setAlignment(alignment)[source]

Set the text alignment for the cell. The vertical component of the alignment indicates whether the text will be displayed above or below the structure image.

The vertical component of the alignment must either be Qt.AlignTop or Qt.AlignBottom; if it is neither of these, the vertical alignment will default to Qt.AlignTop.

If this delegate is not provided with both a structure and text to display, this alignment setting is ignored.

Parameters

alignment (QtCore.Alignment) – Text alignment in table cell.

Raises

ValueError – if the vertical component of the alignment is specified to be Qt.AlignVCenter

alignment()[source]
setTextElide(elide)[source]

Set the text elide status of the text displayed by the delegate. The elide mode describes where the ellipsis should appear when displaying text that doesn’t fit into the available space.

Parameters

elide (Qt.TextElideMode) – text elide mode

textElide()[source]
setPaddingFactor(padding_factor)[source]

Set the relative size of the cell width and height used as padding for the image.

If the table view has already been painted, view.update should be called after setPaddingFactor to make sure that the visible cells are properly updated.

Raises
  • TypeError – when the supplied padding_factor is not a float

  • ValueError – when the supplied padding_factor is less than 0.0 or greater than 0.5.

Parameters

padding_factor (float) – The portion of the cell’s width and height to be used as padding on each side of the cell when drawing the image.

paddingFactor()[source]
paint(painter, option, index)[source]

Arrange and paint image, and optionally text, into the table cell.

See QtWidgets.QAbstractItemDelegate.paint for argument documentation.

paintText(painter, option, index, rect)[source]

Paint supplied text into a subsection of the supplied rectangle.

Parameters
  • painter (QtGui.QPainter) – The painter that is drawing in the table

  • option (QtGui.QStyleOptionViewItem) – Class containing parameters used to draw the cell

  • index (QtCore.QModelIndex) – Index for the cell to be painted

  • rect (QtCore.QRect) – The rectangle in which the text should be painted

Returns

If text is drawn, a rectangle contained entirely within the larger painting area that contains the painted text, or None if no text was provided.

Return type

QtCore.QRect or None

paintPicture(display_data, painter, rect)[source]

Paint image into a subsection of the supplied rectangle.

Parameters
  • display_data (DISPLAY_DATA_CLASS) – object used to generate the image

  • painter (QtGui.QPainter) – The painter that is drawing in the table

  • rect (QtCore.QRect) – The rectangle in which the image should be painted

getPictureArgs(display_data)[source]

Given the display data returned by the table, produce appropriate arguments for getPicture and return them. By default, simply returns a tuple containing only display_data, but can be overridden for subclasses if necessary.

Parameters

display_data – the data provided by the table to generate a picture using this delegate

Returns

arguments necessary for calling getPicture

getPicture(*pic_args)[source]

Return the QtGui.QPicture instance to be displayed by the delegate. A simple wrapper for the _getPicture method that uses the functools.lru_cache to improve performance. As such, any arguments for this method (and therefore also _getPicture) should be hashable and should uniquely identify the desired picture.

Note that this method has an lru_cache decorator applied to it during __init__() so that the cache data is stored on the instance rather than the class.

Returns

the picture to be displayed by this delegate

Return type

QtGui.QPicture

getContentRect(rect)[source]

Given the rectangle representing the total area in the table cell, return a (potentially) smaller rectangle that remains after the portion of the rectangle dedicated to padding is removed.

Parameters

rect (QtCore.QRect) – the rectangle corresponding to the full table cell area

Returns

the rectangle corresponding to the subset of the table area devoted to the cell contents (full cell minus padding area, if any)

Return type

QtCore.QRect

clearImageCache()[source]

Clear the image cache. This function can be called from a subclass if the functools.lru_cache decorator is applied to getPicture.

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(self, QEvent, QAbstractItemModel, QStyleOptionViewItem, QModelIndex) → bool
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

paintItemBackground(painter, option, index)

Paints the item’s background.

Parameters
  • painter (QtGui.QPainter) – The painter to use

  • option (QtWidgets.QStyleOptionViewItem) – The options for the cell

  • index (QtCore.QModelIndex) – The index to paint

Returns

Instance of QtWidgets.QStyleOptionViewItem initialized using original option and an instance of QStyle

Return type

tuple of QtWidgets.QStyleOptionViewItem, QStyle

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.StructureDelegate(parent=None, padding_factor=0.04, alignment=None)[source]

Bases: schrodinger.ui.qt.delegates.PictureDelegate

Delegate used to display a 2D image of a small molecule.

DISPLAY_DATA_CLASS

alias of schrodinger.structure._structure.Structure

getPictureArgs(st)[source]

Given a structure, produce arguments necessary to pass to getPicture to produce a cached picture. This must be done because the structure.Structure object is not hashable, which is a necessary requirement to use the functools.lru_cache decorator.

Parameters

st (structure.Structure) – the structure used to generate a picture

Returns

a tuple containing 1. the structure handle 2. a second tuple with the structure’s Cartesian coordinate information

Return type

2-tuple of (int, tuple)

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
TEXT_MARGIN = 2
__init__(parent=None, padding_factor=0.04, alignment=None)

Initialize a new delegate instance, optionally specifying the size of the padding in the cell around the image.

Parameters
  • padding_factor (float) – The portion of the cell’s width and height to be used as padding on each side of the cell when drawing the image.

  • alignment (QtCore.QAlignment) – The alignment of the text, if any text is provided by the cell data method. Vertical alignment specifies whether the text is displayed above or below the structure image.

alignment()
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
clearImageCache()

Clear the image cache. This function can be called from a subclass if the functools.lru_cache decorator is applied to getPicture.

closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(self, QEvent, QAbstractItemModel, QStyleOptionViewItem, QModelIndex) → bool
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

getContentRect(rect)

Given the rectangle representing the total area in the table cell, return a (potentially) smaller rectangle that remains after the portion of the rectangle dedicated to padding is removed.

Parameters

rect (QtCore.QRect) – the rectangle corresponding to the full table cell area

Returns

the rectangle corresponding to the subset of the table area devoted to the cell contents (full cell minus padding area, if any)

Return type

QtCore.QRect

getPicture(*pic_args)

Return the QtGui.QPicture instance to be displayed by the delegate. A simple wrapper for the _getPicture method that uses the functools.lru_cache to improve performance. As such, any arguments for this method (and therefore also _getPicture) should be hashable and should uniquely identify the desired picture.

Note that this method has an lru_cache decorator applied to it during __init__() so that the cache data is stored on the instance rather than the class.

Returns

the picture to be displayed by this delegate

Return type

QtGui.QPicture

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

paddingFactor()
paint(painter, option, index)

Arrange and paint image, and optionally text, into the table cell.

See QtWidgets.QAbstractItemDelegate.paint for argument documentation.

paintItemBackground(painter, option, index)

Paints the item’s background.

Parameters
  • painter (QtGui.QPainter) – The painter to use

  • option (QtWidgets.QStyleOptionViewItem) – The options for the cell

  • index (QtCore.QModelIndex) – The index to paint

Returns

Instance of QtWidgets.QStyleOptionViewItem initialized using original option and an instance of QStyle

Return type

tuple of QtWidgets.QStyleOptionViewItem, QStyle

paintPicture(display_data, painter, rect)

Paint image into a subsection of the supplied rectangle.

Parameters
  • display_data (DISPLAY_DATA_CLASS) – object used to generate the image

  • painter (QtGui.QPainter) – The painter that is drawing in the table

  • rect (QtCore.QRect) – The rectangle in which the image should be painted

paintText(painter, option, index, rect)

Paint supplied text into a subsection of the supplied rectangle.

Parameters
  • painter (QtGui.QPainter) – The painter that is drawing in the table

  • option (QtGui.QStyleOptionViewItem) – Class containing parameters used to draw the cell

  • index (QtCore.QModelIndex) – Index for the cell to be painted

  • rect (QtCore.QRect) – The rectangle in which the text should be painted

Returns

If text is drawn, a rectangle contained entirely within the larger painting area that contains the painted text, or None if no text was provided.

Return type

QtCore.QRect or None

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setAlignment(alignment)

Set the text alignment for the cell. The vertical component of the alignment indicates whether the text will be displayed above or below the structure image.

The vertical component of the alignment must either be Qt.AlignTop or Qt.AlignBottom; if it is neither of these, the vertical alignment will default to Qt.AlignTop.

If this delegate is not provided with both a structure and text to display, this alignment setting is ignored.

Parameters

alignment (QtCore.Alignment) – Text alignment in table cell.

Raises

ValueError – if the vertical component of the alignment is specified to be Qt.AlignVCenter

setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setPaddingFactor(padding_factor)

Set the relative size of the cell width and height used as padding for the image.

If the table view has already been painted, view.update should be called after setPaddingFactor to make sure that the visible cells are properly updated.

Raises
  • TypeError – when the supplied padding_factor is not a float

  • ValueError – when the supplied padding_factor is less than 0.0 or greater than 0.5.

Parameters

padding_factor (float) – The portion of the cell’s width and height to be used as padding on each side of the cell when drawing the image.

setParent(self, QObject)
setProperty(self, str, Any) → bool
setTextElide(elide)

Set the text elide status of the text displayed by the delegate. The elide mode describes where the ellipsis should appear when displaying text that doesn’t fit into the available space.

Parameters

elide (Qt.TextElideMode) – text elide mode

signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
textElide()
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.HashableRdMol(rdmol)[source]

Bases: object

A rdchem.Mol wrapper that extracts data from the rdchem.Mol object and uses it to form a useful hash value. This is necessary to ensure that a rdchem.Mol instance is not accidentally matched with a totally different rdchem.Mol because they happen to share the same memory location (at different times).

__init__(rdmol)[source]

Initialize self. See help(type(self)) for accurate signature.

class schrodinger.ui.qt.delegates.RdMolDelegate(*args, **kwargs)[source]

Bases: schrodinger.ui.qt.delegates.PictureDelegate

Delegate that uses RDKit and sketcher to display a 2D image of a small molecule.

Input Mol objects should use implicit hydrogens for best performance.

The delegate will attempt to align the input structures against a template (arbitrarily chosen as the first Mol instance encountered by the delegate after reset). In order for this to work, the input structures must have some parts in common. Consequently, if the delegate is first used on a group of similar molecules “A”, it must be cleared prior to being used on a second group of molecules “B” that may not be similar to the first. Otherwise, it will attempt to align all group B molecules against a template chosen from group A, which may not produce good results. The clear() method can be used to accomplish this.

DISPLAY_DATA_CLASS

alias of rdkit.Chem.rdchem.Mol

__init__(*args, **kwargs)[source]

Initialize a new delegate instance, optionally specifying the size of the padding in the cell around the image.

Parameters
  • padding_factor (float) – The portion of the cell’s width and height to be used as padding on each side of the cell when drawing the image.

  • alignment (QtCore.QAlignment) – The alignment of the text, if any text is provided by the cell data method. Vertical alignment specifies whether the text is displayed above or below the structure image.

clear()[source]

Clear cached data, including the image cache and template Mol.

getPictureArgs(rdmol)[source]

Transform a RDKit molecule object into a more hash-friendly object. While the rdmol alone is necessary for generating the image for this delegate, the HashableRdMol object ensures that changes to the rdmol are reflected in its hash value, preventing the getPicture() cache from returning outdated images if the rdmol has changed.

Parameters

rdmol (Chem.rdchem.Mol) – RDKit molecule

Returns

tuple containing hashable RDKit molecule

Return type

tuple(HashableRdMol)

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
TEXT_MARGIN = 2
alignment()
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
clearImageCache()

Clear the image cache. This function can be called from a subclass if the functools.lru_cache decorator is applied to getPicture.

closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(self, QEvent, QAbstractItemModel, QStyleOptionViewItem, QModelIndex) → bool
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

getContentRect(rect)

Given the rectangle representing the total area in the table cell, return a (potentially) smaller rectangle that remains after the portion of the rectangle dedicated to padding is removed.

Parameters

rect (QtCore.QRect) – the rectangle corresponding to the full table cell area

Returns

the rectangle corresponding to the subset of the table area devoted to the cell contents (full cell minus padding area, if any)

Return type

QtCore.QRect

getPicture(*pic_args)

Return the QtGui.QPicture instance to be displayed by the delegate. A simple wrapper for the _getPicture method that uses the functools.lru_cache to improve performance. As such, any arguments for this method (and therefore also _getPicture) should be hashable and should uniquely identify the desired picture.

Note that this method has an lru_cache decorator applied to it during __init__() so that the cache data is stored on the instance rather than the class.

Returns

the picture to be displayed by this delegate

Return type

QtGui.QPicture

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

paddingFactor()
paint(painter, option, index)

Arrange and paint image, and optionally text, into the table cell.

See QtWidgets.QAbstractItemDelegate.paint for argument documentation.

paintItemBackground(painter, option, index)

Paints the item’s background.

Parameters
  • painter (QtGui.QPainter) – The painter to use

  • option (QtWidgets.QStyleOptionViewItem) – The options for the cell

  • index (QtCore.QModelIndex) – The index to paint

Returns

Instance of QtWidgets.QStyleOptionViewItem initialized using original option and an instance of QStyle

Return type

tuple of QtWidgets.QStyleOptionViewItem, QStyle

paintPicture(display_data, painter, rect)

Paint image into a subsection of the supplied rectangle.

Parameters
  • display_data (DISPLAY_DATA_CLASS) – object used to generate the image

  • painter (QtGui.QPainter) – The painter that is drawing in the table

  • rect (QtCore.QRect) – The rectangle in which the image should be painted

paintText(painter, option, index, rect)

Paint supplied text into a subsection of the supplied rectangle.

Parameters
  • painter (QtGui.QPainter) – The painter that is drawing in the table

  • option (QtGui.QStyleOptionViewItem) – Class containing parameters used to draw the cell

  • index (QtCore.QModelIndex) – Index for the cell to be painted

  • rect (QtCore.QRect) – The rectangle in which the text should be painted

Returns

If text is drawn, a rectangle contained entirely within the larger painting area that contains the painted text, or None if no text was provided.

Return type

QtCore.QRect or None

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setAlignment(alignment)

Set the text alignment for the cell. The vertical component of the alignment indicates whether the text will be displayed above or below the structure image.

The vertical component of the alignment must either be Qt.AlignTop or Qt.AlignBottom; if it is neither of these, the vertical alignment will default to Qt.AlignTop.

If this delegate is not provided with both a structure and text to display, this alignment setting is ignored.

Parameters

alignment (QtCore.Alignment) – Text alignment in table cell.

Raises

ValueError – if the vertical component of the alignment is specified to be Qt.AlignVCenter

setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setPaddingFactor(padding_factor)

Set the relative size of the cell width and height used as padding for the image.

If the table view has already been painted, view.update should be called after setPaddingFactor to make sure that the visible cells are properly updated.

Raises
  • TypeError – when the supplied padding_factor is not a float

  • ValueError – when the supplied padding_factor is less than 0.0 or greater than 0.5.

Parameters

padding_factor (float) – The portion of the cell’s width and height to be used as padding on each side of the cell when drawing the image.

setParent(self, QObject)
setProperty(self, str, Any) → bool
setTextElide(elide)

Set the text elide status of the text displayed by the delegate. The elide mode describes where the ellipsis should appear when displaying text that doesn’t fit into the available space.

Parameters

elide (Qt.TextElideMode) – text elide mode

signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
textElide()
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.ChmMolDelegate(parent=None, padding_factor=0.04, alignment=None)[source]

Bases: schrodinger.ui.qt.delegates.PictureDelegate

DISPLAY_DATA_CLASS

alias of schrodinger.infra._canvas2d.ChmMol

getPictureArgs(chmmol)[source]

Transform a canvas2d.ChmMol object into a more hash-friendly object. While the ChmMol alone is necessary for generating the image for this delegate, the HashableChmMol object ensures that changes to the ChmMol are reflected in its hash value, preventing the getPicture() cache from returning outdated images if the ChmMol has changed (PANEL-13897).

Parameters

chmmol (canvas2d.ChmMol) – a ChmMol object

Returns

a tuple containing a single hashable chmmol object

Return type

tuple(HashableChmMol)

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
TEXT_MARGIN = 2
__init__(parent=None, padding_factor=0.04, alignment=None)

Initialize a new delegate instance, optionally specifying the size of the padding in the cell around the image.

Parameters
  • padding_factor (float) – The portion of the cell’s width and height to be used as padding on each side of the cell when drawing the image.

  • alignment (QtCore.QAlignment) – The alignment of the text, if any text is provided by the cell data method. Vertical alignment specifies whether the text is displayed above or below the structure image.

alignment()
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
clearImageCache()

Clear the image cache. This function can be called from a subclass if the functools.lru_cache decorator is applied to getPicture.

closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(self, QEvent, QAbstractItemModel, QStyleOptionViewItem, QModelIndex) → bool
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

getContentRect(rect)

Given the rectangle representing the total area in the table cell, return a (potentially) smaller rectangle that remains after the portion of the rectangle dedicated to padding is removed.

Parameters

rect (QtCore.QRect) – the rectangle corresponding to the full table cell area

Returns

the rectangle corresponding to the subset of the table area devoted to the cell contents (full cell minus padding area, if any)

Return type

QtCore.QRect

getPicture(*pic_args)

Return the QtGui.QPicture instance to be displayed by the delegate. A simple wrapper for the _getPicture method that uses the functools.lru_cache to improve performance. As such, any arguments for this method (and therefore also _getPicture) should be hashable and should uniquely identify the desired picture.

Note that this method has an lru_cache decorator applied to it during __init__() so that the cache data is stored on the instance rather than the class.

Returns

the picture to be displayed by this delegate

Return type

QtGui.QPicture

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

paddingFactor()
paint(painter, option, index)

Arrange and paint image, and optionally text, into the table cell.

See QtWidgets.QAbstractItemDelegate.paint for argument documentation.

paintItemBackground(painter, option, index)

Paints the item’s background.

Parameters
  • painter (QtGui.QPainter) – The painter to use

  • option (QtWidgets.QStyleOptionViewItem) – The options for the cell

  • index (QtCore.QModelIndex) – The index to paint

Returns

Instance of QtWidgets.QStyleOptionViewItem initialized using original option and an instance of QStyle

Return type

tuple of QtWidgets.QStyleOptionViewItem, QStyle

paintPicture(display_data, painter, rect)

Paint image into a subsection of the supplied rectangle.

Parameters
  • display_data (DISPLAY_DATA_CLASS) – object used to generate the image

  • painter (QtGui.QPainter) – The painter that is drawing in the table

  • rect (QtCore.QRect) – The rectangle in which the image should be painted

paintText(painter, option, index, rect)

Paint supplied text into a subsection of the supplied rectangle.

Parameters
  • painter (QtGui.QPainter) – The painter that is drawing in the table

  • option (QtGui.QStyleOptionViewItem) – Class containing parameters used to draw the cell

  • index (QtCore.QModelIndex) – Index for the cell to be painted

  • rect (QtCore.QRect) – The rectangle in which the text should be painted

Returns

If text is drawn, a rectangle contained entirely within the larger painting area that contains the painted text, or None if no text was provided.

Return type

QtCore.QRect or None

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setAlignment(alignment)

Set the text alignment for the cell. The vertical component of the alignment indicates whether the text will be displayed above or below the structure image.

The vertical component of the alignment must either be Qt.AlignTop or Qt.AlignBottom; if it is neither of these, the vertical alignment will default to Qt.AlignTop.

If this delegate is not provided with both a structure and text to display, this alignment setting is ignored.

Parameters

alignment (QtCore.Alignment) – Text alignment in table cell.

Raises

ValueError – if the vertical component of the alignment is specified to be Qt.AlignVCenter

setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setPaddingFactor(padding_factor)

Set the relative size of the cell width and height used as padding for the image.

If the table view has already been painted, view.update should be called after setPaddingFactor to make sure that the visible cells are properly updated.

Raises
  • TypeError – when the supplied padding_factor is not a float

  • ValueError – when the supplied padding_factor is less than 0.0 or greater than 0.5.

Parameters

padding_factor (float) – The portion of the cell’s width and height to be used as padding on each side of the cell when drawing the image.

setParent(self, QObject)
setProperty(self, str, Any) → bool
setTextElide(elide)

Set the text elide status of the text displayed by the delegate. The elide mode describes where the ellipsis should appear when displaying text that doesn’t fit into the available space.

Parameters

elide (Qt.TextElideMode) – text elide mode

signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
textElide()
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.CheckboxDelegate(parent=None)[source]

Bases: schrodinger.ui.qt.delegates.AbstractCustomDelegate

This delegate contains a clickable checkbox. The checkbox is only displayed if the index contains data for the Qt.CheckStateRole role. If the Qt.CheckStateRole role is None, then the standard delegate behavior will be used. The index must flagged as enabled and editable for clicks to toggle the model value, and clicks must occur on the checkbox itself. Clicks on other areas of the cell will be handled as normal (i.e. selecting the cell). Model.setData() will be called with the default role (i.e. Qt.EditRole) when toggling the checkbox value. Note that this delegate uses a bi-state rather than tri-state checkbox, so partially checked states are not allowed.

DRAW_STYLE = 3
__init__(parent=None)[source]

Initialize self. See help(type(self)) for accurate signature.

createEditor(parent, option, index)[source]

This delegate does not have a separate editor widget, so we return None. All arguments are ignored, but are present for Qt compatibility.

paint(painter, option, index)[source]

Paint the appropriate icon

Parameters
  • painter (PyQt5.QtGui.QPainter) – The painter being used to render the delegate

  • option (PyQt5.QtWidgets.QStyleOptionViewItem) – The style options to use when painting

  • index (PyQt5.QtCore.QModelIndex) – The index being represented

editorEvent(event, model, option, index)[source]

Handle mouse clicks and key presses. Left clicking on the check box or hitting the space bar will toggle the check box value. Left clicks outside of the checkbox will be handled as normal (i.e. selecting the cell).

Parameters
  • event (PyQt5.QtCore.QEvent) – The event that occurred

  • model (QAbstractTableModel) – The data model

  • option (QStyleOptionViewItem) – The style options for the cell

  • index (PyQt5.QtCore.QModelIndex) – The index being edited

Returns

True if the event was handled. False otherwise.

Return type

bool

sizeHint(option=None, index=None)[source]

Provide a reasonable default size for the table cell. If no index is provided, then option is not required and it is assumed that the cell contains check data.

See Qt documentation for an explanation of arguments and return type

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

paintItemBackground(painter, option, index)

Paints the item’s background.

Parameters
  • painter (QtGui.QPainter) – The painter to use

  • option (QtWidgets.QStyleOptionViewItem) – The options for the cell

  • index (QtCore.QModelIndex) – The index to paint

Returns

Instance of QtWidgets.QStyleOptionViewItem initialized using original option and an instance of QStyle

Return type

tuple of QtWidgets.QStyleOptionViewItem, QStyle

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.RadioButtonDelegate(parent=None)[source]

Bases: schrodinger.ui.qt.delegates.CheckboxDelegate

Subclass of CheckboxDelegate giving the widget a radio button appearance. Note that the model must define check state behavior, e.g. to uncheck all other rows when a new row is checked.

DRAW_STYLE = 5
paint(painter, option, index)[source]

Paint the appropriate icon

Parameters
  • painter (PyQt5.QtGui.QPainter) – The painter being used to render the delegate

  • option (PyQt5.QtWidgets.QStyleOptionViewItem) – The style options to use when painting

  • index (PyQt5.QtCore.QModelIndex) – The index being represented

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
createEditor(parent, option, index)

This delegate does not have a separate editor widget, so we return None. All arguments are ignored, but are present for Qt compatibility.

customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(event, model, option, index)

Handle mouse clicks and key presses. Left clicking on the check box or hitting the space bar will toggle the check box value. Left clicks outside of the checkbox will be handled as normal (i.e. selecting the cell).

Parameters
  • event (PyQt5.QtCore.QEvent) – The event that occurred

  • model (QAbstractTableModel) – The data model

  • option (QStyleOptionViewItem) – The style options for the cell

  • index (PyQt5.QtCore.QModelIndex) – The index being edited

Returns

True if the event was handled. False otherwise.

Return type

bool

event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

paintItemBackground(painter, option, index)

Paints the item’s background.

Parameters
  • painter (QtGui.QPainter) – The painter to use

  • option (QtWidgets.QStyleOptionViewItem) – The options for the cell

  • index (QtCore.QModelIndex) – The index to paint

Returns

Instance of QtWidgets.QStyleOptionViewItem initialized using original option and an instance of QStyle

Return type

tuple of QtWidgets.QStyleOptionViewItem, QStyle

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHint(option=None, index=None)

Provide a reasonable default size for the table cell. If no index is provided, then option is not required and it is assumed that the cell contains check data.

See Qt documentation for an explanation of arguments and return type

sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.ProgressBarDelegate[source]

Bases: schrodinger.ui.qt.delegates.AbstractCustomDelegate

This delegate displays if the Qt.DisplayRows datat is an int or tuple; standard delegate behavior is invoked otherwise.

Integer values are displayed as percentages on the progress bar. These must be between -100 and 100.

The tuple should consist of (value, maximum), in which case the progress text is shown as abs(value)/maximum.

A negative value flags the existence of an error and changes the color to orange.

DRAW_STYLE = 10
createEditor(parent, option, index)[source]

This delegate does not have a separate editor widget, so we return None. All arguments are ignored, but are present for Qt compatibility.

paint(painter, option, index)[source]

Paint the progress bar or use the default delegate

Parameters
  • painter (QtGui.QPainter) – The painter being used to render the delegate

  • option (QtWidgets.QStyleOptionViewItem) – The style options to use when painting

  • index (QtCore.QModelIndex) – The index being represented

sizeHint(option=None, index=None)[source]

Provide a reasonable default size for the table cell. If no index is provided, then option is not required and it is assumed that the cell contains progress bar data.

See Qt documentation for an explanation of arguments and return type

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(self, QEvent, QAbstractItemModel, QStyleOptionViewItem, QModelIndex) → bool
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

paintItemBackground(painter, option, index)

Paints the item’s background.

Parameters
  • painter (QtGui.QPainter) – The painter to use

  • option (QtWidgets.QStyleOptionViewItem) – The options for the cell

  • index (QtCore.QModelIndex) – The index to paint

Returns

Instance of QtWidgets.QStyleOptionViewItem initialized using original option and an instance of QStyle

Return type

tuple of QtWidgets.QStyleOptionViewItem, QStyle

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.ToolTipIconDelegate(parent, icon)[source]

Bases: schrodinger.ui.qt.delegates.AbstractCustomDelegate

A delegate for drawing an icon which shows a tooltip when clicked when user hovers the mouse over the cell. Tool tip text must be returned by the model’s data() method for the ToolTipRole.

__init__(parent, icon)[source]

Initialize the delegate. :param parent: Parent view widget :param icon: QIcon to draw in the cell.

paint(painter, option, index)[source]

Paint the appropriate icon, but only for cells that have a ToolTipRole.

Parameters
  • painter (QPainter) – The painter being used to render the delegate

  • option (QStyleOptionViewItem) – The style options to use when painting

  • index (PyQt5.QtCore.QModelIndex) – The index being represented

editorEvent(event, model, option, index)[source]

Handle mouse clicks: show tool tip if the cell is clicked.

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget
customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

paintItemBackground(painter, option, index)

Paints the item’s background.

Parameters
  • painter (QtGui.QPainter) – The painter to use

  • option (QtWidgets.QStyleOptionViewItem) – The options for the cell

  • index (QtCore.QModelIndex) – The index to paint

Returns

Instance of QtWidgets.QStyleOptionViewItem initialized using original option and an instance of QStyle

Return type

tuple of QtWidgets.QStyleOptionViewItem, QStyle

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.ui.qt.delegates.LinkDelegate(view, role=None, link_role=None)[source]

Bases: schrodinger.ui.qt.delegates.PushButtonDelegate

A delegate containing a clickable text. Text will be taken from the Qt.DisplayRole data. When clicked, this delegate will emit a clicked signal with either:

  • If role is None, a QtCore.QModelIndex for the cell that was clicked.

  • Otherwise, the role data for the cell that was clicked.

When optional link role is provided data with that is checked to determine whether link should be enabled. When link role is None link is always enabled. When link is disabled clicked signal is not emitted.

Variables
  • DISABLED_STYLE (str) – style sheet that sets button text to standard black

  • ENABLED_STYLE (str) – style sheet that sets button text to “Maestro blue” to match standard link appearance

  • _cursor_over_delegate (bool) – whether the cursor is over the delgate

  • _cursor_override_active (bool) – whether the “pointing hand” cursor override is currently in effect

DISABLED_STYLE = 'QPushButton {color: black}'
ENABLED_STYLE = 'QPushButton {color: #34b0f8;}'
__init__(view, role=None, link_role=None)[source]
Parameters
  • view (QtWidgets.QTableView) – The view that this delegate will be added to. Note that mouse tracking will be enabled in the view.

  • role (int or NoneType) – The role to emit data for when a button is clicked. If not given, the index that was clicked will be emitted instead. This value may be specified after instantiation using setRole.

  • link_role (int or NoneType) – The role to check data that determines whether link should be enabled.

indexIsEnabled(index)[source]
Returns

whether the specified index should have an enabled link

Return type

bool

paint(painter, option, index)[source]

Temporarily updates the painter font to be bold to match standard link appearance.

eventFilter(viewport, event)[source]

Catch all events in order to apply the correct appearance to the cursor based on its position.

Parameters
  • viewport (QtWidgets.QWidget) – The view’s viewport. Not used, but present for compatibility with Qt’s event filtering.

  • event (QtCore.QEvent) – The event to filter

Returns

True if the event was handled and does not need to be passed to the viewport. False otherwise. We want all events to be passed to the viewport, so we always return False.

Return type

bool

EditNextItem = 1
EditPreviousItem = 2
class EndEditHint

Bases: int

NoHint = 0
RevertModelCache = 4
SubmitModelCache = 3
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
clicked
closeEditor

closeEditor(self, QWidget, hint: QAbstractItemDelegate.EndEditHint = QAbstractItemDelegate.NoHint) [signal]

commitData

commitData(self, QWidget) [signal]

connectNotify(self, QMetaMethod)
createEditor(parent, option, index)

This delegate does not have a separate editor widget, so we return None. All arguments are ignored, but are present for Qt compatibility.

customEvent(self, QEvent)
deleteLater(self)
destroyEditor(self, QWidget, QModelIndex)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
displayText(self, Any, QLocale) → str
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editorEvent(event, model, option, index)

Handle mouse clicks and key presses. Left clicking on the button or hitting the space bar will emit the clicked signal. Left clicks outside of the button will be handled as normal (i.e. selecting the cell).

See Qt documentation for documentation on arguments and return value.

event(self, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

helpEvent(self, QHelpEvent, QAbstractItemView, QStyleOptionViewItem, QModelIndex) → bool
inherits(self, str) → bool
initStyleOption(self, QStyleOptionViewItem, QModelIndex)
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
itemEditorFactory(self) → QItemEditorFactory
killTimer(self, int)
metaObject(self) → QMetaObject
property mouse_data

Returns the data for the cell that the mouse is in.

Returns

the data for the cell that the mouse is on or None

Return type

object

moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setEditorData(self, QWidget, QModelIndex)
setItemEditorFactory(self, QItemEditorFactory)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
setRole(role)

Specify the role to emit data for when a button is clicked. If None, the index that was clicked will be emitted instead.

Parameters

role (int or NoneType) – The role

signalsBlocked(self) → bool
sizeHint(self, QStyleOptionViewItem, QModelIndex) → QSize
sizeHintChanged

sizeHintChanged(self, QModelIndex) [signal]

sizeHintForText(txt)

Generate a size hint using the specified text.

Parameters

txt (str) – The text to use for determining the button’s size

Returns

The calculated size hint

Return type

QtCore.QSize

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
schrodinger.ui.qt.delegates.structure_tuple(st)[source]

Produce a hashable tuple to identify a structure by its Cartesian coordinates and atom types.

Parameters

st (structure.Structure) – a structure instance

Returns

two tuples containing a subset of the data from the structure instance. The first contains the atom types; The second contains the Cartesian coordinates of the atoms.

Return type

tuple(tuple(str), tuple(float))

class schrodinger.ui.qt.delegates.HashableChmMol(chmmol)[source]

Bases: object

A ChmMol wrapper that extracts data from the ChmMol object and uses it to present a useful hash value. This is necessary to ensure that a ChmMol instance is not accidentally matched with a totally different ChmMol because they happen to share the same memory location (at different times).

All hashable data is extracted at the moment this object is initialized, so this class is only meant as a transient wrapper for internal use within ChmMolDelegate.

__init__(chmmol)[source]

Parse and store significant data from a ChmMol object.

Parameters

chmmol (canvas2d.ChmMol) – a ChmMol instance

Variables
  • _coords (tuple(tuple(float))) – the Cartesian coordinates of the stored ChmMol instance, saved at the moment this object was initialized

  • _atoms (tuple(str)) – the atomic symbols of the stored ChmMol instance, saved at the moment this object was initialized

  • _smarts (str) – the SMARTS string of the stored ChmMol instance, saved at the moment this object was initialized

property chmmol
Returns

the wrapped ChmMol instance

Return type

canvas2d.ChmMol