<s> from PyQt4 import QtCore , QtGui <EOL> class IlastikTabWidget ( QtGui . QTabWidget ) : <EOL> def __init__ ( self , parent = None ) : <EOL> QtGui . QTabWidget . __init__ ( self , parent ) <EOL> self . setContentsMargins ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> self . tabDict = { } <EOL> self . currentTabNumber = <NUM_LIT:0> <EOL> if parent : <EOL> self . connect ( parent , QtCore . SIGNAL ( "<STR_LIT>" ) , self . orientationEvent ) <EOL> def orientationEvent ( self , orientation ) : <EOL> if orientation == QtCore . Qt . Horizontal : <EOL> self . setTabPosition ( self . North ) <EOL> if orientation == QtCore . Qt . Vertical : <EOL> self . setTabPosition ( self . West ) <EOL> for tab in self . tabDict . values ( ) : <EOL> lo = tab . layout ( ) <EOL> if orientation == <NUM_LIT:1> : <EOL> orientation = <NUM_LIT:0> <EOL> lo . setDirection ( lo . Direction ( orientation ) ) <EOL> def moveEvent ( self , event ) : <EOL> QtGui . QTabWidget . moveEvent ( self , event ) <EOL> def addTab ( self , page , tabName ) : <EOL> self . tabDict [ tabName ] = page <EOL> QtGui . QTabWidget . addTab ( self , page , tabName ) <EOL> def getTab ( self , tabName ) : <EOL> return self . tabDict [ tabName ] </s>
