Package schrodinger :: Package application :: Package matsci :: Module builderwidgets :: Class StructureLabel
[hide private]
[frames] | no frames]

Class StructureLabel

PyQt4.QtGui.QLabel --+    
                     |    
 ui.qt.swidgets.SLabel --+
                         |
                        StructureLabel

A label that gives information about the ligand for a given row and shows the set structure in a tooltip.

Instance Methods [hide private]
 
__init__(self, master, layout, unset_tooltip, unset_text="Not set", prefix="", suffix="")
Create a StructureLabel instance
 
unset(self)
Change the text & tooltip to indicate there is no ligand set
 
set(self, struct, prefix=None, suffix=None)
Change the text & tooltip to indicate there is a ligand set
bool
event(self, event)
Override event to make the structure tooltip work
 
leaveEvent(self, event)
Removes the structure tooltip if necessary when the mouse leaves the widget.

Inherited from ui.qt.swidgets.SLabel: reset

Method Details [hide private]

__init__(self, master, layout, unset_tooltip, unset_text="Not set", prefix="", suffix="")
(Constructor)

 

Create a StructureLabel instance

Parameters:
  • master (ItemRow) - The ItemRow object this label is for
  • layout (QBoxLayout) - The layout this label should add itself to
  • unset_tooltip (str) - The tooltip to display if no structure has been set.
  • unset_text (str) - The text to display in the label if no structure has been set
  • prefix (str) - The text to put before the molecular formula
  • suffix (str) - The text to put after the molecular formula
Overrides: ui.qt.swidgets.SLabel.__init__

set(self, struct, prefix=None, suffix=None)

 

Change the text & tooltip to indicate there is a ligand set

Parameters:
  • struct (schrodinger.structure.Structure) - The structure that is set for this row
  • prefix (str) - A string to add before the molecular formala - if not given, the default prefix set in the __init__ method is used.
  • suffix (str) - A string to add after the molecular formala - if not given, the default suffix set in the __init__ method is used.

event(self, event)

 

Override event to make the structure tooltip work

Parameters:
  • event (QEvent) - The QEvent object generated by this event
Returns: bool
Whether the event was recognized

leaveEvent(self, event)

 

Removes the structure tooltip if necessary when the mouse leaves the widget.

Parameters:
  • event (QEvent) - The QEvent object generated by this event