def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.__parent = parent
        self.title = "Add Designation"

        self.designation = ValidatingLineEdit("Designation",
                                              "[a-zA-Z0-9-_\s]+", self)
        self.da = ValidatingLineEdit("Dearness Allowance", QDoubleValidator(),
                                     self)
        self.hra = ValidatingLineEdit("House Rent Allowance",
                                      QDoubleValidator(), self)
        self.ta = ValidatingLineEdit("Transport Allowance", QDoubleValidator(),
                                     self)
        self.it = ValidatingLineEdit("Income Tax", QDoubleValidator(), self)
        self.pt = ValidatingLineEdit("Professional Tax", QDoubleValidator(),
                                     self)

        # inputs whos validity needs to checked are put in a list
        # so that we can loop through them to check validity
        self.inputs = [
            self.designation, self.da, self.hra, self.ta, self.it, self.pt
        ]

        self.bttnAddDesignation = QPushButton("Add Designation")
        self.bttnCancel = QPushButton("Cancel")
        self.bttnAddDesignation.setObjectName("OkButton")
        self.bttnCancel.setObjectName("CancelButton")
        self.bttnCancel.clicked.connect(self.goBack)
        self.bttnAddDesignation.clicked.connect(self.add)

        self.setupUI()
Exemplo n.º 2
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.__parent = parent
        self.setWindowTitle("Add Designation")

        self.designation = QLineEdit()
        self.da = QLineEdit()
        self.da.setValidator(QDoubleValidator())
        self.hra = QLineEdit()
        self.hra.setValidator(QDoubleValidator())
        self.ta = QLineEdit()
        self.ta.setValidator(QDoubleValidator())
        self.it = QLineEdit()
        self.it.setValidator(QDoubleValidator())
        self.pt = QLineEdit()
        self.pt.setValidator(QDoubleValidator())

        self.bttnAddDesignation = QPushButton("Add Designation")
        self.bttnCancel = QPushButton("Cancel")
        self.bttnAddDesignation.setObjectName("OkButton")
        self.bttnCancel.setObjectName("CancelButton")
        self.bttnCancel.clicked.connect(self.goBack)
        self.bttnAddDesignation.clicked.connect(self.add)

        self.setupUI()
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.__parent = parent
        self.setWindowTitle("Add Employee")
        self.id = QLineEdit(self)
        self.id.setValidator(QRegExpValidator(QRegExp("[a-zA-Z0-9-_]+")))
        self.name = QLineEdit(self)
        self.name.setValidator(QRegExpValidator(QRegExp("[a-zA-Z\s]+")))
        self.designation = QComboBox(self)

        # self.designation.addItems(DatabaseManager.db.getDesignations())

        self.originalPay = QLineEdit(self)
        self.originalPay.setValidator(QDoubleValidator())
        self.originalPayGrade = QLineEdit(self)
        self.originalPayGrade.setValidator(QDoubleValidator())
        self.DOJ = DatePicker(self)
        self.pan = QLineEdit(self)
        self.pan.setValidator(QRegExpValidator(QRegExp("[A-Z]{5}\d{4}[A-Z]")))

        self.bttnAddEmployee = QPushButton("Add Employee")
        self.bttnCancel = QPushButton("Cancel")
        self.bttnAddEmployee.setObjectName("OkButton")
        self.bttnCancel.setObjectName("CancelButton")
        self.bttnCancel.clicked.connect(self.goBack)
        self.bttnAddEmployee.clicked.connect(self.add)

        self.designation.addItems(DatabaseManager.db.getDesignations())

        self.setupUI()
Exemplo n.º 4
0
 def __init__(self, *args, **kwargs ):
     QWidget.__init__( self, *args, **kwargs )
     
     mainLayout = QHBoxLayout( self )
     mainLayout.setContentsMargins(0,0,0,0)
     label = QLabel( "Aim Direction  : " )
     lineEdit1 = QLineEdit()
     lineEdit2 = QLineEdit()
     lineEdit3 = QLineEdit()
     verticalSeparator = Widget_verticalSeparator()
     checkBox = QCheckBox( "Set Auto" )
     mainLayout.addWidget( label )
     mainLayout.addWidget( lineEdit1 )
     mainLayout.addWidget( lineEdit2 )
     mainLayout.addWidget( lineEdit3 )
     mainLayout.addWidget( verticalSeparator )
     mainLayout.addWidget( checkBox )
     
     validator = QDoubleValidator( -10000.0, 10000.0, 2 )
     lineEdit1.setValidator( validator )
     lineEdit2.setValidator( validator )
     lineEdit3.setValidator( validator )
     lineEdit1.setText( "0.0" )
     lineEdit2.setText( "1.0" )
     lineEdit3.setText( "0.0" )
     checkBox.setChecked( True )
     self.label = label; self.lineEdit1 = lineEdit1; 
     self.lineEdit2 = lineEdit2; self.lineEdit3 = lineEdit3; self.checkBox = checkBox
     self.setVectorEnabled()
     
     
     QtCore.QObject.connect( checkBox, QtCore.SIGNAL( 'clicked()' ), self.setVectorEnabled )
Exemplo n.º 5
0
 def _setupGui(self):
     self._ui.samplesLineEdit.setValidator(QIntValidator())
     self._ui.xtolLineEdit.setValidator(QDoubleValidator())
     self._ui.initTransXLineEdit.setValidator(QDoubleValidator())
     self._ui.initTransYLineEdit.setValidator(QDoubleValidator())
     self._ui.initTransZLineEdit.setValidator(QDoubleValidator())
     self._ui.initRotXLineEdit.setValidator(QDoubleValidator())
     self._ui.initRotYLineEdit.setValidator(QDoubleValidator())
     self._ui.initRotZLineEdit.setValidator(QDoubleValidator())
     self._ui.initScaleLineEdit.setValidator(QDoubleValidator())
Exemplo n.º 6
0
 def __init__(self):
     QWidget.__init__(self)
     self.setGeometry(QRect(100, 100, 400, 200))
     self.layout = QtGui.QGridLayout(self)
     #lblCorporateEventType
     self.lblCorporateEventType = QLabel("Type")
     self.layout.addWidget(self.lblCorporateEventType, 0, 0)
     #cmbCorporateEventType
     self.cmbCorporateEventType = QComboBox(self)
     corporateEventTypeList = DaoCorporateEvent().getCorporateEventTypeList(
     )
     for (corporateEventType) in corporateEventTypeList:
         self.cmbCorporateEventType.addItem(corporateEventType[1],
                                            corporateEventType[0])
     self.layout.addWidget(self.cmbCorporateEventType, 0, 1)
     #lblAssetName
     self.lblAssetName = QLabel("Asset Name")
     self.layout.addWidget(self.lblAssetName, 1, 0)
     #cmdAssetName
     self.cmdAssetName = QComboBox(self)
     assetNameList = DaoAsset().getAssetNames('EQUITY')
     for (assetName) in assetNameList:
         self.cmdAssetName.addItem(assetName[1], assetName[0])
     self.layout.addWidget(self.cmdAssetName, 1, 1)
     #lblCustody
     self.lblCustody = QLabel("Custody")
     self.layout.addWidget(self.lblCustody, 2, 0)
     #cmbCustody
     self.cmbCustody = QComboBox(self)
     custodyList = DaoCustody().getCustodyList()
     for (row) in custodyList:
         self.cmbCustody.addItem(row[1], row[0])
     self.layout.addWidget(self.cmbCustody, 2, 1)
     #lblGrossAmount
     self.lblGrossAmount = QLabel("Gross Amount")
     self.layout.addWidget(self.lblGrossAmount, 3, 0)
     #txtGrossAmount
     self.txtGrossAmount = QLineEdit(self)
     self.txtGrossAmount.setValidator(QDoubleValidator(
         0, 99999999, 6, self))
     self.layout.addWidget(self.txtGrossAmount, 3, 1)
     #lblPaymentDate
     self.lblPaymentDate = QLabel("Payment Date")
     self.layout.addWidget(self.lblPaymentDate, 4, 0)
     #cmbPaymentDate
     self.cmbPaymentDate = QDateEdit(self)
     self.cmbPaymentDate.setDisplayFormat("dd-MM-yyyy")
     self.cmbPaymentDate.setDate(datetime.datetime.now())
     self.layout.addWidget(self.cmbPaymentDate, 4, 1)
     #btnAdd
     self.btnAdd = QPushButton("Add", self)
     self.layout.addWidget(self.btnAdd)
     #btnClear
     self.btnClear = QPushButton("Clear", self)
     self.layout.addWidget(self.btnClear)
     #clearEditor
     self.clearEditor()
     self.initListener()
 def initLineEdits(self, lineEdits, layout, row, colOffset):
     colIndex = 0
     for lineEdit in lineEdits:
         lineEdit.setValidator(QDoubleValidator())
         lineEdit.setText("0.0")
         lineEdit.setAlignment(Qt.AlignRight)
         lineEdit.textEdited.connect(self.updateTransformFromText)
         layout.addWidget(lineEdit, row, colOffset + colIndex)
         colIndex += 1
Exemplo n.º 8
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.__parent = parent
        self.title = "Edit Employee"

        # ------elements for selecting employee-----------
        self.nameSearch = SearchBox(self)
        self.nameSearch.setPlaceholderText("Enter Name")

        self.nameList = []
        self.nameList = Database.getdb().getEmployeeNameList()
        self.nameSearch.setList(self.nameList)
        self.nameSearch.setCurrentIndex(-1)

        self.id = QComboBox()
        self.id.currentIndexChanged.connect(
            lambda: self.loadInfo(self.id.currentText()))
        self.nameSearch.returnPressed.connect(self.setIDList)

        # ------elements for ediiting employee-----------
        self.nameEdit = ValidatingLineEdit("Name", "[a-zA-Z\s]+", self)
        self.designation = QComboBox(self)
        self.originalPay = ValidatingLineEdit("Original Pay",
                                              QDoubleValidator(), self)
        self.originalPayGrade = ValidatingLineEdit("Original Pay Grade",
                                                   QDoubleValidator(), self)
        self.DOJ = DatePicker(self)
        self.pan = ValidatingLineEdit("PAN", "[A-Z]{5}\d{4}[A-Z]", self)
        self.inputs = [
            self.nameEdit, self.originalPay, self.originalPayGrade, self.pan
        ]

        self.bttnSave = QPushButton("Save Changes")
        self.bttnCancel = QPushButton("Back")
        self.bttnSave.setObjectName("OkButton")
        self.bttnCancel.setObjectName("CancelButton")
        self.bttnCancel.clicked.connect(self.goBack)
        self.bttnSave.clicked.connect(self.save)

        self.designation.addItems(Database.getdb().getDesignations())
        self.nameSearch.editTextChanged.connect(self.clearInfo)
        self.clearInfo()

        self.setupUI()
Exemplo n.º 9
0
 def _createValidator(self):
     validator = QDoubleValidator(self.parent)
     if "min" in self.config:
         validator.setBottom(int(self.config["min"]))
     if "max" in self.config:
         validator.setTop(int(self.config["max"]))
     if "decimals" in self.config:
         validator.setDecimals(int(self.config["decimals"]))
     return validator
Exemplo n.º 10
0
    def _createWidgets(self):
        '''Create the widgets contained in this box'''

        # Rate or lifetime chooser
        self.rate = QRadioButton('Rate', self)
        self.rate.setToolTip(ttt('Choose this to express exchange as rate'))
        self.lifetime = QRadioButton('Lifetime', self)
        self.lifetime.setToolTip(ttt('Choose this to express exchange as '
                                     'lifetime'))

        # Box containing value
        self.rate_value = QLineEdit(self)
        validate = QDoubleValidator(self.rate_value)
        validate.setDecimals(3)
        validate.setBottom(0.0)
        self.rate_value.setValidator(validate)
        self.rate_value.setToolTip(ttt('The rate or lifetime value'))

        # Unit
        self.unit = QComboBox(self)
        self.unit.setToolTip(ttt('Selects the input unit for the rate '
                                 'or lifetime'))
Exemplo n.º 11
0
 def __init__(self, parent=None):
     QMainWindow.__init__(self, parent)
     self.setWindowTitle('Validation example')
     central = QWidget(self)
     central.setLayout(QVBoxLayout(central))
     self.edit = QLineEdit(central)
     central.layout().addWidget(self.edit)
     # create a validator
     edit_validator = QDoubleValidator(self.edit)
     # and add it to the edito widget
     self.edit.setValidator(edit_validator)
     self.setCentralWidget(central)
     self.edit.returnPressed.connect(self.do_it)
Exemplo n.º 12
0
 def add_new_rows(self):
     """
     :return:adds a new row to the table
     """
     table = self.dialogue.menudialogue_menuIngredients_table
     rowcount = table.rowCount() + 1
     table.setRowCount(rowcount)
     edit = QLineEdit()
     edit.editingFinished.connect(lambda: self.get_details_of_code(rowcount))
     table.setCellWidget(rowcount - 1, 0, edit)
     combo = QComboBox()
     self.fillitem(combo)
     combo.currentIndexChanged.connect(lambda: self.get_details_of_item(rowcount))
     table.setCellWidget(rowcount - 1, 1, combo)
     category = QTableWidgetItem()
     table.setItem(rowcount - 1, 2, category)
     units = QComboBox()
     self.fillunits(units)
     table.setCellWidget(rowcount - 1, 3, units)
     quantity = QLineEdit()
     quantity.setValidator(QDoubleValidator(0.000, 999.999, 3))
     table.setCellWidget(rowcount - 1, 4, quantity)
Exemplo n.º 13
0
 def __init__(self, parent=None, args=None):
     logger.info('Inside MenuAddDialogue')
     QDialog.__init__(self)
     self.parent = parent
     self.dialogue = Ui_add_menu_dialogue()
     self.dialogue.setupUi(self)
     self.setFocusPolicy(Qt.StrongFocus)
     self.focusInEvent = self.got_focus
     self.search = CategoryOfProduct()
     self.dialogue.menudialogu_delete_button.clicked.connect(self.delete_menu_item)
     self.dialogue.menudialogue_menuIngredients_table_addrow_button.clicked.connect(self.add_new_rows)
     self.dialogue.menudialogue_menuIngredients_table_save_button.clicked.connect(self.save_ingredients)
     self.dialogue.menudialogue_menuIngredients_table.setEditTriggers(QAbstractItemView.NoEditTriggers)
     self.dialogue.menudialogue_menuIngredients_table.itemDoubleClicked.connect(self.popup_edit)
     self.dialogue.menudialogue_add_button.clicked.connect(self.add_menu)
     self.setWindowFlags(Qt.WindowCloseButtonHint)
     self.editable = False
     self.menuproduct = MenuProduct()
     self.dish = MenuProduct()
     self.complete_category()
     self.dialogue.menudialogue_rate_lineedit.setValidator(QDoubleValidator(1.000, 999.000, 3))
     self.dialogue.menudialogue_codenumber_linedit.setValidator(QIntValidator(0, 999))
     self.dialogue.menudialogue_newcategory_button.clicked.connect(self.create_category)
     self.dialogue.menudialogue_itemname_linedit.textChanged.connect(
         lambda: self.auto_capital(self.dialogue.menudialogue_itemname_linedit))
     self.id = None
     self.dialogue.menudialogue_serve_lineedit.setValidator(QIntValidator(0, 999))
     if not args:
         self.dialogue.menudialogu_delete_button.setDisabled(True)
         self.dialogue.menudialogu_delete_button.setToolTip("Cannot Delete Uncreated Dish")
         self.dialogue.menudialogue_codenumber_linedit.setPlaceholderText('Not Assigned')
         self.dialogue.menudialogue_menuIngredients_table_addrow_button.setToolTip(
             "Cannot Add ingredients of unsaved Menu")
         self.dialogue.menudialogue_serve_lineedit.setPlaceholderText('No of Servings')
         self.dialogue.menudialogue_menuIngredients_table_addrow_button.setDisabled(True)
         self.dialogue.menudialogue_menuIngredients_table_save_button.setDisabled(True)
     else:
         self.edit_mode(args.text())
Exemplo n.º 14
0
 def _add_field(self, param, value):
     """Add a field to the task panel."""
     name = param.name
     if param.type == "float":
         widget = QLineEdit()
         widget.setAlignment(Qt.AlignRight)
         widget.setValidator(QDoubleValidator())
         try:
             value = QLocale().toString(float(value))
         except (ValueError, TypeError):
             value = None
         widget.setText(value)
         self.fields.append(
             (name, lambda: QLocale().toDouble(widget.text())[0]))
     elif param.type == "RGB":
         if value:
             parsedvalue = parse_csv_str(value)
             if "Object" not in parsedvalue:
                 color = str2rgb(parsedvalue[0])
                 use_object_color = False
             else:
                 use_object_color = True
                 if len(parsedvalue) > 1:
                     color = str2rgb(parsedvalue[1])
                 else:
                     color = (0.8, 0.8, 0.8)
             qcolor = QColor.fromRgbF(*color)
             widget = ColorPickerExt(qcolor, use_object_color)
         else:
             widget = ColorPickerExt()
         self.fields.append((name, widget.get_value))
     else:
         widget = QLineEdit()
         self.fields.append((name, widget.text))
     widget.setToolTip(param.desc)
     layout = self.form.findChild(QLayout, "FieldsLayout")
     layout.addRow(f"{param.name}:", widget)
Exemplo n.º 15
0
    def __init__(self, text, minValue, maxValue, defaultValue):

        QWidget.__init__(self)

        validator = QDoubleValidator(minValue, maxValue, 2, self)
        mainLayout = QHBoxLayout(self)

        checkBox = QCheckBox()
        checkBox.setFixedWidth(115)
        checkBox.setText(text)

        lineEdit = QLineEdit()
        lineEdit.setValidator(validator)
        lineEdit.setText(str(defaultValue))

        slider = QSlider(QtCore.Qt.Horizontal)
        slider.setMinimum(minValue * 100)
        slider.setMaximum(maxValue * 100)
        slider.setValue(defaultValue)

        mainLayout.addWidget(checkBox)
        mainLayout.addWidget(lineEdit)
        mainLayout.addWidget(slider)

        QtCore.QObject.connect(slider, QtCore.SIGNAL('valueChanged(int)'),
                               self.syncWidthLineEdit)
        QtCore.QObject.connect(lineEdit, QtCore.SIGNAL('textChanged(QString)'),
                               self.syncWidthSlider)
        QtCore.QObject.connect(checkBox, QtCore.SIGNAL("clicked()"),
                               self.updateEnabled)

        self.checkBox = checkBox
        self.slider = slider
        self.lineEdit = lineEdit

        self.updateEnabled()
Exemplo n.º 16
0
    def __init__(self, *args, **kwargs):

        QMainWindow.__init__(self, *args, **kwargs)
        self.installEventFilter(self)
        self.setWindowTitle(Window_global.title)

        mainWidget = QWidget()
        self.setCentralWidget(mainWidget)

        vLayout = QVBoxLayout(mainWidget)

        hLayoutListWidget = QHBoxLayout()
        widgetPutList = UI_objectList()
        widgetBaseList = UI_objectList()
        widgetPutList.label.setText('Put Object List')
        widgetBaseList.label.setText('Ground Object List')
        buttonPut = QPushButton('Put Object')
        widgetPutList.listWidget.setObjectName(Window_global.listWidgetPutName)
        widgetBaseList.listWidget.setObjectName(
            Window_global.listWidgetGroundName)

        widgetGroupList = UI_objectList()
        widgetGroupList.label.setText('Duplicate Group List')
        widgetGroupList.listWidget.setObjectName(Window_global.duGroupListName)
        widgetGroupList.listWidget.setSelectionMode(
            QAbstractItemView.SingleSelection)

        hLayoutListWidget.addWidget(widgetPutList)
        hLayoutListWidget.addWidget(widgetBaseList)

        randomGroupBox = QGroupBox('Random')
        vLayoutRandom = QVBoxLayout(randomGroupBox)

        rotateValidator = QDoubleValidator(-1000000, 1000000, 2, self)
        scaleValidator = QDoubleValidator(0.0, 100, 2, self)

        randomOptionR = UI_randomOption2('Rotate', rotateValidator, -45, 45)
        randomOptionS = UI_randomOption2('Scale', scaleValidator, 0.8, 1.2)
        randomOptionRA = UI_randomOption('Rotate All', rotateValidator, -45,
                                         45)
        randomOptionSA = UI_randomOption('Scale All', scaleValidator, 0.8, 1.2)
        randomOptionR.setObjectName(Window_global.randomOptionRotName)
        randomOptionS.setObjectName(Window_global.randomOptionScaleName)
        randomOptionRA.setObjectName(Window_global.randomOptionRotAName)
        randomOptionSA.setObjectName(Window_global.randomOptionScaleAName)

        vLayoutRandom.addWidget(randomOptionR)
        vLayoutRandom.addWidget(randomOptionS)
        vLayoutRandom.addWidget(randomOptionRA)
        vLayoutRandom.addWidget(randomOptionSA)

        offsetGroupBox = QGroupBox('Offset')
        vLayoutOffset = QVBoxLayout(offsetGroupBox)

        componentCheck = QCheckBox("Component check")
        offsetSlider1 = UI_OffsetSlider("Offset By Object", -1, 1, 0)
        offsetSlider2 = UI_OffsetSlider("Offset By Ground", -100, 100, 0)
        componentCheck.setObjectName(Window_global.componentCheckName)
        offsetSlider1.setObjectName(Window_global.offsetByObjectName)
        offsetSlider2.setObjectName(Window_global.offsetByGroundName)

        vLayoutOffset.addWidget(componentCheck)
        vLayoutOffset.addWidget(offsetSlider1)
        vLayoutOffset.addWidget(offsetSlider2)

        orientGroupBox = QGroupBox('Orient Option')
        vLayoutOrient = QVBoxLayout(orientGroupBox)
        orientNormalCheck = QCheckBox("Ground Normal Affects")
        hLayoutCombobox = QHBoxLayout()
        orientTypeText = QLabel('Orient Edit Type : ')
        orientTypeComboBox = QComboBox()
        orientTypeComboBox.addItem('All')
        orientTypeComboBox.addItem('Only Y')
        hLayoutCombobox.addWidget(orientTypeText)
        hLayoutCombobox.addWidget(orientTypeComboBox)
        vLayoutOrient.addWidget(orientNormalCheck)
        vLayoutOrient.addLayout(hLayoutCombobox)
        orientNormalCheck.setObjectName(Window_global.checkNormalOrientName)
        orientTypeComboBox.setObjectName(Window_global.orientEditModeName)

        vLayout.addLayout(hLayoutListWidget)
        vLayout.addWidget(widgetGroupList)
        vLayout.addWidget(randomGroupBox)
        vLayout.addWidget(offsetGroupBox)
        vLayout.addWidget(orientGroupBox)
        vLayout.addWidget(buttonPut)
        Window_global.loadInfo()

        QtCore.QObject.connect(buttonPut, QtCore.SIGNAL('clicked()'),
                               Window_cmd.setTool_putObjectOnGround)
Exemplo n.º 17
0
    def __init__(self, *args, **kwargs):

        self.minimum = 1
        self.maximum = 100
        self.lineEditMaximum = 10000

        QMainWindow.__init__(self, *args, **kwargs)
        self.installEventFilter(self)
        #self.setWindowFlags( QtCore.Qt.Drawer )
        self.setWindowTitle(Window_global.title)

        widgetMain = QWidget()
        layoutVertical = QVBoxLayout(widgetMain)
        self.setCentralWidget(widgetMain)

        layoutSlider = QHBoxLayout()
        lineEdit = QLineEdit()
        lineEdit.setFixedWidth(100)
        lineEdit.setText(str(1))
        validator = QIntValidator(self.minimum, self.lineEditMaximum, self)
        lineEdit.setValidator(validator)
        slider = QSlider()
        slider.setOrientation(QtCore.Qt.Horizontal)
        slider.setMinimum(self.minimum)
        slider.setMaximum(self.maximum)
        layoutSlider.addWidget(lineEdit)
        layoutSlider.addWidget(slider)
        layoutAngle = QVBoxLayout()
        checkBox = QCheckBox('Connect Angle By Tangent')
        layoutVector = QHBoxLayout()
        leVx = QLineEdit()
        leVx.setText(str(1.000))
        leVx.setEnabled(False)
        leVx.setValidator(QDoubleValidator(-100, 100, 5, self))
        leVy = QLineEdit()
        leVy.setText(str(0.000))
        leVy.setEnabled(False)
        leVy.setValidator(QDoubleValidator(-100, 100, 5, self))
        leVz = QLineEdit()
        leVz.setText(str(0.000))
        leVz.setEnabled(False)
        leVz.setValidator(QDoubleValidator(-100, 100, 5, self))
        layoutAngle.addWidget(checkBox)
        layoutAngle.addLayout(layoutVector)
        layoutVector.addWidget(leVx)
        layoutVector.addWidget(leVy)
        layoutVector.addWidget(leVz)
        button = QPushButton('Create')

        layoutVertical.addLayout(layoutSlider)
        layoutVertical.addLayout(layoutAngle)
        layoutVertical.addWidget(button)

        QtCore.QObject.connect(slider, QtCore.SIGNAL('valueChanged(int)'),
                               self.sliderValueChanged)
        QtCore.QObject.connect(lineEdit, QtCore.SIGNAL('textEdited(QString)'),
                               self.lineEditValueChanged)
        QtCore.QObject.connect(button, QtCore.SIGNAL('clicked()'),
                               Functions.createPointOnCurve)
        QtCore.QObject.connect(checkBox, QtCore.SIGNAL('clicked()'),
                               Functions.setAngleEnabled)
        self.slider = slider
        self.lineEdit = lineEdit

        Window_global.slider = slider
        Window_global.button = button
        Window_global.checkBox = checkBox
        Window_global.leVx = leVx
        Window_global.leVy = leVy
        Window_global.leVz = leVz
 def _setupGui(self):
     self._ui.samplesLineEdit.setValidator(QIntValidator())
     self._ui.xtolLineEdit.setValidator(QDoubleValidator())
Exemplo n.º 19
0
 def __init__(self):
     QWidget.__init__(self)
     self.setGeometry(QRect(100, 100, 400, 200))
     self.layout = QtGui.QGridLayout(self)
     #lblAssetType
     self.lblAssetType = QLabel("Asset Type")
     self.layout.addWidget(self.lblAssetType, 0, 0)
     #cmdAssetType
     self.cmdAssetType = QComboBox(self)
     self.cmdAssetType.addItems(DaoAsset().getAssetTypes())
     self.layout.addWidget(self.cmdAssetType, 0, 1)
     #lblAssetName
     self.lblAssetName = QLabel("Asset Name")
     self.layout.addWidget(self.lblAssetName, 1, 0)
     #cmdAssetName
     self.cmdAssetName = QComboBox(self)
     self.layout.addWidget(self.cmdAssetName, 1, 1)
     #lblCustody
     self.lblCustody = QLabel("Custody")
     self.layout.addWidget(self.lblCustody, 2, 0)
     #cmbCustody
     self.cmbCustody = QComboBox(self)
     custodyList = DaoCustody().getCustodyList()
     for (row) in custodyList:
         self.cmbCustody.addItem(row[1], row[0])
     self.layout.addWidget(self.cmbCustody, 2, 1)
     #lblBuySell
     self.lblBuySell = QLabel("Buy Sell")
     self.layout.addWidget(self.lblBuySell, 3, 0)
     #cmdBuySell
     self.cmdBuySell = QComboBox(self)
     self.cmdBuySell.addItem("BUY")
     self.cmdBuySell.addItem("SELL")
     self.layout.addWidget(self.cmdBuySell, 3, 1)
     #lblByAmount
     self.lblByAmount = QLabel("By Amount")
     self.layout.addWidget(self.lblByAmount, 4, 0)
     #chkByAmount
     self.chkByAmount = QCheckBox(self)
     self.layout.addWidget(self.chkByAmount, 4, 1)
     #lblGrossAmount
     self.lblGrossAmount = QLabel("Gross Amount")
     self.layout.addWidget(self.lblGrossAmount, 5, 0)
     #txtGrossAmount
     self.txtGrossAmount = QLineEdit(self)
     self.txtGrossAmount.setValidator(QDoubleValidator(
         0, 99999999, 6, self))
     self.layout.addWidget(self.txtGrossAmount, 5, 1)
     #lblAcquisitionDate
     self.lblAcquisitionDate = QLabel("Acquisition Date")
     self.layout.addWidget(self.lblAcquisitionDate, 6, 0)
     #cmdAcquisitionDate
     self.dateAcquisitionDate = QDateEdit(self)
     self.dateAcquisitionDate.setDisplayFormat("dd-MM-yyyy")
     self.dateAcquisitionDate.setDate(datetime.datetime.now())
     self.layout.addWidget(self.dateAcquisitionDate, 6, 1)
     #lblQuantity
     self.lblQuantity = QLabel("Quantity")
     self.layout.addWidget(self.lblQuantity, 7, 0)
     #txtQuantity
     self.txtQuantity = QLineEdit(self)
     self.txtQuantity.setValidator(QIntValidator(0, 1000000000, self))
     self.layout.addWidget(self.txtQuantity, 7, 1)
     #lblPrice
     self.lblPrice = QLabel("Price")
     self.layout.addWidget(self.lblPrice, 8, 0)
     #txtPrice
     self.txtPrice = QLineEdit(self)
     self.txtPrice.setValidator(QDoubleValidator(0, 99999999, 6, self))
     self.layout.addWidget(self.txtPrice, 8, 1)
     #lblRate
     self.lblRate = QLabel("Rate")
     self.layout.addWidget(self.lblRate, 9, 0)
     #txtRate
     self.txtRate = QLineEdit(self)
     self.txtRate.setValidator(QDoubleValidator(0, 99999999, 4, self))
     self.txtRate.setEnabled(0)
     self.layout.addWidget(self.txtRate, 9, 1)
     #lblNetAmount
     self.lblNetAmount = QLabel("Net Amount")
     self.layout.addWidget(self.lblNetAmount, 10, 0)
     #txtNetAmount
     self.txtNetAmount = QLineEdit(self)
     self.txtNetAmount.setEnabled(0)
     self.txtNetAmount.setValidator(QDoubleValidator(0, 99999999, 6, self))
     self.layout.addWidget(self.txtNetAmount, 10, 1)
     #lblCommissionPercentage
     self.lblCommissionPercentage = QLabel("Commission Percentage")
     self.layout.addWidget(self.lblCommissionPercentage, 11, 0)
     #txtCommissionPercentage
     self.txtCommissionPercentage = QLineEdit(self)
     self.txtCommissionPercentage.setValidator(
         QDoubleValidator(0, 9999999, 6, self))
     self.layout.addWidget(self.txtCommissionPercentage, 11, 1)
     #lblCommissionAmount
     self.lblCommissionAmount = QLabel("Commission Amount")
     self.layout.addWidget(self.lblCommissionAmount, 12, 0)
     #txtCommissionAmmount
     self.txtCommissionAmount = QLineEdit(self)
     self.txtCommissionAmount.setEnabled(0)
     self.txtCommissionAmount.setValidator(
         QDoubleValidator(0, 9999999, 6, self))
     self.layout.addWidget(self.txtCommissionAmount, 12, 1)
     #lblCommissionAmount
     self.lblCommissionVATAmount = QLabel("Commission VAT Amount")
     self.layout.addWidget(self.lblCommissionVATAmount, 13, 0)
     #txtCommissionAmmount
     self.txtCommissionVATAmount = QLineEdit(self)
     self.txtCommissionVATAmount.setEnabled(0)
     self.txtCommissionVATAmount.setValidator(
         QDoubleValidator(0, 9999999, 6, self))
     self.layout.addWidget(self.txtCommissionVATAmount, 13, 1)
     #lblTenor
     self.lblTenor = QLabel("Tenor")
     self.layout.addWidget(self.lblTenor, 14, 0)
     #txtTenor
     self.txtTenor = QLineEdit(self)
     self.txtTenor.setEnabled(0)
     self.txtTenor.setValidator(QDoubleValidator(0, 9999999, 0, self))
     self.layout.addWidget(self.txtTenor, 14, 1)
     #btnAdd
     self.btnAdd = QPushButton("Add", self)
     self.layout.addWidget(self.btnAdd)
     #btnClear
     self.btnClear = QPushButton("Clear", self)
     self.layout.addWidget(self.btnClear)
     #clearEditor
     self.clearEditor()
     self.initListener()