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

Class BarHeightDelegate

           object --+                            
                    |                            
    sip.simplewrapper --+                        
                        |                        
              sip.wrapper --+                    
                            |                    
         PyQt4.QtCore.QObject --+                
                                |                
PyQt4.QtGui.QAbstractItemDelegate --+            
                                    |            
      PyQt4.QtGui.QStyledItemDelegate --+        
                                        |        
                          BaseRowDelegate --+    
                                            |    
                  DoubleElementHeightDelegate --+
                                                |
                                               BarHeightDelegate
Known Subclasses:

A BarHeightDelegate is responsible for displaying array-like model data as a series of scaled bars

Nested Classes [hide private]

Inherited from PyQt4.QtGui.QAbstractItemDelegate: EndEditHint

Instance Methods [hide private]
float
getScaledValue(self, index)
Return the value scaled for the height of the bar
tuple of QtCore.QPointF
getBarCoordinates(self, option, index)
Returns the coordinates for the bar to be drawn in the element at the specified index
 
paint(self, painter, option, index)
Paint a bar with the specified painter in the location specified by option that matches the data at the specified index in the model

Inherited from DoubleElementHeightDelegate: __init__, sizeHint

Inherited from BaseRowDelegate: clearCache, helpEvent, initStyleOption

Inherited from BaseRowDelegate (private): _getText, _getValue, _paintSelection

Inherited from PyQt4.QtGui.QStyledItemDelegate: createEditor, displayText, editorEvent, eventFilter, itemEditorFactory, setEditorData, setItemEditorFactory, setModelData, updateEditorGeometry

Inherited from PyQt4.QtGui.QAbstractItemDelegate: closeEditor, commitData, elidedText, sizeHintChanged

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

Inherited from sip.simplewrapper: __new__

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

Class Variables [hide private]

Inherited from BaseRowDelegate: ANNOTATION_TYPE

Inherited from PyQt4.QtGui.QAbstractItemDelegate: EditNextItem, EditPreviousItem, NoHint, RevertModelCache, SubmitModelCache

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Properties [hide private]

Inherited from DoubleElementHeightDelegate: element_height

Inherited from object: __class__

Method Details [hide private]

getScaledValue(self, index)

 

Return the value scaled for the height of the bar

The value will be 0 if the data is None or if the range is None or 0.

Parameters:
  • index (QtCore.QModelIndex) - The index in the model
Returns: float
The value scaled appropriately to the full height of the bar

getBarCoordinates(self, option, index)

 

Returns the coordinates for the bar to be drawn in the element at the specified index

Parameters:
  • option (QtGui.QStyleOptionViewItemV4) - The option to modify with cached information
  • index (QtCore.QModelIndex) - The index in the model
Returns: tuple of QtCore.QPointF
The top left and bottom right coordinates of the bar

paint(self, painter, option, index)

 

Paint a bar with the specified painter in the location specified by option that matches the data at the specified index in the model

If the data at the index cannot be converted to a bar, the parent's paint method is called

Parameters:
  • option (QtGui.QStyleOptionViewItemV4) - The option to modify with cached information
  • index (QtCore.QModelIndex) - The index in the model
Overrides: PyQt4.QtGui.QAbstractItemDelegate.paint