Package schrodinger :: Package application :: Package msv :: Package gui :: Module delegates :: Class DispatchDelegate
[hide private]
[frames] | no frames]

Class DispatchDelegate

               object --+                        
                        |                        
        sip.simplewrapper --+                    
                            |                    
                  sip.wrapper --+                
                                |                
             PyQt5.QtCore.QObject --+            
                                    |            
PyQt5.QtWidgets.QAbstractItemDelegate --+        
                                        |        
      PyQt5.QtWidgets.QStyledItemDelegate --+    
                                            |    
         ui.qt.table_speed_up.SpeedUpDelegate --+
                                                |
                                               DispatchDelegate

A delegate that acts as one of the above delegates depending on an index's RowType data. This is needed because Qt doesn't allow us to set delegates per row in a tree view. (Delegates for a row can only be set based on row number, which means that, e.g., the second row of the table and the second row of all groups in the table will get the same delegate.)

Nested Classes [hide private]

Inherited from PyQt5.QtWidgets.QAbstractItemDelegate: EndEditHint

Instance Methods [hide private]
 
__init__(self, parent, cache)
x.__init__(...) initializes x; see help(type(x)) for signature
 
_generateTypeMap(self)
Return a mapping of {annotation type: delegate class} for all delegates in this module
 
sizeHint(self, option, index)
 
heightHint(self, option, index)
Return the sizeHint's height for the specified cell.
 
paint(self, painter, option, index)
 
maxWidthForRowTypes(self, row_types, option, index)
Determine the column width needed for a column containing all of the specified row types

Inherited from ui.qt.table_speed_up.SpeedUpDelegate: initStyleOption, setModel

Inherited from PyQt5.QtWidgets.QStyledItemDelegate: createEditor, displayText, editorEvent, eventFilter, itemEditorFactory, setEditorData, setItemEditorFactory, setModelData, updateEditorGeometry

Inherited from PyQt5.QtWidgets.QAbstractItemDelegate: closeEditor, commitData, destroyEditor, helpEvent, sizeHintChanged

Inherited from PyQt5.QtCore.QObject: __getattr__, blockSignals, childEvent, children, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, findChild, findChildren, inherits, installEventFilter, isSignalConnected, isWidgetType, isWindowType, killTimer, metaObject, moveToThread, objectName, objectNameChanged, parent, property, pyqtConfigure, receivers, removeEventFilter, sender, senderSignalIndex, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent, tr

Inherited from sip.simplewrapper: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
frozenset PAINT_ROLES = frozenset([0, 1, 6, 7, 8, 9, 10, <CustomRole.Row...
A set of all roles used in painting.

Inherited from PyQt5.QtWidgets.QAbstractItemDelegate: EditNextItem, EditPreviousItem, NoHint, RevertModelCache, SubmitModelCache

Inherited from PyQt5.QtCore.QObject: staticMetaObject

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent, cache)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • parent - The parent widget
  • data_cache - The object to use for caching model data. Note that this cache is shared amongst all delegates and that the view, not the delegate, is responsible for clearing the cache when the model data changes.
Overrides: object.__init__
(inherited documentation)

sizeHint(self, option, index)

 
Overrides: PyQt5.QtWidgets.QAbstractItemDelegate.sizeHint

heightHint(self, option, index)

 

Return the sizeHint's height for the specified cell.

See QAbstractItemDelegate.sizeHint documentation for argument documentation.

paint(self, painter, option, index)

 
Overrides: PyQt5.QtWidgets.QAbstractItemDelegate.paint

maxWidthForRowTypes(self, row_types, option, index)

 

Determine the column width needed for a column containing all of the specified row types

Parameters:
  • row_types (iterable) - An iterable of all row types (viewconstants.RowType or viewconstants.AnnotationType)
  • option (QtGui.QStyleOptionViewItem) - A style option item for an index from the view
  • index (QtCore.QModelIndex) - A valid index from the view's model. It does not need to be of any particular row type.

Class Variable Details [hide private]

PAINT_ROLES

A set of all roles used in painting. Subclasses should override this variable if they require data for additional roles.
Type:
frozenset
Value:
frozenset([0,
           1,
           6,
           7,
           8,
           9,
           10,
           <CustomRole.RowType: 257>,
...