<s> import Gaffer <EOL> import GafferUI <EOL> QtGui = GafferUI . _qtImport ( "<STR_LIT>" ) <EOL> QtCore = GafferUI . _qtImport ( "<STR_LIT>" ) <EOL> class Label ( GafferUI . Widget ) : <EOL> HorizontalAlignment = GafferUI . HorizontalAlignment <EOL> VerticalAlignment = GafferUI . VerticalAlignment <EOL> def __init__ ( self , text = "<STR_LIT>" , horizontalAlignment = HorizontalAlignment . Left , verticalAlignment = VerticalAlignment . Center , parenting = None ) : <EOL> GafferUI . Widget . __init__ ( self , QtGui . QLabel ( text ) , parenting = parenting ) <EOL> self . _qtWidget ( ) . setSizePolicy ( QtGui . QSizePolicy ( QtGui . QSizePolicy . Fixed , QtGui . QSizePolicy . Fixed ) ) <EOL> self . setAlignment ( horizontalAlignment , verticalAlignment ) <EOL> def setText ( self , text ) : <EOL> self . _qtWidget ( ) . setText ( text ) <EOL> def getText ( self ) : <EOL> return str ( self . _qtWidget ( ) . text ( ) ) <EOL> def setAlignment ( self , horizontalAlignment , verticalAlignment ) : <EOL> self . _qtWidget ( ) . setAlignment ( <EOL> GafferUI . HorizontalAlignment . _toQt ( horizontalAlignment ) | <EOL> GafferUI . VerticalAlignment . _toQt ( verticalAlignment ) <EOL> ) <EOL> def getAlignment ( self ) : <EOL> a = self . _qtWidget ( ) . alignment ( ) <EOL> return ( <EOL> GafferUI . HorizontalAlignment . _fromQt ( a ) , <EOL> GafferUI . VerticalAlignment . _fromQt ( a ) , <EOL> ) <EOL> def setTextSelectable ( self , selectable ) : <EOL> flags = self . _qtWidget ( ) . textInteractionFlags ( ) <EOL> flags &= ~ QtCore . Qt . TextSelectableByMouse <EOL> if selectable : <EOL> flags |= QtCore . Qt . TextSelectableByMouse <EOL> self . _qtWidget ( ) . setTextInteractionFlags ( flags ) <EOL> def getTextSelectable ( self ) : <EOL> return bool ( self . _qtWidget ( ) . textInteractionFlags ( ) & QtCore . Qt . TextSelectableByMouse ) <EOL> def linkActivatedSignal ( self ) : <EOL> try : <EOL> return self . __linkActivatedSignal <EOL> except : <EOL> self . __linkActivatedSignal = GafferUI . WidgetEventSignal ( ) <EOL> self . _qtWidget ( ) . linkActivated . connect ( Gaffer . WeakMethod ( self . __linkActivated ) ) <EOL> return self . __linkActivatedSignal <EOL> def __linkActivated ( self , link ) : <EOL> self . __linkActivatedSignal ( self , str ( link ) ) </s>
