#NEWLINE# def __init__( self , alias , controller , parent = None ) : #NEWLINE# #INDENT# ' QListEditDialog(pType: str, strValues: list, parent: QWidget)\n                            -> QListEditDialog\n        Parse values and setup the table\n        \n        ' #NEWLINE# QtGui . QDialog . __init__ ( self , parent ) #NEWLINE# self . _alias = alias #NEWLINE# vLayout = QtGui . QVBoxLayout ( ) #NEWLINE# vLayout . setMargin ( 0 ) #NEWLINE# vLayout . setSpacing ( 0 ) #NEWLINE# self . controller = vLayout #NEWLINE# self . setLayout ( vLayout ) #NEWLINE# label = QtGui . QLabel ( "Please enter values in boxes below. 'Add' appends an empty value to the list. And 'Del' removes the selected values." ) #NEWLINE# label . setMargin ( 5 ) #NEWLINE# label . setWordWrap ( True ) #NEWLINE# vLayout . addWidget ( label ) #NEWLINE# self . table = QtGui . QTableWidget ( 0 , 1 , parent ) #NEWLINE# self . table . setHorizontalHeaderLabels ( [ 'Values' ] ) #NEWLINE# self . table . horizontalHeader ( ) . setStretchLastSection ( True ) #NEWLINE# self . table . verticalHeader ( ) . setMovable ( True ) #NEWLINE# self . delegate = QListEditItemDelegate ( alias , controller ) #NEWLINE# self . table . setItemDelegate ( self . delegate ) #NEWLINE# self . table . setSelectionMode ( QtGui . QAbstractItemView . ExtendedSelection ) #NEWLINE# for v in alias . component . valueList : #NEWLINE# #INDENT# self . addRow ( v ) #NEWLINE# #UNINDENT# self . connect ( self . table . verticalHeader ( ) , QtCore . SIGNAL ( 'sectionMoved(int,int,int)' ) , self . rowMoved ) #NEWLINE# vLayout . addWidget ( self . table ) #NEWLINE# hLayout = QtGui . QHBoxLayout ( ) #NEWLINE# vLayout . addLayout ( hLayout ) #NEWLINE# okButton = QtGui . QPushButton ( '&OK' ) #NEWLINE# okButton . setSizePolicy ( QtGui . QSizePolicy . Maximum , QtGui . QSizePolicy . Maximum ) #NEWLINE# self . connect ( okButton , QtCore . SIGNAL ( 'clicked()' ) , self . okButtonPressed ) #NEWLINE# hLayout . addWidget ( okButton ) #NEWLINE# cancelButton = QtGui . QPushButton ( '&Cancel' ) #NEWLINE# cancelButton . setSizePolicy ( QtGui . QSizePolicy . Maximum , QtGui . QSizePolicy . Maximum ) #NEWLINE# self . connect ( cancelButton , QtCore . SIGNAL ( 'clicked()' ) , self . reject ) #NEWLINE# hLayout . addWidget ( cancelButton ) #NEWLINE# addButton = QtGui . QPushButton ( '&Add' ) #NEWLINE# addButton . setIcon ( CurrentTheme . ADD_STRING_ICON ) #NEWLINE# addButton . setSizePolicy ( QtGui . QSizePolicy . Maximum , QtGui . QSizePolicy . Maximum ) #NEWLINE# self . connect ( addButton , QtCore . SIGNAL ( 'clicked()' ) , self . addRow ) #NEWLINE# hLayout . addWidget ( addButton ) #NEWLINE# removeButton = QtGui . QPushButton ( '&Del' ) #NEWLINE# removeButton . setIcon ( QtGui . QIcon ( self . style ( ) . standardPixmap ( QtGui . QStyle . SP_DialogCancelButton ) ) ) #NEWLINE# removeButton . setSizePolicy ( QtGui . QSizePolicy . Maximum , QtGui . QSizePolicy . Maximum ) #NEWLINE# self . connect ( removeButton , QtCore . SIGNAL ( 'clicked()' ) , self . removeSelection ) #NEWLINE# hLayout . addWidget ( removeButton )