schrodinger.ui.qt.utils module

Utility functions and classes for working with PyQt

schrodinger.ui.qt.utils.to_float(val)
schrodinger.ui.qt.utils.pluralize_text(noun, count, suffix='s')

Helper function to pluralize simple nouns when necessary

Parameters
  • noun (str) – singular form of the noun

  • count (int) – number of objects noun is describing

  • suffix (str) – letters to add to the word to make the plural form

schrodinger.ui.qt.utils.image_to_string(image)
Parameters

image (QtGui.QImage) – QImage instance

Returns

string representation of the given image

Return type

str

class schrodinger.ui.qt.utils.JobLaunchWaitCursorContext

Bases: object

Context manager for showing a wait cursor while waiting for a job to launch. Times out after 5 seconds.

Should not be used for anything else, as it relies on the code inside of the context running a QEventLoop to not block the single shot timer in __enter__.

__init__()
schrodinger.ui.qt.utils.maestro_required(func, *args, **kwargs)

A decorator for functions that should only be run when inside of Maestro. When run outside of Maestro, the decorated function will be a no-op.

class schrodinger.ui.qt.utils.MaestroPythonBannerManager

Bases: PyQt6.QtCore.QObject

Show one Maestro PythonBanner at a time

bannerClosed
modalBannerClosed
__init__()
showBanner(widget, is_modal=True, show_close_button=True)

Show widget in a banner in Maestro. Any previously shown banner will be closed.

Parameters
  • widget (QtWidgets.QWidget) – Widget to show in a Maestro banner

  • is_modal (bool) – Whether to show banner as modal. Maestro can only show one modal banner at a time. Multiple non-modal banners can be displayed and they auto-dismiss after a time.

  • show_close_button (bool) – Whether to show graphical close button on the right side of the notification

closeBanner()

Close the currently-shown banner in Maestro.

blockSignals(self, bool) bool
childEvent(self, QChildEvent)
children(self) List[QObject]
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyed

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

disconnect(QMetaObject.Connection) bool
disconnect(self) None
disconnectNotify(self, QMetaMethod)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) List[QByteArray]
event(self, QEvent) bool
eventFilter(self, QObject, QEvent) bool
findChild(self, type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
findChild(self, Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
findChildren(self, type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, type, QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, Tuple, QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
inherits(self, str) bool
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) bool
isWidgetType(self) bool
isWindowType(self) bool
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
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) bool
signalsBlocked(self) bool
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) int
staticMetaObject = <PyQt6.QtCore.QMetaObject object>
thread(self) QThread
timerEvent(self, QTimerEvent)
tr(str, disambiguation: str = None, n: int = - 1) str
schrodinger.ui.qt.utils.undo_block()

A context manager for putting all Maestro commands into an undo block, which can also be used as a function decorator.

class schrodinger.ui.qt.utils.LineEditWithSampleText(*args, **kwargs)

Bases: PyQt6.QtWidgets.QLineEdit

A line edit that uses sample text to determine its horizontal size hint.

Note

You may need to change the horizontal size policy of this line edit depending on your usage. If you’re using the sample data to make sure the line edit is wide enough, keep the size policy at its default setting of Expanding. If you’re using the sample data to make sure the line edit isn’t too wide, you’ll likely need to change the size policy to Preferred. Note that the size policy change can be done through Designer if desired.

__init__(*args, **kwargs)
setSampleText(sample_text, enlarge=0.2)

Specify the sample data used to set the horizontal size hint

Parameters
  • sample_text (str) – The sample text

  • enlarge (float) – The sample data will be widened by this percent so that there’s extra width in the line edit. Defaults to 0.2 (or a 20% increase)

sizeHint(self) QSize
class ActionPosition(value)

Bases: enum.Enum

An enumeration.

LeadingPosition = 0
TrailingPosition = 1
DrawChildren = 2
DrawWindowBackground = 1
class EchoMode(value)

Bases: enum.Enum

An enumeration.

Normal = 0
NoEcho = 1
Password = 2
PasswordEchoOnEdit = 3
IgnoreMask = 4
LeadingPosition = 0
NoEcho = 1
Normal = 0
class PaintDeviceMetric(value)

Bases: enum.Enum

An enumeration.

PdmWidth = 1
PdmHeight = 2
PdmWidthMM = 3
PdmHeightMM = 4
PdmNumColors = 5
PdmDepth = 6
PdmDpiX = 7
PdmDpiY = 8
PdmPhysicalDpiX = 9
PdmPhysicalDpiY = 10
PdmDevicePixelRatio = 11
PdmDevicePixelRatioScaled = 12
Password = 2
PasswordEchoOnEdit = 3
PdmDepth = 6
PdmDevicePixelRatio = 11
PdmDevicePixelRatioScaled = 12
PdmDpiX = 7
PdmDpiY = 8
PdmHeight = 2
PdmHeightMM = 4
PdmNumColors = 5
PdmPhysicalDpiX = 9
PdmPhysicalDpiY = 10
PdmWidth = 1
PdmWidthMM = 3
class RenderFlag(value)

Bases: enum.Flag

An enumeration.

DrawWindowBackground = 1
DrawChildren = 2
IgnoreMask = 4
TrailingPosition = 1
acceptDrops(self) bool
accessibleDescription(self) str
accessibleName(self) str
actionEvent(self, QActionEvent)
actions(self) List[QAction]
activateWindow(self)
addAction(self, QAction)
addAction(self, QAction, QLineEdit.ActionPosition) None
addAction(self, QIcon, QLineEdit.ActionPosition) QAction
addActions(self, Iterable[QAction])
adjustSize(self)
alignment(self) Qt.AlignmentFlag
autoFillBackground(self) bool
backgroundRole(self) QPalette.ColorRole
backspace(self)
baseSize(self) QSize
blockSignals(self, bool) bool
changeEvent(self, QEvent)
childAt(self, QPoint) QWidget
LineEditWithSampleText.childAt(self, int, int) -> QWidget
childEvent(self, QChildEvent)
children(self) List[QObject]
childrenRect(self) QRect
childrenRegion(self) QRegion
clear(self)
clearFocus(self)
clearMask(self)
close(self) bool
closeEvent(self, QCloseEvent)
colorCount(self) int
completer(self) QCompleter
connectNotify(self, QMetaMethod)
contentsMargins(self) QMargins
contentsRect(self) QRect
contextMenuEvent(self, QContextMenuEvent)
contextMenuPolicy(self) Qt.ContextMenuPolicy
copy(self)
create(self, window: PyQt6.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
createStandardContextMenu(self) QMenu
createWindowContainer(QWindow, parent: QWidget = None, flags: Qt.WindowType = Qt.WindowFlags()) QWidget
cursor(self) QCursor
cursorBackward(self, bool, steps: int = 1)
cursorForward(self, bool, steps: int = 1)
cursorMoveStyle(self) Qt.CursorMoveStyle
cursorPosition(self) int
cursorPositionAt(self, QPoint) int
cursorPositionChanged

cursorPositionChanged(self, int, int) [signal]

cursorRect(self) QRect
cursorWordBackward(self, bool)
cursorWordForward(self, bool)
customContextMenuRequested

customContextMenuRequested(self, QPoint) [signal]

customEvent(self, QEvent)
cut(self)
del_(self)
deleteLater(self)
depth(self) int
deselect(self)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
destroyed

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

devType(self) int
devicePixelRatio(self) float
devicePixelRatioF(self) float
devicePixelRatioFScale() float
disconnect(QMetaObject.Connection) bool
disconnect(self) None
disconnectNotify(self, QMetaMethod)
displayText(self) str
dragEnabled(self) bool
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) List[QByteArray]
echoMode(self) QLineEdit.EchoMode
editingFinished

editingFinished(self) [signal]

effectiveWinId(self) PyQt6.sip.voidptr
end(self, bool)
ensurePolished(self)
enterEvent(self, QEnterEvent)
event(self, QEvent) bool
eventFilter(self, QObject, QEvent) bool
find(PyQt6.sip.voidptr) QWidget
findChild(self, type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
findChild(self, Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
findChildren(self, type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, type, QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, Tuple, QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPolicy(self) Qt.FocusPolicy
focusPreviousChild(self) bool
focusProxy(self) QWidget
focusWidget(self) QWidget
font(self) QFont
fontInfo(self) QFontInfo
fontMetrics(self) QFontMetrics
foregroundRole(self) QPalette.ColorRole
frameGeometry(self) QRect
frameSize(self) QSize
geometry(self) QRect
grab(self, rectangle: QRect = QRect(QPoint(0, 0), QSize(- 1, - 1))) QPixmap
grabGesture(self, Qt.GestureType, flags: Qt.GestureFlag = Qt.GestureFlags())
grabKeyboard(self)
grabMouse(self)
grabMouse(self, Union[QCursor, Qt.CursorShape]) None
grabShortcut(self, Union[QKeySequence, QKeySequence.StandardKey, str, int], context: Qt.ShortcutContext = Qt.WindowShortcut) int
graphicsEffect(self) QGraphicsEffect
graphicsProxyWidget(self) QGraphicsProxyWidget
hasAcceptableInput(self) bool
hasFocus(self) bool
hasFrame(self) bool
hasHeightForWidth(self) bool
hasMouseTracking(self) bool
hasSelectedText(self) bool
hasTabletTracking(self) bool
height(self) int
heightForWidth(self, int) int
heightMM(self) int
hide(self)
hideEvent(self, QHideEvent)
home(self, bool)
inherits(self, str) bool
initPainter(self, QPainter)
initStyleOption(self, QStyleOptionFrame)
inputMask(self) str
inputMethodEvent(self, QInputMethodEvent)
inputMethodHints(self) Qt.InputMethodHint
inputMethodQuery(self, Qt.InputMethodQuery) Any
inputMethodQuery(self, Qt.InputMethodQuery, Any) Any
inputRejected

inputRejected(self) [signal]

insert(self, str)
LineEditWithSampleText.insertAction(self, QAction, QAction)
insertActions(self, QAction, Iterable[QAction])
installEventFilter(self, QObject)
isActiveWindow(self) bool
isAncestorOf(self, QWidget) bool
isClearButtonEnabled(self) bool
isEnabled(self) bool
isEnabledTo(self, QWidget) bool
isFullScreen(self) bool
isHidden(self) bool
isLeftToRight(self) bool
isMaximized(self) bool
isMinimized(self) bool
isModal(self) bool
isModified(self) bool
isReadOnly(self) bool
isRedoAvailable(self) bool
isRightToLeft(self) bool
isSignalConnected(self, QMetaMethod) bool
isUndoAvailable(self) bool
isVisible(self) bool
isVisibleTo(self, QWidget) bool
isWidgetType(self) bool
isWindow(self) bool
isWindowModified(self) bool
isWindowType(self) bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
keyboardGrabber() QWidget
killTimer(self, int)
layout(self) QLayout
layoutDirection(self) Qt.LayoutDirection
leaveEvent(self, QEvent)
locale(self) QLocale
logicalDpiX(self) int
logicalDpiY(self) int
lower(self)
mapFrom(self, QWidget, QPoint) QPoint
mapFrom(self, QWidget, QPointF) QPointF
mapFromGlobal(self, QPoint) QPoint
mapFromGlobal(self, QPointF) QPointF
mapFromParent(self, QPoint) QPoint
mapFromParent(self, QPointF) QPointF
mapTo(self, QWidget, QPoint) QPoint
mapTo(self, QWidget, QPointF) QPointF
mapToGlobal(self, QPoint) QPoint
mapToGlobal(self, QPointF) QPointF
mapToParent(self, QPoint) QPoint
mapToParent(self, QPointF) QPointF
mask(self) QRegion
maxLength(self) int
maximumHeight(self) int
maximumSize(self) QSize
maximumWidth(self) int
metaObject(self) QMetaObject
metric(self, QPaintDevice.PaintDeviceMetric) int
minimumHeight(self) int
minimumSize(self) QSize
minimumSizeHint(self) QSize
minimumWidth(self) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseGrabber() QWidget
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
move(self, QPoint)
LineEditWithSampleText.move(self, int, int) -> None
moveEvent(self, QMoveEvent)
moveToThread(self, QThread)
nativeEvent(self, QByteArray, PyQt6.sip.voidptr) Tuple[bool, PyQt6.sip.voidptr]
nativeParentWidget(self) QWidget
nextInFocusChain(self) QWidget
normalGeometry(self) QRect
objectName(self) str
objectNameChanged

objectNameChanged(self, str) [signal]

overrideWindowFlags(self, Qt.WindowType)
overrideWindowState(self, Qt.WindowState)
paintEngine(self) QPaintEngine
paintEvent(self, QPaintEvent)
paintingActive(self) bool
palette(self) QPalette
parent(self) QObject
parentWidget(self) QWidget
paste(self)
physicalDpiX(self) int
physicalDpiY(self) int
placeholderText(self) str
pos(self) QPoint
previousInFocusChain(self) QWidget
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.

raise_(self)
receivers(self, PYQT_SIGNAL) int
rect(self) QRect
redo(self)
releaseKeyboard(self)
releaseMouse(self)
releaseShortcut(self, int)
removeAction(self, QAction)
removeEventFilter(self, QObject)
render(self, QPaintDevice, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: QWidget.RenderFlag = QWidget.RenderFlags(QWidget.DrawWindowBackground | QWidget.DrawChildren))
render(self, QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: QWidget.RenderFlag = QWidget.RenderFlags(QWidget.DrawWindowBackground | QWidget.DrawChildren)) None
repaint(self)
LineEditWithSampleText.repaint(self, int, int, int, int) -> None
repaint(self, QRect) None
repaint(self, QRegion) None
resize(self, QSize)
LineEditWithSampleText.resize(self, int, int) -> None
resizeEvent(self, QResizeEvent)
restoreGeometry(self, QByteArray) bool
returnPressed

returnPressed(self) [signal]

saveGeometry(self) QByteArray
screen(self) QScreen
LineEditWithSampleText.scroll(self, int, int)
LineEditWithSampleText.scroll(self, int, int, QRect) -> None
selectAll(self)
selectedText(self) str
selectionChanged

selectionChanged(self) [signal]

selectionEnd(self) int
selectionLength(self) int
selectionStart(self) int
sender(self) QObject
senderSignalIndex(self) int
setAcceptDrops(self, bool)
setAccessibleDescription(self, str)
setAccessibleName(self, str)
setAlignment(self, Qt.AlignmentFlag)
setAttribute(self, Qt.WidgetAttribute, on: bool = True)
setAutoFillBackground(self, bool)
setBackgroundRole(self, QPalette.ColorRole)
LineEditWithSampleText.setBaseSize(self, int, int)
setBaseSize(self, QSize) None
setClearButtonEnabled(self, bool)
setCompleter(self, QCompleter)
LineEditWithSampleText.setContentsMargins(self, int, int, int, int)
setContentsMargins(self, QMargins) None
setContextMenuPolicy(self, Qt.ContextMenuPolicy)
setCursor(self, Union[QCursor, Qt.CursorShape])
setCursorMoveStyle(self, Qt.CursorMoveStyle)
setCursorPosition(self, int)
setDisabled(self, bool)
setDragEnabled(self, bool)
setEchoMode(self, QLineEdit.EchoMode)
setEnabled(self, bool)
setFixedHeight(self, int)
setFixedSize(self, QSize)
LineEditWithSampleText.setFixedSize(self, int, int) -> None
setFixedWidth(self, int)
setFocus(self)
setFocus(self, Qt.FocusReason) None
setFocusPolicy(self, Qt.FocusPolicy)
setFocusProxy(self, QWidget)
setFont(self, QFont)
setForegroundRole(self, QPalette.ColorRole)
setFrame(self, bool)
setGeometry(self, QRect)
LineEditWithSampleText.setGeometry(self, int, int, int, int) -> None
setGraphicsEffect(self, QGraphicsEffect)
setHidden(self, bool)
setInputMask(self, str)
setInputMethodHints(self, Qt.InputMethodHint)
setLayout(self, QLayout)
setLayoutDirection(self, Qt.LayoutDirection)
setLocale(self, QLocale)
setMask(self, QBitmap)
setMask(self, QRegion) None
setMaxLength(self, int)
setMaximumHeight(self, int)
LineEditWithSampleText.setMaximumSize(self, int, int)
setMaximumSize(self, QSize) None
setMaximumWidth(self, int)
setMinimumHeight(self, int)
LineEditWithSampleText.setMinimumSize(self, int, int)
setMinimumSize(self, QSize) None
setMinimumWidth(self, int)
setModified(self, bool)
setMouseTracking(self, bool)
setObjectName(self, str)
setPalette(self, QPalette)
setParent(self, QWidget)
setParent(self, QWidget, Qt.WindowType) None
setPlaceholderText(self, str)
setProperty(self, str, Any) bool
setReadOnly(self, bool)
setScreen(self, QScreen)
LineEditWithSampleText.setSelection(self, int, int)
setShortcutAutoRepeat(self, int, enabled: bool = True)
setShortcutEnabled(self, int, enabled: bool = True)
LineEditWithSampleText.setSizeIncrement(self, int, int)
setSizeIncrement(self, QSize) None
setSizePolicy(self, QSizePolicy)
setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy) None
setStatusTip(self, str)
setStyle(self, QStyle)
setStyleSheet(self, str)
LineEditWithSampleText.setTabOrder(QWidget, QWidget)
setTabletTracking(self, bool)
setText(self, str)
LineEditWithSampleText.setTextMargins(self, int, int, int, int)
setTextMargins(self, QMargins) None
setToolTip(self, str)
setToolTipDuration(self, int)
setUpdatesEnabled(self, bool)
setValidator(self, QValidator)
setVisible(self, bool)
setWhatsThis(self, str)
setWindowFilePath(self, str)
setWindowFlag(self, Qt.WindowType, on: bool = True)
setWindowFlags(self, Qt.WindowType)
setWindowIcon(self, QIcon)
setWindowIconText(self, str)
setWindowModality(self, Qt.WindowModality)
setWindowModified(self, bool)
setWindowOpacity(self, float)
setWindowRole(self, str)
setWindowState(self, Qt.WindowState)
setWindowTitle(self, str)
sharedPainter(self) QPainter
show(self)
showEvent(self, QShowEvent)
showFullScreen(self)
showMaximized(self)
showMinimized(self)
showNormal(self)
signalsBlocked(self) bool
size(self) QSize
sizeIncrement(self) QSize
sizePolicy(self) QSizePolicy
stackUnder(self, QWidget)
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) int
staticMetaObject = <PyQt6.QtCore.QMetaObject object>
statusTip(self) str
style(self) QStyle
styleSheet(self) str
tabletEvent(self, QTabletEvent)
testAttribute(self, Qt.WidgetAttribute) bool
text(self) str
textChanged

textChanged(self, str) [signal]

textEdited

textEdited(self, str) [signal]

textMargins(self) QMargins
thread(self) QThread
timerEvent(self, QTimerEvent)
toolTip(self) str
toolTipDuration(self) int
tr(str, disambiguation: str = None, n: int = - 1) str
underMouse(self) bool
undo(self)
ungrabGesture(self, Qt.GestureType)
unsetCursor(self)
unsetLayoutDirection(self)
unsetLocale(self)
update(self)
update(self, QRect) None
update(self, QRegion) None
LineEditWithSampleText.update(self, int, int, int, int) -> None
updateGeometry(self)
updateMicroFocus(self, query: Qt.InputMethodQuery = Qt.ImQueryAll)
updatesEnabled(self) bool
validator(self) QValidator
visibleRegion(self) QRegion
whatsThis(self) str
wheelEvent(self, QWheelEvent)
width(self) int
widthMM(self) int
winId(self) PyQt6.sip.voidptr
window(self) QWidget
windowFilePath(self) str
windowFlags(self) Qt.WindowType
windowHandle(self) QWindow
windowIcon(self) QIcon
windowIconChanged

windowIconChanged(self, QIcon) [signal]

windowIconText(self) str
windowIconTextChanged

windowIconTextChanged(self, str) [signal]

windowModality(self) Qt.WindowModality
windowOpacity(self) float
windowRole(self) str
windowState(self) Qt.WindowState
windowTitle(self) str
windowTitleChanged

windowTitleChanged(self, str) [signal]

windowType(self) Qt.WindowType
x(self) int
y(self) int
schrodinger.ui.qt.utils.checkStructurePrep(st, parent=None)

Make sure that the specified structure passes a force field check (i.e. has hydrogens, proper bond orders, and atomic charges). If it doesn’t, prompt the user to run the Protein Preparation Workflow. Launch the Prep Workflow if requested.

Parameters
  • st (schrodinger.structure.Structure) – The structure to check

  • parent (PyQt5.QtWidgets.QWidget) – The widget that should be the parent of the Protein Prep dialog

Returns

True if the structure passes the force field check. False otherwise.

Return type

bool

exception schrodinger.ui.qt.utils.ErrorForDialog

Bases: Exception

An exception that will be caught by catch_error_for_dialog. This exception should be raised with the error message to display to the user. If raised without an error message, then no error dialog will be displayed. (This assumes that the user has already been notified of the error in another way, e.g., a question dialog.)

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

schrodinger.ui.qt.utils.catch_error_for_dialog(func, self, *args, **kwargs)

A decorator that catches ErrorForDialog exceptions and displays the exception message in an error dialog.

class schrodinger.ui.qt.utils.BorderlessPopUpFrame(parent=None, ui=None)

Bases: PyQt6.QtWidgets.QFrame

Class for creating borderless popup frames that have a flat close button style. Additional widgets can be added to the frame’s self.ui.vertical_layout to customize the frame.

__init__(parent=None, ui=None)
Parameters
  • parent (QtWidgets.QWidget) – parent to attach widget to.

  • ui (module) – UI form to use for this widget. Must define a QFrame and have a QPushButton widget named close_btn. If None, will use the default form for this frame.

Box = 1
DrawChildren = 2
DrawWindowBackground = 1
HLine = 4
IgnoreMask = 4
NoFrame = 0
class PaintDeviceMetric(value)

Bases: enum.Enum

An enumeration.

PdmWidth = 1
PdmHeight = 2
PdmWidthMM = 3
PdmHeightMM = 4
PdmNumColors = 5
PdmDepth = 6
PdmDpiX = 7
PdmDpiY = 8
PdmPhysicalDpiX = 9
PdmPhysicalDpiY = 10
PdmDevicePixelRatio = 11
PdmDevicePixelRatioScaled = 12
Panel = 2
PdmDepth = 6
PdmDevicePixelRatio = 11
PdmDevicePixelRatioScaled = 12
PdmDpiX = 7
PdmDpiY = 8
PdmHeight = 2
PdmHeightMM = 4
PdmNumColors = 5
PdmPhysicalDpiX = 9
PdmPhysicalDpiY = 10
PdmWidth = 1
PdmWidthMM = 3
Plain = 16
Raised = 32
class RenderFlag(value)

Bases: enum.Flag

An enumeration.

DrawWindowBackground = 1
DrawChildren = 2
IgnoreMask = 4
class Shadow(value)

Bases: enum.IntEnum

An enumeration.

Plain = 16
Raised = 32
Sunken = 48
Shadow_Mask = 240
class Shape(value)

Bases: enum.IntEnum

An enumeration.

NoFrame = 0
Box = 1
Panel = 2
WinPanel = 3
HLine = 4
VLine = 5
StyledPanel = 6
Shape_Mask = 15
class StyleMask(value)

Bases: enum.Enum

An enumeration.

Shadow_Mask = 240
Shape_Mask = 15
StyledPanel = 6
Sunken = 48
VLine = 5
WinPanel = 3
acceptDrops(self) bool
accessibleDescription(self) str
accessibleName(self) str
actionEvent(self, QActionEvent)
actions(self) List[QAction]
activateWindow(self)
addAction(self, QAction)
addActions(self, Iterable[QAction])
adjustSize(self)
autoFillBackground(self) bool
backgroundRole(self) QPalette.ColorRole
baseSize(self) QSize
blockSignals(self, bool) bool
changeEvent(self, QEvent)
childAt(self, QPoint) QWidget
BorderlessPopUpFrame.childAt(self, int, int) -> QWidget
childEvent(self, QChildEvent)
children(self) List[QObject]
childrenRect(self) QRect
childrenRegion(self) QRegion
clearFocus(self)
clearMask(self)
close(self) bool
closeEvent(self, QCloseEvent)
colorCount(self) int
connectNotify(self, QMetaMethod)
contentsMargins(self) QMargins
contentsRect(self) QRect
contextMenuEvent(self, QContextMenuEvent)
contextMenuPolicy(self) Qt.ContextMenuPolicy
create(self, window: PyQt6.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
createWindowContainer(QWindow, parent: QWidget = None, flags: Qt.WindowType = Qt.WindowFlags()) QWidget
cursor(self) QCursor
customContextMenuRequested

customContextMenuRequested(self, QPoint) [signal]

customEvent(self, QEvent)
deleteLater(self)
depth(self) int
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
destroyed

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

devType(self) int
devicePixelRatio(self) float
devicePixelRatioF(self) float
devicePixelRatioFScale() float
disconnect(QMetaObject.Connection) bool
disconnect(self) None
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
drawFrame(self, QPainter)
dropEvent(self, QDropEvent)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) List[QByteArray]
effectiveWinId(self) PyQt6.sip.voidptr
ensurePolished(self)
enterEvent(self, QEnterEvent)
event(self, QEvent) bool
eventFilter(self, QObject, QEvent) bool
find(PyQt6.sip.voidptr) QWidget
findChild(self, type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
findChild(self, Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
findChildren(self, type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, type, QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, Tuple, QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPolicy(self) Qt.FocusPolicy
focusPreviousChild(self) bool
focusProxy(self) QWidget
focusWidget(self) QWidget
font(self) QFont
fontInfo(self) QFontInfo
fontMetrics(self) QFontMetrics
foregroundRole(self) QPalette.ColorRole
frameGeometry(self) QRect
frameRect(self) QRect
frameShadow(self) QFrame.Shadow
frameShape(self) QFrame.Shape
frameSize(self) QSize
frameStyle(self) int
frameWidth(self) int
geometry(self) QRect
grab(self, rectangle: QRect = QRect(QPoint(0, 0), QSize(- 1, - 1))) QPixmap
grabGesture(self, Qt.GestureType, flags: Qt.GestureFlag = Qt.GestureFlags())
grabKeyboard(self)
grabMouse(self)
grabMouse(self, Union[QCursor, Qt.CursorShape]) None
grabShortcut(self, Union[QKeySequence, QKeySequence.StandardKey, str, int], context: Qt.ShortcutContext = Qt.WindowShortcut) int
graphicsEffect(self) QGraphicsEffect
graphicsProxyWidget(self) QGraphicsProxyWidget
hasFocus(self) bool
hasHeightForWidth(self) bool
hasMouseTracking(self) bool
hasTabletTracking(self) bool
height(self) int
heightForWidth(self, int) int
heightMM(self) int
hide(self)
hideEvent(self, QHideEvent)
inherits(self, str) bool
initPainter(self, QPainter)
initStyleOption(self, QStyleOptionFrame)
inputMethodEvent(self, QInputMethodEvent)
inputMethodHints(self) Qt.InputMethodHint
inputMethodQuery(self, Qt.InputMethodQuery) Any
BorderlessPopUpFrame.insertAction(self, QAction, QAction)
insertActions(self, QAction, Iterable[QAction])
installEventFilter(self, QObject)
isActiveWindow(self) bool
isAncestorOf(self, QWidget) bool
isEnabled(self) bool
isEnabledTo(self, QWidget) bool
isFullScreen(self) bool
isHidden(self) bool
isLeftToRight(self) bool
isMaximized(self) bool
isMinimized(self) bool
isModal(self) bool
isRightToLeft(self) bool
isSignalConnected(self, QMetaMethod) bool
isVisible(self) bool
isVisibleTo(self, QWidget) bool
isWidgetType(self) bool
isWindow(self) bool
isWindowModified(self) bool
isWindowType(self) bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
keyboardGrabber() QWidget
killTimer(self, int)
layout(self) QLayout
layoutDirection(self) Qt.LayoutDirection
leaveEvent(self, QEvent)
lineWidth(self) int
locale(self) QLocale
logicalDpiX(self) int
logicalDpiY(self) int
lower(self)
mapFrom(self, QWidget, QPoint) QPoint
mapFrom(self, QWidget, QPointF) QPointF
mapFromGlobal(self, QPoint) QPoint
mapFromGlobal(self, QPointF) QPointF
mapFromParent(self, QPoint) QPoint
mapFromParent(self, QPointF) QPointF
mapTo(self, QWidget, QPoint) QPoint
mapTo(self, QWidget, QPointF) QPointF
mapToGlobal(self, QPoint) QPoint
mapToGlobal(self, QPointF) QPointF
mapToParent(self, QPoint) QPoint
mapToParent(self, QPointF) QPointF
mask(self) QRegion
maximumHeight(self) int
maximumSize(self) QSize
maximumWidth(self) int
metaObject(self) QMetaObject
metric(self, QPaintDevice.PaintDeviceMetric) int
midLineWidth(self) int
minimumHeight(self) int
minimumSize(self) QSize
minimumSizeHint(self) QSize
minimumWidth(self) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseGrabber() QWidget
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
move(self, QPoint)
BorderlessPopUpFrame.move(self, int, int) -> None
moveEvent(self, QMoveEvent)
moveToThread(self, QThread)
nativeEvent(self, QByteArray, PyQt6.sip.voidptr) Tuple[bool, PyQt6.sip.voidptr]
nativeParentWidget(self) QWidget
nextInFocusChain(self) QWidget
normalGeometry(self) QRect
objectName(self) str
objectNameChanged

objectNameChanged(self, str) [signal]

overrideWindowFlags(self, Qt.WindowType)
overrideWindowState(self, Qt.WindowState)
paintEngine(self) QPaintEngine
paintEvent(self, QPaintEvent)
paintingActive(self) bool
palette(self) QPalette
parent(self) QObject
parentWidget(self) QWidget
physicalDpiX(self) int
physicalDpiY(self) int
pos(self) QPoint
previousInFocusChain(self) QWidget
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.

raise_(self)
receivers(self, PYQT_SIGNAL) int
rect(self) QRect
releaseKeyboard(self)
releaseMouse(self)
releaseShortcut(self, int)
removeAction(self, QAction)
removeEventFilter(self, QObject)
render(self, QPaintDevice, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: QWidget.RenderFlag = QWidget.RenderFlags(QWidget.DrawWindowBackground | QWidget.DrawChildren))
render(self, QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: QWidget.RenderFlag = QWidget.RenderFlags(QWidget.DrawWindowBackground | QWidget.DrawChildren)) None
repaint(self)
BorderlessPopUpFrame.repaint(self, int, int, int, int) -> None
repaint(self, QRect) None
repaint(self, QRegion) None
resize(self, QSize)
BorderlessPopUpFrame.resize(self, int, int) -> None
resizeEvent(self, QResizeEvent)
restoreGeometry(self, QByteArray) bool
saveGeometry(self) QByteArray
screen(self) QScreen
BorderlessPopUpFrame.scroll(self, int, int)
BorderlessPopUpFrame.scroll(self, int, int, QRect) -> None
sender(self) QObject
senderSignalIndex(self) int
setAcceptDrops(self, bool)
setAccessibleDescription(self, str)
setAccessibleName(self, str)
setAttribute(self, Qt.WidgetAttribute, on: bool = True)
setAutoFillBackground(self, bool)
setBackgroundRole(self, QPalette.ColorRole)
BorderlessPopUpFrame.setBaseSize(self, int, int)
setBaseSize(self, QSize) None
BorderlessPopUpFrame.setContentsMargins(self, int, int, int, int)
setContentsMargins(self, QMargins) None
setContextMenuPolicy(self, Qt.ContextMenuPolicy)
setCursor(self, Union[QCursor, Qt.CursorShape])
setDisabled(self, bool)
setEnabled(self, bool)
setFixedHeight(self, int)
setFixedSize(self, QSize)
BorderlessPopUpFrame.setFixedSize(self, int, int) -> None
setFixedWidth(self, int)
setFocus(self)
setFocus(self, Qt.FocusReason) None
setFocusPolicy(self, Qt.FocusPolicy)
setFocusProxy(self, QWidget)
setFont(self, QFont)
setForegroundRole(self, QPalette.ColorRole)
setFrameRect(self, QRect)
setFrameShadow(self, QFrame.Shadow)
setFrameShape(self, QFrame.Shape)
setFrameStyle(self, int)
setGeometry(self, QRect)
BorderlessPopUpFrame.setGeometry(self, int, int, int, int) -> None
setGraphicsEffect(self, QGraphicsEffect)
setHidden(self, bool)
setInputMethodHints(self, Qt.InputMethodHint)
setLayout(self, QLayout)
setLayoutDirection(self, Qt.LayoutDirection)
setLineWidth(self, int)
setLocale(self, QLocale)
setMask(self, QBitmap)
setMask(self, QRegion) None
setMaximumHeight(self, int)
BorderlessPopUpFrame.setMaximumSize(self, int, int)
setMaximumSize(self, QSize) None
setMaximumWidth(self, int)
setMidLineWidth(self, int)
setMinimumHeight(self, int)
BorderlessPopUpFrame.setMinimumSize(self, int, int)
setMinimumSize(self, QSize) None
setMinimumWidth(self, int)
setMouseTracking(self, bool)
setObjectName(self, str)
setPalette(self, QPalette)
setParent(self, QWidget)
setParent(self, QWidget, Qt.WindowType) None
setProperty(self, str, Any) bool
setScreen(self, QScreen)
setShortcutAutoRepeat(self, int, enabled: bool = True)
setShortcutEnabled(self, int, enabled: bool = True)
BorderlessPopUpFrame.setSizeIncrement(self, int, int)
setSizeIncrement(self, QSize) None
setSizePolicy(self, QSizePolicy)
setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy) None
setStatusTip(self, str)
setStyle(self, QStyle)
setStyleSheet(self, str)
BorderlessPopUpFrame.setTabOrder(QWidget, QWidget)
setTabletTracking(self, bool)
setToolTip(self, str)
setToolTipDuration(self, int)
setUpdatesEnabled(self, bool)
setVisible(self, bool)
setWhatsThis(self, str)
setWindowFilePath(self, str)
setWindowFlag(self, Qt.WindowType, on: bool = True)
setWindowFlags(self, Qt.WindowType)
setWindowIcon(self, QIcon)
setWindowIconText(self, str)
setWindowModality(self, Qt.WindowModality)
setWindowModified(self, bool)
setWindowOpacity(self, float)
setWindowRole(self, str)
setWindowState(self, Qt.WindowState)
setWindowTitle(self, str)
sharedPainter(self) QPainter
show(self)
showEvent(self, QShowEvent)
showFullScreen(self)
showMaximized(self)
showMinimized(self)
showNormal(self)
signalsBlocked(self) bool
size(self) QSize
sizeHint(self) QSize
sizeIncrement(self) QSize
sizePolicy(self) QSizePolicy
stackUnder(self, QWidget)
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) int
staticMetaObject = <PyQt6.QtCore.QMetaObject object>
statusTip(self) str
style(self) QStyle
styleSheet(self) str
tabletEvent(self, QTabletEvent)
testAttribute(self, Qt.WidgetAttribute) bool
thread(self) QThread
timerEvent(self, QTimerEvent)
toolTip(self) str
toolTipDuration(self) int
tr(str, disambiguation: str = None, n: int = - 1) str
underMouse(self) bool
ungrabGesture(self, Qt.GestureType)
unsetCursor(self)
unsetLayoutDirection(self)
unsetLocale(self)
update(self)
update(self, QRect) None
update(self, QRegion) None
BorderlessPopUpFrame.update(self, int, int, int, int) -> None
updateGeometry(self)
updateMicroFocus(self, query: Qt.InputMethodQuery = Qt.ImQueryAll)
updatesEnabled(self) bool
visibleRegion(self) QRegion
whatsThis(self) str
wheelEvent(self, QWheelEvent)
width(self) int
widthMM(self) int
winId(self) PyQt6.sip.voidptr
window(self) QWidget
windowFilePath(self) str
windowFlags(self) Qt.WindowType
windowHandle(self) QWindow
windowIcon(self) QIcon
windowIconChanged

windowIconChanged(self, QIcon) [signal]

windowIconText(self) str
windowIconTextChanged

windowIconTextChanged(self, str) [signal]

windowModality(self) Qt.WindowModality
windowOpacity(self) float
windowRole(self) str
windowState(self) Qt.WindowState
windowTitle(self) str
windowTitleChanged

windowTitleChanged(self, str) [signal]

windowType(self) Qt.WindowType
x(self) int
y(self) int
schrodinger.ui.qt.utils.join_images(pic1, pic2, side_by_side=True)

Given two QPictures, join them into one image either side by side, or one below the other. If either image is smaller than the other, the smaller one will be centered accordingly.

Parameters
  • pic1 (QtGui.QImage or QtGui.QPicture) – the first picture to place into the larger image

  • pic2 (QtGui.QImage or QtGui.QPicture) – the second picture to place into the larger image

  • side_by_side (bool) – whether to place the two pictures side by side, or one below the other.

Returns

the final constructed image.

Return type

QtGui.QImage

class schrodinger.ui.qt.utils.ButtonAcceptsFocusMixin(*args, **kwargs)

Bases: object

A mixin to ensure that a button takes focus when it’s pressed. This forces any open table delegates to lose focus, which triggers the data to be committed. This won’t happen by default with QPushButtons on Mac and with QToolButtons on all platforms. (See PANEL-1113.)

__init__(*args, **kwargs)
class schrodinger.ui.qt.utils.AcceptsFocusPushButton(*args, **kwargs)

Bases: schrodinger.ui.qt.utils.ButtonAcceptsFocusMixin, PyQt6.QtWidgets.QPushButton

DrawChildren = 2
DrawWindowBackground = 1
IgnoreMask = 4
class PaintDeviceMetric(value)

Bases: enum.Enum

An enumeration.

PdmWidth = 1
PdmHeight = 2
PdmWidthMM = 3
PdmHeightMM = 4
PdmNumColors = 5
PdmDepth = 6
PdmDpiX = 7
PdmDpiY = 8
PdmPhysicalDpiX = 9
PdmPhysicalDpiY = 10
PdmDevicePixelRatio = 11
PdmDevicePixelRatioScaled = 12
PdmDepth = 6
PdmDevicePixelRatio = 11
PdmDevicePixelRatioScaled = 12
PdmDpiX = 7
PdmDpiY = 8
PdmHeight = 2
PdmHeightMM = 4
PdmNumColors = 5
PdmPhysicalDpiX = 9
PdmPhysicalDpiY = 10
PdmWidth = 1
PdmWidthMM = 3
class RenderFlag(value)

Bases: enum.Flag

An enumeration.

DrawWindowBackground = 1
DrawChildren = 2
IgnoreMask = 4
__init__(*args, **kwargs)
acceptDrops(self) bool
accessibleDescription(self) str
accessibleName(self) str
actionEvent(self, QActionEvent)
actions(self) List[QAction]
activateWindow(self)
addAction(self, QAction)
addActions(self, Iterable[QAction])
adjustSize(self)
animateClick(self)
autoDefault(self) bool
autoExclusive(self) bool
autoFillBackground(self) bool
autoRepeat(self) bool
autoRepeatDelay(self) int
autoRepeatInterval(self) int
backgroundRole(self) QPalette.ColorRole
baseSize(self) QSize
blockSignals(self, bool) bool
changeEvent(self, QEvent)
checkStateSet(self)
childAt(self, QPoint) QWidget
AcceptsFocusPushButton.childAt(self, int, int) -> QWidget
childEvent(self, QChildEvent)
children(self) List[QObject]
childrenRect(self) QRect
childrenRegion(self) QRegion
clearFocus(self)
clearMask(self)
click(self)
clicked

clicked(self, checked: bool = False) [signal]

close(self) bool
closeEvent(self, QCloseEvent)
colorCount(self) int
connectNotify(self, QMetaMethod)
contentsMargins(self) QMargins
contentsRect(self) QRect
contextMenuEvent(self, QContextMenuEvent)
contextMenuPolicy(self) Qt.ContextMenuPolicy
create(self, window: PyQt6.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
createWindowContainer(QWindow, parent: QWidget = None, flags: Qt.WindowType = Qt.WindowFlags()) QWidget
cursor(self) QCursor
customContextMenuRequested

customContextMenuRequested(self, QPoint) [signal]

customEvent(self, QEvent)
deleteLater(self)
depth(self) int
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
destroyed

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

devType(self) int
devicePixelRatio(self) float
devicePixelRatioF(self) float
devicePixelRatioFScale() float
disconnect(QMetaObject.Connection) bool
disconnect(self) None
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) List[QByteArray]
effectiveWinId(self) PyQt6.sip.voidptr
ensurePolished(self)
enterEvent(self, QEnterEvent)
event(self, QEvent) bool
eventFilter(self, QObject, QEvent) bool
find(PyQt6.sip.voidptr) QWidget
findChild(self, type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
findChild(self, Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
findChildren(self, type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, type, QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, Tuple, QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPolicy(self) Qt.FocusPolicy
focusPreviousChild(self) bool
focusProxy(self) QWidget
focusWidget(self) QWidget
font(self) QFont
fontInfo(self) QFontInfo
fontMetrics(self) QFontMetrics
foregroundRole(self) QPalette.ColorRole
frameGeometry(self) QRect
frameSize(self) QSize
geometry(self) QRect
grab(self, rectangle: QRect = QRect(QPoint(0, 0), QSize(- 1, - 1))) QPixmap
grabGesture(self, Qt.GestureType, flags: Qt.GestureFlag = Qt.GestureFlags())
grabKeyboard(self)
grabMouse(self)
grabMouse(self, Union[QCursor, Qt.CursorShape]) None
grabShortcut(self, Union[QKeySequence, QKeySequence.StandardKey, str, int], context: Qt.ShortcutContext = Qt.WindowShortcut) int
graphicsEffect(self) QGraphicsEffect
graphicsProxyWidget(self) QGraphicsProxyWidget
group(self) QButtonGroup
hasFocus(self) bool
hasHeightForWidth(self) bool
hasMouseTracking(self) bool
hasTabletTracking(self) bool
height(self) int
heightForWidth(self, int) int
heightMM(self) int
hide(self)
hideEvent(self, QHideEvent)
hitButton(self, QPoint) bool
icon(self) QIcon
iconSize(self) QSize
inherits(self, str) bool
initPainter(self, QPainter)
initStyleOption(self, QStyleOptionButton)
inputMethodEvent(self, QInputMethodEvent)
inputMethodHints(self) Qt.InputMethodHint
inputMethodQuery(self, Qt.InputMethodQuery) Any
AcceptsFocusPushButton.insertAction(self, QAction, QAction)
insertActions(self, QAction, Iterable[QAction])
installEventFilter(self, QObject)
isActiveWindow(self) bool
isAncestorOf(self, QWidget) bool
isCheckable(self) bool
isChecked(self) bool
isDefault(self) bool
isDown(self) bool
isEnabled(self) bool
isEnabledTo(self, QWidget) bool
isFlat(self) bool
isFullScreen(self) bool
isHidden(self) bool
isLeftToRight(self) bool
isMaximized(self) bool
isMinimized(self) bool
isModal(self) bool
isRightToLeft(self) bool
isSignalConnected(self, QMetaMethod) bool
isVisible(self) bool
isVisibleTo(self, QWidget) bool
isWidgetType(self) bool
isWindow(self) bool
isWindowModified(self) bool
isWindowType(self) bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
keyboardGrabber() QWidget
killTimer(self, int)
layout(self) QLayout
layoutDirection(self) Qt.LayoutDirection
leaveEvent(self, QEvent)
locale(self) QLocale
logicalDpiX(self) int
logicalDpiY(self) int
lower(self)
mapFrom(self, QWidget, QPoint) QPoint
mapFrom(self, QWidget, QPointF) QPointF
mapFromGlobal(self, QPoint) QPoint
mapFromGlobal(self, QPointF) QPointF
mapFromParent(self, QPoint) QPoint
mapFromParent(self, QPointF) QPointF
mapTo(self, QWidget, QPoint) QPoint
mapTo(self, QWidget, QPointF) QPointF
mapToGlobal(self, QPoint) QPoint
mapToGlobal(self, QPointF) QPointF
mapToParent(self, QPoint) QPoint
mapToParent(self, QPointF) QPointF
mask(self) QRegion
maximumHeight(self) int
maximumSize(self) QSize
maximumWidth(self) int
menu(self) QMenu
metaObject(self) QMetaObject
metric(self, QPaintDevice.PaintDeviceMetric) int
minimumHeight(self) int
minimumSize(self) QSize
minimumSizeHint(self) QSize
minimumWidth(self) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseGrabber() QWidget
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
move(self, QPoint)
AcceptsFocusPushButton.move(self, int, int) -> None
moveEvent(self, QMoveEvent)
moveToThread(self, QThread)
nativeEvent(self, QByteArray, PyQt6.sip.voidptr) Tuple[bool, PyQt6.sip.voidptr]
nativeParentWidget(self) QWidget
nextCheckState(self)
nextInFocusChain(self) QWidget
normalGeometry(self) QRect
objectName(self) str
objectNameChanged

objectNameChanged(self, str) [signal]

overrideWindowFlags(self, Qt.WindowType)
overrideWindowState(self, Qt.WindowState)
paintEngine(self) QPaintEngine
paintEvent(self, QPaintEvent)
paintingActive(self) bool
palette(self) QPalette
parent(self) QObject
parentWidget(self) QWidget
physicalDpiX(self) int
physicalDpiY(self) int
pos(self) QPoint
pressed

pressed(self) [signal]

previousInFocusChain(self) QWidget
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.

raise_(self)
receivers(self, PYQT_SIGNAL) int
rect(self) QRect
releaseKeyboard(self)
releaseMouse(self)
releaseShortcut(self, int)
released

released(self) [signal]

removeAction(self, QAction)
removeEventFilter(self, QObject)
render(self, QPaintDevice, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: QWidget.RenderFlag = QWidget.RenderFlags(QWidget.DrawWindowBackground | QWidget.DrawChildren))
render(self, QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: QWidget.RenderFlag = QWidget.RenderFlags(QWidget.DrawWindowBackground | QWidget.DrawChildren)) None
repaint(self)
AcceptsFocusPushButton.repaint(self, int, int, int, int) -> None
repaint(self, QRect) None
repaint(self, QRegion) None
resize(self, QSize)
AcceptsFocusPushButton.resize(self, int, int) -> None
resizeEvent(self, QResizeEvent)
restoreGeometry(self, QByteArray) bool
saveGeometry(self) QByteArray
screen(self) QScreen
AcceptsFocusPushButton.scroll(self, int, int)
AcceptsFocusPushButton.scroll(self, int, int, QRect) -> None
sender(self) QObject
senderSignalIndex(self) int
setAcceptDrops(self, bool)
setAccessibleDescription(self, str)
setAccessibleName(self, str)
setAttribute(self, Qt.WidgetAttribute, on: bool = True)
setAutoDefault(self, bool)
setAutoExclusive(self, bool)
setAutoFillBackground(self, bool)
setAutoRepeat(self, bool)
setAutoRepeatDelay(self, int)
setAutoRepeatInterval(self, int)
setBackgroundRole(self, QPalette.ColorRole)
AcceptsFocusPushButton.setBaseSize(self, int, int)
setBaseSize(self, QSize) None
setCheckable(self, bool)
setChecked(self, bool)
AcceptsFocusPushButton.setContentsMargins(self, int, int, int, int)
setContentsMargins(self, QMargins) None
setContextMenuPolicy(self, Qt.ContextMenuPolicy)
setCursor(self, Union[QCursor, Qt.CursorShape])
setDefault(self, bool)
setDisabled(self, bool)
setDown(self, bool)
setEnabled(self, bool)
setFixedHeight(self, int)
setFixedSize(self, QSize)
AcceptsFocusPushButton.setFixedSize(self, int, int) -> None
setFixedWidth(self, int)
setFlat(self, bool)
setFocus(self)
setFocus(self, Qt.FocusReason) None
setFocusPolicy(self, Qt.FocusPolicy)
setFocusProxy(self, QWidget)
setFont(self, QFont)
setForegroundRole(self, QPalette.ColorRole)
setGeometry(self, QRect)
AcceptsFocusPushButton.setGeometry(self, int, int, int, int) -> None
setGraphicsEffect(self, QGraphicsEffect)
setHidden(self, bool)
setIcon(self, QIcon)
setIconSize(self, QSize)
setInputMethodHints(self, Qt.InputMethodHint)
setLayout(self, QLayout)
setLayoutDirection(self, Qt.LayoutDirection)
setLocale(self, QLocale)
setMask(self, QBitmap)
setMask(self, QRegion) None
setMaximumHeight(self, int)
AcceptsFocusPushButton.setMaximumSize(self, int, int)
setMaximumSize(self, QSize) None
setMaximumWidth(self, int)
setMenu(self, QMenu)
setMinimumHeight(self, int)
AcceptsFocusPushButton.setMinimumSize(self, int, int)
setMinimumSize(self, QSize) None
setMinimumWidth(self, int)
setMouseTracking(self, bool)
setObjectName(self, str)
setPalette(self, QPalette)
setParent(self, QWidget)
setParent(self, QWidget, Qt.WindowType) None
setProperty(self, str, Any) bool
setScreen(self, QScreen)
setShortcut(self, Union[QKeySequence, QKeySequence.StandardKey, str, int])
setShortcutAutoRepeat(self, int, enabled: bool = True)
setShortcutEnabled(self, int, enabled: bool = True)
AcceptsFocusPushButton.setSizeIncrement(self, int, int)
setSizeIncrement(self, QSize) None
setSizePolicy(self, QSizePolicy)
setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy) None
setStatusTip(self, str)
setStyle(self, QStyle)
setStyleSheet(self, str)
AcceptsFocusPushButton.setTabOrder(QWidget, QWidget)
setTabletTracking(self, bool)
setText(self, str)
setToolTip(self, str)
setToolTipDuration(self, int)
setUpdatesEnabled(self, bool)
setVisible(self, bool)
setWhatsThis(self, str)
setWindowFilePath(self, str)
setWindowFlag(self, Qt.WindowType, on: bool = True)
setWindowFlags(self, Qt.WindowType)
setWindowIcon(self, QIcon)
setWindowIconText(self, str)
setWindowModality(self, Qt.WindowModality)
setWindowModified(self, bool)
setWindowOpacity(self, float)
setWindowRole(self, str)
setWindowState(self, Qt.WindowState)
setWindowTitle(self, str)
sharedPainter(self) QPainter
shortcut(self) QKeySequence
show(self)
showEvent(self, QShowEvent)
showFullScreen(self)
showMaximized(self)
showMenu(self)
showMinimized(self)
showNormal(self)
signalsBlocked(self) bool
size(self) QSize
sizeHint(self) QSize
sizeIncrement(self) QSize
sizePolicy(self) QSizePolicy
stackUnder(self, QWidget)
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) int
staticMetaObject = <PyQt6.QtCore.QMetaObject object>
statusTip(self) str
style(self) QStyle
styleSheet(self) str
tabletEvent(self, QTabletEvent)
testAttribute(self, Qt.WidgetAttribute) bool
text(self) str
thread(self) QThread
timerEvent(self, QTimerEvent)
toggle(self)
toggled

toggled(self, bool) [signal]

toolTip(self) str
toolTipDuration(self) int
tr(str, disambiguation: str = None, n: int = - 1) str
underMouse(self) bool
ungrabGesture(self, Qt.GestureType)
unsetCursor(self)
unsetLayoutDirection(self)
unsetLocale(self)
update(self)
update(self, QRect) None
update(self, QRegion) None
AcceptsFocusPushButton.update(self, int, int, int, int) -> None
updateGeometry(self)
updateMicroFocus(self, query: Qt.InputMethodQuery = Qt.ImQueryAll)
updatesEnabled(self) bool
visibleRegion(self) QRegion
whatsThis(self) str
wheelEvent(self, QWheelEvent)
width(self) int
widthMM(self) int
winId(self) PyQt6.sip.voidptr
window(self) QWidget
windowFilePath(self) str
windowFlags(self) Qt.WindowType
windowHandle(self) QWindow
windowIcon(self) QIcon
windowIconChanged

windowIconChanged(self, QIcon) [signal]

windowIconText(self) str
windowIconTextChanged

windowIconTextChanged(self, str) [signal]

windowModality(self) Qt.WindowModality
windowOpacity(self) float
windowRole(self) str
windowState(self) Qt.WindowState
windowTitle(self) str
windowTitleChanged

windowTitleChanged(self, str) [signal]

windowType(self) Qt.WindowType
x(self) int
y(self) int
schrodinger.ui.qt.utils.wrap_qt_tag(text)

Returns text wrapped in the <qt> tag. Used to create rich-text tooltips.

schrodinger.ui.qt.utils.wrap_html_tag(text, html_tag='qt')

Returns text wrapped in a custom html tag.

schrodinger.ui.qt.utils.add_widget_to_menu(widget, menu=None)

Add widget as an action to menu.

Example with button:

btn = QtWidgets.QPushButton()
popup_widget = QtWidgets.QLabel("This text pops up from a button")
menu = add_widget_to_menu(popup_widget)
btn.setMenu(menu)

Example with menu:

menu = QtWidgets.QMenu()
popup_widget = QtWidgets.QLabel("This text appears as a menu action")
add_widget_to_menu(popup_widget, menu)
Parameters
  • widget (QtWidgets.QWidget) – The widget to show as a menu action

  • menu (QtWidgets.QMenu or NoneType) – The menu to show the widget in. If None, a new menu will be created.

Returns

The menu

Return type

QtWidgets.QMenu

schrodinger.ui.qt.utils.update_widget_style(widget)

Utility function to update widget style. When user applies stylesheet widget does not update immediately unless user explicitly calls polish()/unpolish on widget.

Parameters

widget – The widget to be updated.

schrodinger.ui.qt.utils.traverse_model_rows(model, parent=<PyQt6.QtCore.QModelIndex object>)

Traverse the rows of a model, including children (e.g. for a QTreeView)

Parameters
  • model (QtCore.QAbstractItemModel) – Item model

  • parent (QtCore.QModelIndex) – Parent index to start traversal

Returns

All row indices

Return type

generator(QtCore.QModelIndex)

schrodinger.ui.qt.utils.linux_setVisible_positioning_workaround(obj, super_obj, set_visible)

Call this from the setVisible method of a QWidget that needs to reappear in the same location it was last hidden from. This works around a bug on Linux where the widget fails to correctly set its position. To use add the following code to the widget class:

if sys.platform.startswith(“linux”):
def setVisible(self, set_visible):
qt_utils.linux_setVisible_positioning_workaround(self, super(),

set_visible)

Parameters
  • obj (QWidget) – the widget that needs to be positioned correctly on Linux. This is generally “self” in the calling method.

  • super_obj (QWidget proxy) – the return value of super() from the calling method

  • set_visible (bool) – whether to set it visible or invisible

schrodinger.ui.qt.utils.get_widgets_in_layout(layout, recursive=True)
schrodinger.ui.qt.utils.hide_layout_elements(layout: PyQt6.QtWidgets.QBoxLayout, remove_spacers: bool = True)

Recursively hide all widgets in the layout. Permanently remove spacers from the layout if remove_spacers is True.

schrodinger.ui.qt.utils.add_items_to_glayout(glayout, items)

Add the specified items to a grid layout.

Parameters

items (list[list[Union[QtWidgets.QWidget, QtWidgets.QLayout, None]]]) – List of lists of items to add to the layout, or None to leave a gap in that position

schrodinger.ui.qt.utils.show_job_launch_failure_dialog(err, parent=None)

Show dialog for informing the user of the reason why job failed to launch.

Parameters
class schrodinger.ui.qt.utils.HeaderViewWithMenuIndicator(parent=None)

Bases: PyQt6.QtWidgets.QHeaderView

A horizontal header view that shows a down arrow indicator on hover for a context menu.

Variables
  • _MENU_INDICATOR_WIDTH (float) – width of the menu indicator.

  • _MENU_INDICATOR_HEIGHT – height of the menu indicator.

  • _MENU_INDICATOR_RIGHT_MARGIN – margin to the right of the menu indicator.

  • _MENU_INDICATOR_PERCENTAGE – relative depth of the menu indicator from the parent rectangle.

  • contextMenuIndicatorClicked (QtCore.pyqtSignal) –

    emitted when their is a left mouse button click on the context menu indicator. Emitted with:

    • position of the event.

contextMenuIndicatorClicked
__init__(parent=None)
getMenuIndicatorRect(parent_rect)

Returns a rectangle at the right bottom corner of the parent rectangle.

Parameters

parent_rect (QtCore.QRect) – parent rectangle.

Returns

bounding rectangle of the visual indicator.

Return type

QtCore.QRect

paintSection(painter, rect, logical_index)

Overrides QHeaderView.paintSection. Calls the parent method to paint the section and paints a down arrow at the right bottom edge of the section on hover.

mouseMoveEvent(event)

Overrides QHeaderView.mouseMoveEvent. Updates the current hover section index and calls super method on all received events.

leaveEvent(event)

Overrides QWidget.leaveEvent. Updates the current hover section index and calls super method on all received events.

mousePressEvent(event)

Overrides QHeaderView.mousePressEvent. Emits contextMenuIndicatorClicked signal when their is a left button press in the menu indicator bounding rectangle and calls super method on all received events

AboveItem = 1
AdjustIgnored = 0
AdjustToContents = 2
AdjustToContentsOnFirstShow = 1
AllEditTriggers = 31
AnimatingState = 6
AnyKeyPressed = 16
BelowItem = 2
Box = 1
CollapsingState = 5
ContiguousSelection = 4
CurrentChanged = 1
class CursorAction(value)

Bases: enum.Enum

An enumeration.

MoveUp = 0
MoveDown = 1
MoveLeft = 2
MoveRight = 3
MoveHome = 4
MoveEnd = 5
MovePageUp = 6
MovePageDown = 7
MoveNext = 8
MovePrevious = 9
Custom = 2
DoubleClicked = 2
DragDrop = 3
class DragDropMode(value)

Bases: enum.Enum

An enumeration.

NoDragDrop = 0
DragOnly = 1
DropOnly = 2
DragDrop = 3
InternalMove = 4
DragOnly = 1
DragSelectingState = 2
DraggingState = 1
DrawChildren = 2
DrawWindowBackground = 1
class DropIndicatorPosition(value)

Bases: enum.Enum

An enumeration.

OnItem = 0
AboveItem = 1
BelowItem = 2
OnViewport = 3
DropOnly = 2
EditKeyPressed = 8
class EditTrigger(value)

Bases: enum.Flag

An enumeration.

NoEditTriggers = 0
CurrentChanged = 1
DoubleClicked = 2
SelectedClicked = 4
EditKeyPressed = 8
AnyKeyPressed = 16
AllEditTriggers = 31
EditingState = 3
EnsureVisible = 0
ExpandingState = 4
ExtendedSelection = 3
Fixed = 2
HLine = 4
IgnoreMask = 4
Interactive = 0
InternalMove = 4
MoveDown = 1
MoveEnd = 5
MoveHome = 4
MoveLeft = 2
MoveNext = 8
MovePageDown = 7
MovePageUp = 6
MovePrevious = 9
MoveRight = 3
MoveUp = 0
MultiSelection = 2
NoDragDrop = 0
NoEditTriggers = 0
NoFrame = 0
NoSelection = 0
NoState = 0
OnItem = 0
OnViewport = 3
class PaintDeviceMetric(value)

Bases: enum.Enum

An enumeration.

PdmWidth = 1
PdmHeight = 2
PdmWidthMM = 3
PdmHeightMM = 4
PdmNumColors = 5
PdmDepth = 6
PdmDpiX = 7
PdmDpiY = 8
PdmPhysicalDpiX = 9
PdmPhysicalDpiY = 10
PdmDevicePixelRatio = 11
PdmDevicePixelRatioScaled = 12
Panel = 2
PdmDepth = 6
PdmDevicePixelRatio = 11
PdmDevicePixelRatioScaled = 12
PdmDpiX = 7
PdmDpiY = 8
PdmHeight = 2
PdmHeightMM = 4
PdmNumColors = 5
PdmPhysicalDpiX = 9
PdmPhysicalDpiY = 10
PdmWidth = 1
PdmWidthMM = 3
Plain = 16
PositionAtBottom = 2
PositionAtCenter = 3
PositionAtTop = 1
Raised = 32
class RenderFlag(value)

Bases: enum.Flag

An enumeration.

DrawWindowBackground = 1
DrawChildren = 2
IgnoreMask = 4
class ResizeMode(value)

Bases: enum.Enum

An enumeration.

Interactive = 0
Fixed = 2
Stretch = 1
ResizeToContents = 3
Custom = 2
ResizeToContents = 3
class ScrollHint(value)

Bases: enum.Enum

An enumeration.

EnsureVisible = 0
PositionAtTop = 1
PositionAtBottom = 2
PositionAtCenter = 3
class ScrollMode(value)

Bases: enum.Enum

An enumeration.

ScrollPerItem = 0
ScrollPerPixel = 1
ScrollPerItem = 0
ScrollPerPixel = 1
SelectColumns = 2
SelectItems = 0
SelectRows = 1
SelectedClicked = 4
class SelectionBehavior(value)

Bases: enum.Enum

An enumeration.

SelectItems = 0
SelectRows = 1
SelectColumns = 2
class SelectionMode(value)

Bases: enum.Enum

An enumeration.

NoSelection = 0
SingleSelection = 1
MultiSelection = 2
ExtendedSelection = 3
ContiguousSelection = 4
class Shadow(value)

Bases: enum.IntEnum

An enumeration.

Plain = 16
Raised = 32
Sunken = 48
Shadow_Mask = 240
class Shape(value)

Bases: enum.IntEnum

An enumeration.

NoFrame = 0
Box = 1
Panel = 2
WinPanel = 3
HLine = 4
VLine = 5
StyledPanel = 6
Shape_Mask = 15
SingleSelection = 1
class SizeAdjustPolicy(value)

Bases: enum.Enum

An enumeration.

AdjustIgnored = 0
AdjustToContentsOnFirstShow = 1
AdjustToContents = 2
class State(value)

Bases: enum.Enum

An enumeration.

NoState = 0
DraggingState = 1
DragSelectingState = 2
EditingState = 3
ExpandingState = 4
CollapsingState = 5
AnimatingState = 6
Stretch = 1
class StyleMask(value)

Bases: enum.Enum

An enumeration.

Shadow_Mask = 240
Shape_Mask = 15
StyledPanel = 6
Sunken = 48
VLine = 5
WinPanel = 3
__len__()

Return len(self).

acceptDrops(self) bool
accessibleDescription(self) str
accessibleName(self) str
actionEvent(self, QActionEvent)
actions(self) List[QAction]
activateWindow(self)
activated

activated(self, QModelIndex) [signal]

addAction(self, QAction)
addActions(self, Iterable[QAction])
addScrollBarWidget(self, QWidget, Qt.AlignmentFlag)
adjustSize(self)
alternatingRowColors(self) bool
autoFillBackground(self) bool
autoScrollMargin(self) int
backgroundRole(self) QPalette.ColorRole
baseSize(self) QSize
blockSignals(self, bool) bool
cascadingSectionResizes(self) bool
changeEvent(self, QEvent)
childAt(self, QPoint) QWidget
HeaderViewWithMenuIndicator.childAt(self, int, int) -> QWidget
childEvent(self, QChildEvent)
children(self) List[QObject]
childrenRect(self) QRect
childrenRegion(self) QRegion
clearFocus(self)
clearMask(self)
clearSelection(self)
clicked

clicked(self, QModelIndex) [signal]

close(self) bool
closeEditor(self, QWidget, QAbstractItemDelegate.EndEditHint)
closeEvent(self, QCloseEvent)
closePersistentEditor(self, QModelIndex)
colorCount(self) int
commitData(self, QWidget)
connectNotify(self, QMetaMethod)
contentsMargins(self) QMargins
contentsRect(self) QRect
contextMenuEvent(self, QContextMenuEvent)
contextMenuPolicy(self) Qt.ContextMenuPolicy
cornerWidget(self) QWidget
count(self) int
create(self, window: PyQt6.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
createWindowContainer(QWindow, parent: QWidget = None, flags: Qt.WindowType = Qt.WindowFlags()) QWidget
HeaderViewWithMenuIndicator.currentChanged(self, QModelIndex, QModelIndex)
currentIndex(self) QModelIndex
cursor(self) QCursor
customContextMenuRequested

customContextMenuRequested(self, QPoint) [signal]

customEvent(self, QEvent)
HeaderViewWithMenuIndicator.dataChanged(self, QModelIndex, QModelIndex, roles: Iterable[int] = [])
defaultAlignment(self) Qt.AlignmentFlag
defaultDropAction(self) Qt.DropAction
defaultSectionSize(self) int
deleteLater(self)
depth(self) int
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
destroyed

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

devType(self) int
devicePixelRatio(self) float
devicePixelRatioF(self) float
devicePixelRatioFScale() float
dirtyRegionOffset(self) QPoint
disconnect(QMetaObject.Connection) bool
disconnect(self) None
disconnectNotify(self, QMetaMethod)
doubleClicked

doubleClicked(self, QModelIndex) [signal]

dragDropMode(self) QAbstractItemView.DragDropMode
dragDropOverwriteMode(self) bool
dragEnabled(self) bool
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
drawFrame(self, QPainter)
dropEvent(self, QDropEvent)
dropIndicatorPosition(self) QAbstractItemView.DropIndicatorPosition
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) List[QByteArray]
edit(self, QModelIndex)
edit(self, QModelIndex, QAbstractItemView.EditTrigger, QEvent) bool
editTriggers(self) QAbstractItemView.EditTrigger
editorDestroyed(self, QObject)
effectiveWinId(self) PyQt6.sip.voidptr
ensurePolished(self)
enterEvent(self, QEnterEvent)
entered

entered(self, QModelIndex) [signal]

event(self, QEvent) bool
eventFilter(self, QObject, QEvent) bool
executeDelayedItemsLayout(self)
find(PyQt6.sip.voidptr) QWidget
findChild(self, type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
findChild(self, Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
findChildren(self, type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, type, QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, Tuple, QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPolicy(self) Qt.FocusPolicy
focusPreviousChild(self) bool
focusProxy(self) QWidget
focusWidget(self) QWidget
font(self) QFont
fontInfo(self) QFontInfo
fontMetrics(self) QFontMetrics
foregroundRole(self) QPalette.ColorRole
frameGeometry(self) QRect
frameRect(self) QRect
frameShadow(self) QFrame.Shadow
frameShape(self) QFrame.Shape
frameSize(self) QSize
frameStyle(self) int
frameWidth(self) int
geometriesChanged

geometriesChanged(self) [signal]

geometry(self) QRect
grab(self, rectangle: QRect = QRect(QPoint(0, 0), QSize(- 1, - 1))) QPixmap
grabGesture(self, Qt.GestureType, flags: Qt.GestureFlag = Qt.GestureFlags())
grabKeyboard(self)
grabMouse(self)
grabMouse(self, Union[QCursor, Qt.CursorShape]) None
grabShortcut(self, Union[QKeySequence, QKeySequence.StandardKey, str, int], context: Qt.ShortcutContext = Qt.WindowShortcut) int
graphicsEffect(self) QGraphicsEffect
graphicsProxyWidget(self) QGraphicsProxyWidget
hasAutoScroll(self) bool
hasFocus(self) bool
hasHeightForWidth(self) bool
hasMouseTracking(self) bool
hasTabletTracking(self) bool
headerDataChanged(self, Qt.Orientation, int, int)
height(self) int
heightForWidth(self, int) int
heightMM(self) int
hiddenSectionCount(self) int
hide(self)
hideEvent(self, QHideEvent)
hideSection(self, int)
highlightSections(self) bool
horizontalOffset(self) int
horizontalScrollBar(self) QScrollBar
horizontalScrollBarPolicy(self) Qt.ScrollBarPolicy
horizontalScrollMode(self) QAbstractItemView.ScrollMode
horizontalScrollbarAction(self, int)
horizontalScrollbarValueChanged(self, int)
iconSize(self) QSize
iconSizeChanged

iconSizeChanged(self, QSize) [signal]

indexAt(self, QPoint) QModelIndex
indexWidget(self, QModelIndex) QWidget
inherits(self, str) bool
initPainter(self, QPainter)
initStyleOption(self, QStyleOptionHeader)
initStyleOptionForIndex(self, QStyleOptionHeader, int)
initViewItemOption(self, QStyleOptionViewItem)
initialize(self)
initializeSections(self)
HeaderViewWithMenuIndicator.initializeSections(self, int, int) -> None
inputMethodEvent(self, QInputMethodEvent)
inputMethodHints(self) Qt.InputMethodHint
inputMethodQuery(self, Qt.InputMethodQuery) Any
HeaderViewWithMenuIndicator.insertAction(self, QAction, QAction)
insertActions(self, QAction, Iterable[QAction])
installEventFilter(self, QObject)
isActiveWindow(self) bool
isAncestorOf(self, QWidget) bool
isEnabled(self) bool
isEnabledTo(self, QWidget) bool
isFirstSectionMovable(self) bool
isFullScreen(self) bool
isHidden(self) bool
isIndexHidden(self, QModelIndex) bool
isLeftToRight(self) bool
isMaximized(self) bool
isMinimized(self) bool
isModal(self) bool
isPersistentEditorOpen(self, QModelIndex) bool
isRightToLeft(self) bool
isSectionHidden(self, int) bool
isSignalConnected(self, QMetaMethod) bool
isSortIndicatorClearable(self) bool
isSortIndicatorShown(self) bool
isVisible(self) bool
isVisibleTo(self, QWidget) bool
isWidgetType(self) bool
isWindow(self) bool
isWindowModified(self) bool
isWindowType(self) bool
itemDelegate(self) QAbstractItemDelegate
itemDelegateForColumn(self, int) QAbstractItemDelegate
itemDelegateForIndex(self, QModelIndex) QAbstractItemDelegate
itemDelegateForRow(self, int) QAbstractItemDelegate
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
keyboardGrabber() QWidget
keyboardSearch(self, str)
killTimer(self, int)
layout(self) QLayout
layoutDirection(self) Qt.LayoutDirection
length(self) int
lineWidth(self) int
locale(self) QLocale
logicalDpiX(self) int
logicalDpiY(self) int
logicalIndex(self, int) int
logicalIndexAt(self, int) int
HeaderViewWithMenuIndicator.logicalIndexAt(self, int, int) -> int
logicalIndexAt(self, QPoint) int
lower(self)
mapFrom(self, QWidget, QPoint) QPoint
mapFrom(self, QWidget, QPointF) QPointF
mapFromGlobal(self, QPoint) QPoint
mapFromGlobal(self, QPointF) QPointF
mapFromParent(self, QPoint) QPoint
mapFromParent(self, QPointF) QPointF
mapTo(self, QWidget, QPoint) QPoint
mapTo(self, QWidget, QPointF) QPointF
mapToGlobal(self, QPoint) QPoint
mapToGlobal(self, QPointF) QPointF
mapToParent(self, QPoint) QPoint
mapToParent(self, QPointF) QPointF
mask(self) QRegion
maximumHeight(self) int
maximumSectionSize(self) int
maximumSize(self) QSize
maximumViewportSize(self) QSize
maximumWidth(self) int
metaObject(self) QMetaObject
metric(self, QPaintDevice.PaintDeviceMetric) int
midLineWidth(self) int
minimumHeight(self) int
minimumSectionSize(self) int
minimumSize(self) QSize
minimumSizeHint(self) QSize
minimumWidth(self) int
model(self) QAbstractItemModel
mouseDoubleClickEvent(self, QMouseEvent)
mouseGrabber() QWidget
mouseReleaseEvent(self, QMouseEvent)
move(self, QPoint)
HeaderViewWithMenuIndicator.move(self, int, int) -> None
moveCursor(self, QAbstractItemView.CursorAction, Qt.KeyboardModifier) QModelIndex
moveEvent(self, QMoveEvent)
HeaderViewWithMenuIndicator.moveSection(self, int, int)
moveToThread(self, QThread)
nativeEvent(self, QByteArray, PyQt6.sip.voidptr) Tuple[bool, PyQt6.sip.voidptr]
nativeParentWidget(self) QWidget
nextInFocusChain(self) QWidget
normalGeometry(self) QRect
objectName(self) str
objectNameChanged

objectNameChanged(self, str) [signal]

offset(self) int
openPersistentEditor(self, QModelIndex)
orientation(self) Qt.Orientation
overrideWindowFlags(self, Qt.WindowType)
overrideWindowState(self, Qt.WindowState)
paintEngine(self) QPaintEngine
paintEvent(self, QPaintEvent)
paintingActive(self) bool
palette(self) QPalette
parent(self) QObject
parentWidget(self) QWidget
physicalDpiX(self) int
physicalDpiY(self) int
pos(self) QPoint
pressed

pressed(self, QModelIndex) [signal]

previousInFocusChain(self) QWidget
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.

raise_(self)
receivers(self, PYQT_SIGNAL) int
rect(self) QRect
releaseKeyboard(self)
releaseMouse(self)
releaseShortcut(self, int)
removeAction(self, QAction)
removeEventFilter(self, QObject)
render(self, QPaintDevice, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: QWidget.RenderFlag = QWidget.RenderFlags(QWidget.DrawWindowBackground | QWidget.DrawChildren))
render(self, QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: QWidget.RenderFlag = QWidget.RenderFlags(QWidget.DrawWindowBackground | QWidget.DrawChildren)) None
repaint(self)
HeaderViewWithMenuIndicator.repaint(self, int, int, int, int) -> None
repaint(self, QRect) None
repaint(self, QRegion) None
reset(self)
resetDefaultSectionSize(self)
resetHorizontalScrollMode(self)
resetVerticalScrollMode(self)
resize(self, QSize)
HeaderViewWithMenuIndicator.resize(self, int, int) -> None
resizeContentsPrecision(self) int
resizeEvent(self, QResizeEvent)
HeaderViewWithMenuIndicator.resizeSection(self, int, int)
resizeSections(self)
resizeSections(self, QHeaderView.ResizeMode) None
restoreGeometry(self, QByteArray) bool
restoreState(self, QByteArray) bool
rootIndex(self) QModelIndex
HeaderViewWithMenuIndicator.rowsAboutToBeRemoved(self, QModelIndex, int, int)
HeaderViewWithMenuIndicator.rowsInserted(self, QModelIndex, int, int)
saveGeometry(self) QByteArray
saveState(self) QByteArray
scheduleDelayedItemsLayout(self)
screen(self) QScreen
HeaderViewWithMenuIndicator.scroll(self, int, int)
HeaderViewWithMenuIndicator.scroll(self, int, int, QRect) -> None
scrollBarWidgets(self, Qt.AlignmentFlag) List[QWidget]
HeaderViewWithMenuIndicator.scrollContentsBy(self, int, int)
HeaderViewWithMenuIndicator.scrollDirtyRegion(self, int, int)
scrollTo(self, QModelIndex, QAbstractItemView.ScrollHint)
scrollToBottom(self)
scrollToTop(self)
sectionClicked

sectionClicked(self, int) [signal]

sectionCountChanged

sectionCountChanged(self, int, int) [signal]

sectionDoubleClicked

sectionDoubleClicked(self, int) [signal]

sectionEntered

sectionEntered(self, int) [signal]

sectionHandleDoubleClicked

sectionHandleDoubleClicked(self, int) [signal]

sectionMoved

sectionMoved(self, int, int, int) [signal]

sectionPosition(self, int) int
sectionPressed

sectionPressed(self, int) [signal]

sectionResizeMode(self, int) QHeaderView.ResizeMode
sectionResized

sectionResized(self, int, int, int) [signal]

sectionSize(self, int) int
sectionSizeFromContents(self, int) QSize
sectionSizeHint(self, int) int
sectionViewportPosition(self, int) int
HeaderViewWithMenuIndicator.sectionsAboutToBeRemoved(self, QModelIndex, int, int)
sectionsClickable(self) bool
sectionsHidden(self) bool
HeaderViewWithMenuIndicator.sectionsInserted(self, QModelIndex, int, int)
sectionsMovable(self) bool
sectionsMoved(self) bool
selectAll(self)
selectedIndexes(self) List[QModelIndex]
selectionBehavior(self) QAbstractItemView.SelectionBehavior
HeaderViewWithMenuIndicator.selectionChanged(self, QItemSelection, QItemSelection)
selectionCommand(self, QModelIndex, event: QEvent = None) QItemSelectionModel.SelectionFlag
selectionMode(self) QAbstractItemView.SelectionMode
selectionModel(self) QItemSelectionModel
sender(self) QObject
senderSignalIndex(self) int
setAcceptDrops(self, bool)
setAccessibleDescription(self, str)
setAccessibleName(self, str)
setAlternatingRowColors(self, bool)
setAttribute(self, Qt.WidgetAttribute, on: bool = True)
setAutoFillBackground(self, bool)
setAutoScroll(self, bool)
setAutoScrollMargin(self, int)
setBackgroundRole(self, QPalette.ColorRole)
HeaderViewWithMenuIndicator.setBaseSize(self, int, int)
setBaseSize(self, QSize) None
setCascadingSectionResizes(self, bool)
HeaderViewWithMenuIndicator.setContentsMargins(self, int, int, int, int)
setContentsMargins(self, QMargins) None
setContextMenuPolicy(self, Qt.ContextMenuPolicy)
setCornerWidget(self, QWidget)
setCurrentIndex(self, QModelIndex)
setCursor(self, Union[QCursor, Qt.CursorShape])
setDefaultAlignment(self, Qt.AlignmentFlag)
setDefaultDropAction(self, Qt.DropAction)
setDefaultSectionSize(self, int)
setDirtyRegion(self, QRegion)
setDisabled(self, bool)
setDragDropMode(self, QAbstractItemView.DragDropMode)
setDragDropOverwriteMode(self, bool)
setDragEnabled(self, bool)
setDropIndicatorShown(self, bool)
setEditTriggers(self, QAbstractItemView.EditTrigger)
setEnabled(self, bool)
setFirstSectionMovable(self, bool)
setFixedHeight(self, int)
setFixedSize(self, QSize)
HeaderViewWithMenuIndicator.setFixedSize(self, int, int) -> None
setFixedWidth(self, int)
setFocus(self)
setFocus(self, Qt.FocusReason) None
setFocusPolicy(self, Qt.FocusPolicy)
setFocusProxy(self, QWidget)
setFont(self, QFont)
setForegroundRole(self, QPalette.ColorRole)
setFrameRect(self, QRect)
setFrameShadow(self, QFrame.Shadow)
setFrameShape(self, QFrame.Shape)
setFrameStyle(self, int)
setGeometry(self, QRect)
HeaderViewWithMenuIndicator.setGeometry(self, int, int, int, int) -> None
setGraphicsEffect(self, QGraphicsEffect)
setHidden(self, bool)
setHighlightSections(self, bool)
setHorizontalScrollBar(self, QScrollBar)
setHorizontalScrollBarPolicy(self, Qt.ScrollBarPolicy)
setHorizontalScrollMode(self, QAbstractItemView.ScrollMode)
setIconSize(self, QSize)
setIndexWidget(self, QModelIndex, QWidget)
setInputMethodHints(self, Qt.InputMethodHint)
setItemDelegate(self, QAbstractItemDelegate)
setItemDelegateForColumn(self, int, QAbstractItemDelegate)
setItemDelegateForRow(self, int, QAbstractItemDelegate)
setLayout(self, QLayout)
setLayoutDirection(self, Qt.LayoutDirection)
setLineWidth(self, int)
setLocale(self, QLocale)
setMask(self, QBitmap)
setMask(self, QRegion) None
setMaximumHeight(self, int)
setMaximumSectionSize(self, int)
HeaderViewWithMenuIndicator.setMaximumSize(self, int, int)
setMaximumSize(self, QSize) None
setMaximumWidth(self, int)
setMidLineWidth(self, int)
setMinimumHeight(self, int)
setMinimumSectionSize(self, int)
HeaderViewWithMenuIndicator.setMinimumSize(self, int, int)
setMinimumSize(self, QSize) None
setMinimumWidth(self, int)
setModel(self, QAbstractItemModel)
setMouseTracking(self, bool)
setObjectName(self, str)
setOffset(self, int)
setOffsetToLastSection(self)
setOffsetToSectionPosition(self, int)
setPalette(self, QPalette)
setParent(self, QWidget)
setParent(self, QWidget, Qt.WindowType) None
setProperty(self, str, Any) bool
setResizeContentsPrecision(self, int)
setRootIndex(self, QModelIndex)
setScreen(self, QScreen)
setSectionHidden(self, int, bool)
setSectionResizeMode(self, int, QHeaderView.ResizeMode)
setSectionResizeMode(self, QHeaderView.ResizeMode) None
setSectionsClickable(self, bool)
setSectionsMovable(self, bool)
setSelection(self, QRect, QItemSelectionModel.SelectionFlag)
setSelectionBehavior(self, QAbstractItemView.SelectionBehavior)
setSelectionMode(self, QAbstractItemView.SelectionMode)
setSelectionModel(self, QItemSelectionModel)
setShortcutAutoRepeat(self, int, enabled: bool = True)
setShortcutEnabled(self, int, enabled: bool = True)
setSizeAdjustPolicy(self, QAbstractScrollArea.SizeAdjustPolicy)
HeaderViewWithMenuIndicator.setSizeIncrement(self, int, int)
setSizeIncrement(self, QSize) None
setSizePolicy(self, QSizePolicy)
setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy) None
setSortIndicator(self, int, Qt.SortOrder)
setSortIndicatorClearable(self, bool)
setSortIndicatorShown(self, bool)
setState(self, QAbstractItemView.State)
setStatusTip(self, str)
setStretchLastSection(self, bool)
setStyle(self, QStyle)
setStyleSheet(self, str)
setTabKeyNavigation(self, bool)
HeaderViewWithMenuIndicator.setTabOrder(QWidget, QWidget)
setTabletTracking(self, bool)
setTextElideMode(self, Qt.TextElideMode)
setToolTip(self, str)
setToolTipDuration(self, int)
setUpdatesEnabled(self, bool)
setVerticalScrollBar(self, QScrollBar)
setVerticalScrollBarPolicy(self, Qt.ScrollBarPolicy)
setVerticalScrollMode(self, QAbstractItemView.ScrollMode)
setViewport(self, QWidget)
HeaderViewWithMenuIndicator.setViewportMargins(self, int, int, int, int)
setViewportMargins(self, QMargins) None
setVisible(self, bool)
setWhatsThis(self, str)
setWindowFilePath(self, str)
setWindowFlag(self, Qt.WindowType, on: bool = True)
setWindowFlags(self, Qt.WindowType)
setWindowIcon(self, QIcon)
setWindowIconText(self, str)
setWindowModality(self, Qt.WindowModality)
setWindowModified(self, bool)
setWindowOpacity(self, float)
setWindowRole(self, str)
setWindowState(self, Qt.WindowState)
setWindowTitle(self, str)
setupViewport(self, QWidget)
sharedPainter(self) QPainter
show(self)
showDropIndicator(self) bool
showEvent(self, QShowEvent)
showFullScreen(self)
showMaximized(self)
showMinimized(self)
showNormal(self)
showSection(self, int)
signalsBlocked(self) bool
size(self) QSize
sizeAdjustPolicy(self) QAbstractScrollArea.SizeAdjustPolicy
sizeHint(self) QSize
sizeHintForColumn(self, int) int
sizeHintForIndex(self, QModelIndex) QSize
sizeHintForRow(self, int) int
sizeIncrement(self) QSize
sizePolicy(self) QSizePolicy
sortIndicatorChanged

sortIndicatorChanged(self, int, Qt.SortOrder) [signal]

sortIndicatorClearableChanged

sortIndicatorClearableChanged(self, bool) [signal]

sortIndicatorOrder(self) Qt.SortOrder
sortIndicatorSection(self) int
stackUnder(self, QWidget)
startDrag(self, Qt.DropAction)
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) int
state(self) QAbstractItemView.State
staticMetaObject = <PyQt6.QtCore.QMetaObject object>
statusTip(self) str
stretchLastSection(self) bool
stretchSectionCount(self) int
style(self) QStyle
styleSheet(self) str
HeaderViewWithMenuIndicator.swapSections(self, int, int)
tabKeyNavigation(self) bool
tabletEvent(self, QTabletEvent)
testAttribute(self, Qt.WidgetAttribute) bool
textElideMode(self) Qt.TextElideMode
thread(self) QThread
timerEvent(self, QTimerEvent)
toolTip(self) str
toolTipDuration(self) int
tr(str, disambiguation: str = None, n: int = - 1) str
underMouse(self) bool
ungrabGesture(self, Qt.GestureType)
unsetCursor(self)
unsetLayoutDirection(self)
unsetLocale(self)
update(self)
update(self, QModelIndex) None
updateEditorData(self)
updateEditorGeometries(self)
updateGeometries(self)
updateGeometry(self)
updateMicroFocus(self, query: Qt.InputMethodQuery = Qt.ImQueryAll)
updateSection(self, int)
updatesEnabled(self) bool
verticalOffset(self) int
verticalScrollBar(self) QScrollBar
verticalScrollBarPolicy(self) Qt.ScrollBarPolicy
verticalScrollMode(self) QAbstractItemView.ScrollMode
verticalScrollbarAction(self, int)
verticalScrollbarValueChanged(self, int)
viewport(self) QWidget
viewportEntered

viewportEntered(self) [signal]

viewportEvent(self, QEvent) bool
viewportMargins(self) QMargins
viewportSizeHint(self) QSize
visibleRegion(self) QRegion
visualIndex(self, int) int
visualIndexAt(self, int) int
visualRect(self, QModelIndex) QRect
visualRegionForSelection(self, QItemSelection) QRegion
whatsThis(self) str
wheelEvent(self, QWheelEvent)
width(self) int
widthMM(self) int
winId(self) PyQt6.sip.voidptr
window(self) QWidget
windowFilePath(self) str
windowFlags(self) Qt.WindowType
windowHandle(self) QWindow
windowIcon(self) QIcon
windowIconChanged

windowIconChanged(self, QIcon) [signal]

windowIconText(self) str
windowIconTextChanged

windowIconTextChanged(self, str) [signal]

windowModality(self) Qt.WindowModality
windowOpacity(self) float
windowRole(self) str
windowState(self) Qt.WindowState
windowTitle(self) str
windowTitleChanged

windowTitleChanged(self, str) [signal]

windowType(self) Qt.WindowType
x(self) int
y(self) int
schrodinger.ui.qt.utils.get_view_item_options(view: PyQt6.QtWidgets.QAbstractItemView) PyQt6.QtWidgets.QStyleOptionViewItem

Retrieve the view item options for the provided table/tree view. This function will work under both Qt 5 and Qt 6.

schrodinger.ui.qt.utils.combo_find_data(combo: PyQt6.QtWidgets.QComboBox, data, role: PyQt6.QtCore.Qt.ItemDataRole = ItemDataRole.UserRole, *, error_if_missing: bool = True) int

Get the index of the item containing the specified data in a combo box. Comparisons are done in Python rather than in C++ (as they are in QComboBox.findData) so that Python types without a direct C++ mapping can be compared correctly. Note that in PyQt 6, QComboBox.findData no longer works correctly for enum.Enum data (including enum.IntEnum), so this function should be used instead.

Parameters
  • combo – The combo box to search

  • data – The data to search for

  • role – The role to search

  • error_if_missing – Whether to raise a ValueError if data is not found in combo. If False, -1 will be returned when data is missing.

Raises

ValueError – If the specified data cannot be found and error_if_missing is true.