#NEWLINE# def __init__( self , parent = None ) : #NEWLINE# #INDENT# ' init(parent: QWidget) -> None        \n        We construct a simple GUI with edit boxes for 2 operands and a\n        combo box for the operator. There are also 2 buttons: (1)\n        perform the calculation and display the result, (2) create a\n        PythonCalc module with the specified parameters and add to the\n        current pipeline.\n\n        ' #NEWLINE# QtGui . QWidget . __init__ ( self , parent ) #NEWLINE# self . setWindowTitle ( 'PythonCalc GUI' ) #NEWLINE# gridLayout = QtGui . QGridLayout ( ) #NEWLINE# self . setLayout ( gridLayout ) #NEWLINE# gridLayout . addWidget ( QtGui . QLabel ( 'value1' ) , 0 , 0 ) #NEWLINE# gridLayout . addWidget ( QtGui . QLabel ( 'value2' ) , 1 , 0 ) #NEWLINE# gridLayout . addWidget ( QtGui . QLabel ( 'op' ) , 2 , 0 ) #NEWLINE# gridLayout . addWidget ( QtGui . QLabel ( 'result' ) , 3 , 0 ) #NEWLINE# numberValidator = QtGui . QIntValidator ( self ) #NEWLINE# self . value1Edit = QtGui . QLineEdit ( '0' ) #NEWLINE# self . value2Edit = QtGui . QLineEdit ( '0' ) #NEWLINE# self . value1Edit . setValidator ( numberValidator ) #NEWLINE# self . value2Edit . setValidator ( numberValidator ) #NEWLINE# gridLayout . addWidget ( self . value1Edit , 0 , 1 ) #NEWLINE# gridLayout . addWidget ( self . value2Edit , 1 , 1 ) #NEWLINE# self . opCombo = QtGui . QComboBox ( ) #NEWLINE# self . opCombo . addItems ( [ '+' , '-' , '*' , '/' ] ) #NEWLINE# gridLayout . addWidget ( self . opCombo , 2 , 1 ) #NEWLINE# self . resultLabel = QtGui . QLabel ( ) #NEWLINE# gridLayout . addWidget ( self . resultLabel , 3 , 1 ) #NEWLINE# self . calculateButton = QtGui . QPushButton ( 'Calculate' ) #NEWLINE# gridLayout . addWidget ( parent . calculateButton , 4 , 0 ) #NEWLINE# self . connect ( self . calculateButton , QtCore . SIGNAL ( 'clicked()' ) , self . calculate ) #NEWLINE# self . createModuleButton = QtGui . QPushButton ( 'Create Module' ) #NEWLINE# gridLayout . addWidget ( self . createModuleButton , 4 , 1 ) #NEWLINE# self . connect ( self . createModuleButton , QtCore . SIGNAL ( 'clicked()' ) , self . createModule )