schrodinger.ui.qt.datamapper module¶
- class schrodinger.ui.qt.datamapper.TrackingDataWidgetMapper(*args, **kwargs)¶
Bases:
PyQt6.QtWidgets.QDataWidgetMapper
This class augments QtWidgets.QDataWidgetMapper with three additional features:
1) Emits a widgetChanged signal whenever any mapped widget is modified by the user
2) Provides an isDirty() method to determine whether any of the current widget values differ from the model state.
Allows QButtonGroup objects to be mapped
- widgetChanged¶
A
pyqtSignal
emitted by instances of the class.
- __init__(*args, **kwargs)¶
- isDirty()¶
Determines whether the values in the widgets match the values in the model. This will happen if the user has edited widget values but not submitted the changes.
This method is primarily intended to be used with the submitPolicy set to ManualSubmit.
If the user edits a value back to its original state, isDirty() will correctly return False.
- addMapping(widget, section)¶
See parent class for full documentation for this method. In addition, this method connects the appropriate signal on the widget so that all widget changes result in the widgetChanged signal being emitted.
This method also allows QButtonGroup to be mapped, which the parent class does not. Only exclusive button groups will work correctly - non- exclusive groups will only register the first checked button in the group.
This override of addMapping also eliminates the optional propertyName argument.
- removeMapping(self, widget: Optional[QWidget])¶
- class schrodinger.ui.qt.datamapper.MappableButtonGroup(button_group, parent=None)¶
Bases:
PyQt6.QtWidgets.QWidget
This widget is a container for a QButtonGroup used to enable button groups to be mapped by the widget mapper.
- selectionChanged¶
A
pyqtSignal
emitted by instances of the class.
- __init__(button_group, parent=None)¶
- buttons()¶
- getCurrentSelection()¶
- setCurrentSelection(sel)¶
- currentSelection¶
- pyqtProperty(type, fget=None, fset=None, freset=None, fdel=None, doc=None,
designable=True, scriptable=True, stored=True, user=False, constant=False, final=False, notify=None, revision=0) -> property attribute
type is the type of the property. It is either a type object or a string that is the name of a C++ type. freset is a function for resetting an attribute to its default value. designable sets the DESIGNABLE flag (the default is True for writable properties and False otherwise). scriptable sets the SCRIPTABLE flag. stored sets the STORED flag. user sets the USER flag. constant sets the CONSTANT flag. final sets the FINAL flag. notify is the NOTIFY signal. revision is the REVISION. The other parameters are the same as those required by the standard Python property type. Properties defined using pyqtProperty behave as both Python and Qt properties. Decorators can be used to define new properties or to modify existing ones.