schrodinger.application.bioluminate.actions.factory module¶
Contains Qt actions specific to the BioLuminate application.
Copyright Schrodinger, LLC. All rights reserved.
-
schrodinger.application.bioluminate.actions.factory.get_action_obj_name(name)[source]¶ Helper function to get the action’s object name according to the syntax useed to create the name. The syntax is “action_<text>” where text is the text used when setting the action.
-
schrodinger.application.bioluminate.actions.factory.replace_slot(owner, name, slot)[source]¶ Removes all slots from the action and replaces it with another slot.
- Parameters
owner – The owner of the action
name – The name used when creating the
SActionslot (callable) – The new slot to connect to
- Raises
AttributeError – When no action is found with that name in the owner
-
class
schrodinger.application.bioluminate.actions.factory.SAction(parent, name, text='', tooltip='', status_tip='', icon=None, slot=None, parent_slot=None, checkable=False, checked=False, visible=True, data=None, shortcut=None)[source]¶ Bases:
PyQt5.QtWidgets.QActionA QAction that enforces standards that are expected by some BioLuminate methods. The
setObjectNamemethod is used and the name conforms to the globalACTION_NAMEvariable in thefactorymodule.-
__init__(parent, name, text='', tooltip='', status_tip='', icon=None, slot=None, parent_slot=None, checkable=False, checked=False, visible=True, data=None, shortcut=None)[source]¶ Create a SAction object
- Parameters
parent – The parent object of this action. This is used for all
parent_slotcalls.name (str) – This will be used to name the object. The name will have
action_prepended to it.text (str) – The text to use for the action menus and toolbars
tooltip (str) – The action’s tooltip
status_tip – The string to show in the status bar when the action is hovered over.
status_tip – The string to show in the status bar when the action is hovered over.
icon (string) – The icon path used to create a
QtGui.QIconslot (callable) – The function called when action is executed
parent_slot (string) – The name of the parent function called when action is executed
checkable (bool) – Whether action has on/off state.
checkable – Whether action is on or off. Only good when
checkableis True.visible (bool) – Whether the action is shown or hidden
data (mixed) – Data associated with action
shortcut (string) – Shortcut to action
-
parent(self) → QObject¶
-
connectSlot(slot_callable=None, slot_name=None)[source]¶ Connects action to a slot by either supplying a callable or a method name that belongs to the action’s parent widget. The
slot_callablewill overrideslot_nameif both are passed in.- Parameters
slot_callable (callable) – A function passed in to connect to the action
slot_name (string) – A method name found in the actions parent
-
AboutQtRole= 3¶
-
AboutRole= 4¶
-
class
ActionEvent¶ Bases:
int
-
ApplicationSpecificRole= 2¶
-
HighPriority= 256¶
-
Hover= 1¶
-
LowPriority= 0¶
-
class
MenuRole¶ Bases:
int
-
NoRole= 0¶
-
NormalPriority= 128¶
-
PreferencesRole= 5¶
-
class
Priority¶ Bases:
int
-
QuitRole= 6¶
-
TextHeuristicRole= 1¶
-
Trigger= 0¶
-
actionGroup(self) → QActionGroup¶
-
activate(self, QAction.ActionEvent)¶
-
associatedGraphicsWidgets(self) → List[QGraphicsWidget]¶
-
associatedWidgets(self) → List[QWidget]¶
-
autoRepeat(self) → bool¶
-
blockSignals(self, bool) → bool¶
-
changed¶ changed(self) [signal]
-
childEvent(self, QChildEvent)¶
-
children(self) → List[QObject]¶
-
connectNotify(self, QMetaMethod)¶
-
customEvent(self, QEvent)¶
-
data(self) → Any¶
-
deleteLater(self)¶
-
destroyed¶ destroyed(self, object: QObject = None) [signal]
-
disconnect(self)¶
-
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: 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]
-
font(self) → QFont¶
-
hover(self)¶
-
hovered¶ hovered(self) [signal]
-
icon(self) → QIcon¶
-
iconText(self) → str¶
-
inherits(self, str) → bool¶
-
installEventFilter(self, QObject)¶
-
isCheckable(self) → bool¶
-
isChecked(self) → bool¶
-
isEnabled(self) → bool¶
-
isIconVisibleInMenu(self) → bool¶
-
isSeparator(self) → bool¶
-
isShortcutVisibleInContextMenu(self) → bool¶
-
isSignalConnected(self, QMetaMethod) → bool¶
-
isVisible(self) → bool¶
-
isWidgetType(self) → bool¶
-
isWindowType(self) → bool¶
-
killTimer(self, int)¶
-
metaObject(self) → QMetaObject¶
-
moveToThread(self, QThread)¶
-
objectName(self) → str¶
-
objectNameChanged¶ objectNameChanged(self, str) [signal]
-
parentWidget(self) → QWidget¶
-
priority(self) → QAction.Priority¶
-
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¶
-
setActionGroup(self, QActionGroup)¶
-
setAutoRepeat(self, bool)¶
-
setCheckable(self, bool)¶
-
setChecked(self, bool)¶
-
setData(self, Any)¶
-
setDisabled(self, bool)¶
-
setEnabled(self, bool)¶
-
setFont(self, QFont)¶
-
setIcon(self, QIcon)¶
-
setIconText(self, str)¶
-
setIconVisibleInMenu(self, bool)¶
-
setMenu(self, QMenu)¶
-
setMenuRole(self, QAction.MenuRole)¶
-
setObjectName(self, str)¶
-
setParent(self, QObject)¶
-
setPriority(self, QAction.Priority)¶
-
setProperty(self, str, Any) → bool¶
-
setSeparator(self, bool)¶
-
setShortcut(self, Union[QKeySequence, QKeySequence.StandardKey, str, int])¶
-
setShortcutContext(self, Qt.ShortcutContext)¶
-
setShortcutVisibleInContextMenu(self, bool)¶
-
setShortcuts(self, Iterable[Union[QKeySequence, QKeySequence.StandardKey, str, int]])¶ setShortcuts(self, QKeySequence.StandardKey)
-
setStatusTip(self, str)¶
-
setText(self, str)¶
-
setToolTip(self, str)¶
-
setVisible(self, bool)¶
-
setWhatsThis(self, str)¶
-
shortcut(self) → QKeySequence¶
-
shortcutContext(self) → Qt.ShortcutContext¶
-
shortcuts(self) → List[QKeySequence]¶
-
showStatusText(self, widget: QWidget = None) → bool¶
-
signalsBlocked(self) → bool¶
-
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int¶
-
staticMetaObject= <PyQt5.QtCore.QMetaObject object>¶
-
statusTip(self) → str¶
-
text(self) → str¶
-
thread(self) → QThread¶
-
timerEvent(self, QTimerEvent)¶
-
toggle(self)¶
-
toggled¶ toggled(self, bool) [signal]
-
toolTip(self) → str¶
-
tr(self, str, disambiguation: str = None, n: int = - 1) → str¶
-
trigger(self)¶
-
triggered¶ triggered(self, checked: bool = False) [signal]
-
whatsThis(self) → str¶
-
-
class
schrodinger.application.bioluminate.actions.factory.Factory(parent)[source]¶ Bases:
objectA class dedicated to the creation, deletion and modification of groups of actions.
-
createActions(action_params, action_order=None, parent=None)[source]¶ Creates actions.
- Parameters
action_params (dict) – Parameters used to create an action.
action_order (list of strings) – Order of actions (must be keys in
action_paramsparent (object) – Parent of actions. Default:
self.parent
- See
-
addActions(action_params, action_order=None, parent=None)[source]¶ Add actions to the current action list
-
setActions(action_params, action_order=None, parent=None)[source]¶ Replace current acction with new actions
-
getToolBar(title=None, movable=False)[source]¶ Return
self.actionslist as aQtWidgets.QToolBar- Parameters
title – Title to set to the toolbar
-