Example #1
0
    def initUI(self):
        self.layoutFile = FileBrowseWidget(
            "Layout settings file .yaml (*.yaml)")
        self.layoutFile.setText(DEFAULT_LAYOUT_FILE)
        self.rfSettingsFile = FileBrowseWidget(
            "Device settings file .yaml (*.yaml)")
        self.rfSettingsFile.setText(DEFAULT_RF_FILE)
        layout = QFormLayout()
        layout.addRow(QLabel("Layout settings file (.yaml):"), self.layoutFile)
        layout.addRow(QLabel("RF settings file (.yaml):"), self.rfSettingsFile)
        self.idLine = QLineEdit()
        self.idLine.setText(str(DEFAULT_DEVICE_ID))
        self.idLine.setMaximumWidth(50)
        self.idLine.setValidator(QIntValidator(0, 63))
        layout.addRow(QLabel("Device id (0-63):"), self.idLine)

        self.generateButton = QPushButton("Generate new RF settings")
        self.generateButton.setMaximumWidth(230)
        self.generateButton.clicked.connect(self.generateRFSettings)
        layout.addRow(None, self.generateButton)

        label = QLabel(
            "<b>Note:</b> These settings only need to be loaded on each "
            "device once and are persistent when you update the layout. "
            "To ensure proper operation and security, each device must "
            "have a unique device ID for a given RF settings file. "
            "Since RF settings file contains your encryption key, make "
            "sure to keep it secret.")
        label.setTextInteractionFlags(Qt.TextSelectableByMouse)
        label.setWordWrap(True)
        layout.addRow(label)
        self.setLayout(layout)
    def __init__(self,parent=None):
        super(QtReducePreferencesComputation,self).__init__(parent)

        reduceGroup = QGroupBox("Reduce")

        self.reduceBinary = QLineEdit()

        # font = self.reduceBinary.font()
        # font.setFamily(QSettings().value("worksheet/fontfamily",
        #                                QtReduceDefaults.FONTFAMILY))
        # self.reduceBinary.setFont(font)

        self.reduceBinary.setText(QSettings().value("computation/reduce",
                                                    QtReduceDefaults.REDUCE))

        self.reduceBinary.editingFinished.connect(self.editingFinishedHandler)

        reduceLayout = QFormLayout()
        reduceLayout.addRow(self.tr("Reduce Binary"),self.reduceBinary)

        reduceGroup.setLayout(reduceLayout)

        mainLayout = QVBoxLayout()
        mainLayout.addWidget(reduceGroup)

        self.setLayout(mainLayout)
Example #3
0
class FormWidget(QWidget):
    def __init__(self, parent=None, submit_callback=None, inputs=None):
        super(FormWidget, self).__init__(parent)

        if inputs is None:
            inputs = {}

        self.submit_callback = submit_callback

        self.form = QFormLayout()

        self.inputs = {}
        for key in inputs:
            self.inputs[key] = QLineEdit()
            self.form.addRow(QLabel(key), self.inputs[key])

        self.submitButton = QPushButton("Submit")
        self.submitButton.clicked.connect(self.button_pushed)

        self.form.addRow(self.submitButton)

        self.setLayout(self.form)

    def button_pushed(self, checked):
        if self.submit_callback:
            values = {key: self.inputs[key].text()
                      for key in self.inputs}
            self.submit_callback(values)
Example #4
0
    def __init__(self, parent=None):
        super(TransferTaskDialog, self).__init__(parent)

        layout = QFormLayout(self)

        self.to_queue_selector = QComboBox()
        self.from_queue_selector = QComboBox()

        queue_list = cqmanage.cqQueueList()
        for queue in queue_list:
            self.to_queue_selector.addItem(str(queue))
            self.from_queue_selector.addItem(str(queue))

        self.number_to_transfer = QLineEdit("")

        layout.addRow("To Queue:", self.to_queue_selector)
        layout.addRow("From Queue:", self.from_queue_selector)
        layout.addRow("Amount:", self.number_to_transfer)

        # OK and Cancel buttons
        self.buttons = QDialogButtonBox(
            QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self)
        layout.addWidget(self.buttons)

        self.buttons.accepted.connect(self.accept)
        self.buttons.rejected.connect(self.reject)

        self.setWindowTitle("Transfer Tasks")
        self.resize(225, 150)
Example #5
0
 def _createFormLayout(self):
     
     layout = QFormLayout()
     layout.setFieldGrowthPolicy(QFormLayout.AllNonFixedFieldsGrow)
     
     obsFormat = self._docFormat.getObservationFormat(self._obs.__class__.__name__)
     fields = dict((f.name, f) for f in self._obs.FIELDS)
     self._editors = {}
     
     for fieldName in obsFormat.fieldOrder:
         
         field = fields[fieldName]
         
         label = self._getFieldLabel(field)
         
         fieldFormat = obsFormat.getFieldFormat(fieldName)
         value = getattr(self._obs, fieldName)
         text = fieldFormat.format(value, editing=True)
         
         editor = _FieldValueEditor(self, fieldFormat)
         editor.setText(text)
         editor.setToolTip(self._getFieldToolTip(field, fieldFormat))
         
         layout.addRow(label, editor)
         
         self._editors[fieldName] = editor
         
     return layout
Example #6
0
 def setUpUI(self):
     layout = QVBoxLayout()
     form = QFormLayout()
     form.addRow(QLabel("text file"), self.files1)
     form.addRow(QLabel(".csv file"), self.files2)
     layout.addLayout(form)
     self.setLayout(layout)
Example #7
0
 def layoutWidgets(self):
     layout = QFormLayout()
     layout.addRow(self.termLabelLabel, self.termLabel)
     layout.addRow("Pages", self.originalPagesLabel)
     layout.addRow("Pages if Combined", self.combinedPagesLabel)
     layout.addRow(self.buttonBox)
     self.setLayout(layout)
Example #8
0
 def SetLayout(self):
     formLayout = QFormLayout(self)
     labelUsername = QLabel("Username")
     txtUsername = QLineEdit()
     labelPassword = QLabel("Password")
     txtPassword = QLineEdit()
     formLayout.addRow(labelUsername, txtUsername)
     formLayout.addRow(labelPassword, txtPassword)
     self.setLayout(formLayout)
 def SetFLayout(self):
     formLayout = QFormLayout(self)
     labelUsername = QLabel("Username")
     txtUsername = QLineEdit()
     labelPassword = QLabel("Password")
     txtPassword = QLineEdit()
     formLayout.addRow(labelUsername, txtUsername)
     formLayout.addRow(labelPassword, txtPassword)
     self.setLayout(formLayout)
Example #10
0
    def __init__(self, athlete):
        '''
        Constructor
        '''
        QDialog.__init__(self)

        self.setWindowTitle("Pushup form")
        self.athlete = athlete
        self.pushupForm = QFormLayout()
        self.createGUI()
Example #11
0
    def __init__(self, parameter, parent=None):
        _ParameterWidget.__init__(self, parameter, parent)

        # Widgets
        self._lbl_u = QLabel('u')
        self._lbl_u.setStyleSheet("color: blue")
        self._txt_u = MultiNumericalLineEdit()

        self._lbl_v = QLabel('v')
        self._lbl_v.setStyleSheet("color: blue")
        self._txt_v = MultiNumericalLineEdit()

        self._lbl_w = QLabel('w')
        self._lbl_w.setStyleSheet("color: blue")
        self._txt_w = MultiNumericalLineEdit()

        # Layouts
        layout = QFormLayout()
        layout.setContentsMargins(0, 0, 0, 0)
        if sys.platform == 'darwin': # Fix for Mac OS
            layout.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
        layout.addRow(self._lbl_u, self._txt_u)
        layout.addRow(self._lbl_v, self._txt_v)
        layout.addRow(self._lbl_w, self._txt_w)
        self.setLayout(layout)

        # Signals
        self.valuesChanged.connect(self._onChanged)
        self.validationRequested.connect(self._onChanged)

        self._txt_u.textChanged.connect(self.valuesChanged)
        self._txt_v.textChanged.connect(self.valuesChanged)
        self._txt_w.textChanged.connect(self.valuesChanged)

        self.validationRequested.emit()
Example #12
0
    def __init__(self, wdg_detector, key='', parent=None):
        QDialog.__init__(self, parent)
        self.setWindowTitle(wdg_detector.accessibleName())

        # Widgets
        self._txt_key = QLineEdit()
        self._txt_key.setValidator(QRegExpValidator(QRegExp(r"^(?!\s*$).+")))
        self._txt_key.setText(key)

        self._wdg_detector = wdg_detector

        buttons = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)

        # Layouts
        layout = QFormLayout()
        layout.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow) # Fix for Mac OS
        layout.addRow('Key', self._txt_key)
        layout.addRow(self._wdg_detector)
        layout.addRow(buttons)
        self.setLayout(layout)

        # Signals
        self._txt_key.textChanged.connect(self._onChanged)
        self._txt_key.textChanged.emit('')

        buttons.accepted.connect(self._onOk)
        buttons.rejected.connect(self.reject)
Example #13
0
 def setLayoutForm(self):
     """Présentation du QFormLayout"""
     self.setWindowTitle("Form Layout")
     formLayout = QFormLayout(self)
     labelUser = QLabel("Username")
     txtUser = QLineEdit()
     labelPass = QLabel("Password")
     txtPass = QLineEdit()
     formLayout.addRow(labelUser, txtUser)
     formLayout.addRow(labelPass, txtPass)
     self.setLayout(formLayout)
 def setLayoutForm(self):
     """Présentation du QFormLayout"""
     self.setWindowTitle("Form Layout")
     formLayout = QFormLayout(self)
     labelUser = QLabel("Username")
     txtUser = QLineEdit()
     labelPass = QLabel("Password")
     txtPass = QLineEdit()
     formLayout.addRow(labelUser, txtUser)
     formLayout.addRow(labelPass, txtPass)
     self.setLayout(formLayout)
 def SetLayout(self):
     
     formLayout = QFormLayout(self)
     lUsername = QLabel("Username")
     txtUsername = QLineEdit()
     lPasswd = QLabel("Passwd")
     txPasswd = QLineEdit()
     formLayout.addRow(lUsername, txtUsername)
     formLayout.addRow(lPasswd, txPasswd)
     
     self.setLayout(formLayout)
Example #16
0
    def __init__(self, parent):
        super(TimeEditDialog, self).__init__(parent)

        self.in_validation = False
        self.last_validated_identifier = None

        self.identifier_editor = OrderPartIdentifierEdit("identifier",
                                                         _("identifier"),
                                                         parent=self)
        self.identifier_editor.widget.editingFinished.connect(
            self.identifier_set)

        # self.identifier_widget = QLineEdit(self)
        # self.identifier_widget_validator = OrderPartIdentifierValidator()
        # self.identifier_widget.setValidator(self.identifier_widget_validator)
        # self.identifier_widget.editingFinished.connect(self.identifier_set)

        self.task_widget = AutoCompleteComboBox(None, self)
        self.task_widget.section_width = [300]
        self.task_widget.currentIndexChanged.connect(self.operation_set)

        self.tar_type_editor = TaskActionReportTypeComboBox(
            "tar_type", _("Action"))
        self.tar_type_editor.set_model(
            [TaskActionReportType.start_task, TaskActionReportType.stop_task])

        self.machine_editor = ConstrainedMachineEdit("machine_id",
                                                     _("Machine"))
        # self.machine_editor = AutoCompleteComboBox(None,self)
        # self.machine_editor.set_model(machine_service.find_machines_for_operation_definition(proxy.operation_definition_id))

        self.start_time_editor = TimeStampEdit("start_time",
                                               _("Start time"),
                                               nullable=False)

        form_layout = QFormLayout()
        form_layout.addRow(_("Identifier"), self.identifier_editor.widget)
        form_layout.addRow(_("Task"), self.task_widget)
        form_layout.addRow(_("Machine"), self.machine_editor.widget)
        form_layout.addRow(_("Action"), self.tar_type_editor.widget)
        form_layout.addRow(_("Start time"), self.start_time_editor.widget)
        top_layout = QVBoxLayout()
        top_layout.addLayout(form_layout)

        self.buttons = QDialogButtonBox()
        self.buttons.addButton(QDialogButtonBox.Ok)
        self.buttons.addButton(QDialogButtonBox.Cancel)

        top_layout.addWidget(self.buttons)
        self.buttons.accepted.connect(self.accept)
        self.buttons.rejected.connect(self.cancel)

        self.setLayout(top_layout)
Example #17
0
    def __init__(self, parent=None):
        super(FormContainer, self).__init__(parent)

        # Show controls stacked vertically
        self._main_layout = QFormLayout()
        self._main_layout.setFieldGrowthPolicy(QFormLayout.ExpandingFieldsGrow)

        # Controls
        self.controls, self._groups = self._create_field_controls()

        self.setLayout(self._main_layout)

        self.setStyleSheet(self.STYLESHEET)
Example #18
0
    def testGetItemPosition(self):
        formlayout = QFormLayout()
        row, role = formlayout.getItemPosition(0)
        self.assert_(isinstance(row, int))
        self.assert_(isinstance(role, QFormLayout.ItemRole))
        self.assertEqual(row, -1)

        widget = QWidget()
        formlayout.addRow(widget)
        row, role = formlayout.getItemPosition(0)
        self.assert_(isinstance(row, int))
        self.assert_(isinstance(role, QFormLayout.ItemRole))
        self.assertEqual(row, 0)
        self.assertEqual(role, QFormLayout.SpanningRole)
 def __init__(self, url="", parent=None):
     super(WSDLDialog, self).__init__()
     self.setWindowTitle("Select Web Service")
     layout = QVBoxLayout(self)
     
     form = QWidget(self)
     form_layout = QFormLayout(form)
     self.wsdl_field = QLineEdit()
     self.wsdl_field.setText(url)
     form_layout.addRow("WSDL Address:", self.wsdl_field)
     
     layout.addWidget(form)
     
     self.auth = QGroupBox("Use HTTP Basic Authentication")
     self.auth.setCheckable(True)
     self.auth.setChecked(False)
     
     auth_layout = QFormLayout(self.auth)
     
     self.user_field = QLineEdit()
     auth_layout.addRow("Username:"******"Pass:", self.pass_field)
     
     layout.addWidget(self.auth)
     
     button_box = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
     button_box.accepted.connect(self.accept)
     button_box.rejected.connect(self.reject)
     
     layout.addWidget(button_box)
Example #20
0
     def __init__(self, parent=None):
         
         super(Form, self).__init__(parent)       
         #self.setWindowIcon(self.style().standardIcon(QStyle.SP_DirIcon))
         #QtGui.QIcon(QtGui.QMessageBox.Critical))
         self.txt =  QLabel()
         self.txt.setText("This will remove ALL Suffix from selection objects.  .\nDo you want to continue?\n\n\'suffix\'")
         self.le = QLineEdit()
         self.le.setObjectName("suffix_filter")
         self.le.setText(".step")
 
         self.pb = QPushButton()
         self.pb.setObjectName("OK")
         self.pb.setText("OK") 
 
         self.pbC = QPushButton()
         self.pbC.setObjectName("Cancel")
         self.pbC.setText("Cancel") 
 
         layout = QFormLayout()
         layout.addWidget(self.txt)
         layout.addWidget(self.le)
         layout.addWidget(self.pb)
         layout.addWidget(self.pbC)
 
         self.setLayout(layout)
         self.connect(self.pb, SIGNAL("clicked()"),self.OK_click)
         self.connect(self.pbC, SIGNAL("clicked()"),self.Cancel_click)
         self.setWindowTitle("Warning ...")
Example #21
0
    def __init__(self):
        super(DirectoryDialog, self).__init__()

        self.setWindowTitle("Query")
        rect = QApplication.desktop().screenGeometry()
        height = rect.height()
        width = rect.width()
        self.setGeometry(width / 3, height / 3, width / 3, height / 8)

        formLayout = QFormLayout()

        self.dir = QLineEdit()
        self.dir.setReadOnly(True)
        formLayout.addRow(QLabel("Select a folder"), self.dir)
        browseBtn = QPushButton("Browse")
        browseBtn.clicked.connect(self.browseAction)

        formLayout.addWidget(browseBtn)

        btnOk = QPushButton("Ok")
        btnOk.clicked.connect(self.okAction)

        btnCancel = QPushButton("Cancel")
        btnCancel.clicked.connect(self.reject)

        group = QDialogButtonBox()
        group.addButton(btnOk, QDialogButtonBox.AcceptRole)
        group.addButton(btnCancel, QDialogButtonBox.RejectRole)
        formLayout.addRow(group)

        self.setLayout(formLayout)
        self.setWindowIcon(QIcon("res/SplashScreen.png"))
        self.__result = None
    def __init__(self,parent=None):
        super(QtReducePreferencesWorksheet,self).__init__(parent)

        fontGroup = QGroupBox(self.tr("Fonts"))

        self.fontCombo = QtReduceFontComboBox(self)
        self.setFocusPolicy(Qt.NoFocus)
        self.fontCombo.setEditable(False)
        self.fontCombo.setCurrentFont(self.parent().parent().controller.view.font())

        self.sizeCombo = QtReduceFontSizeComboBox()
        self.sizeComboFs = QtReduceFontSizeComboBoxFs()
        self.findSizes(self.fontCombo.currentFont())
        self.fontCombo.currentFontChanged.connect(self.findSizes)

        fontLayout = QFormLayout()
        fontLayout.addRow(self.tr("General Worksheet Font"),self.fontCombo)
        fontLayout.addRow(self.tr("Font Size"),self.sizeCombo)
        fontLayout.addRow(self.tr("Full Screen Font Size"),self.sizeComboFs)

        fontGroup.setLayout(fontLayout)

        mainLayout = QVBoxLayout()
        mainLayout.addWidget(fontGroup)

        self.setLayout(mainLayout)
Example #23
0
    def __init__(self, fileInfo, gallery, parent=None, flags=Qt.Widget):
        QWidget.__init__(self, parent, flags)

        self.setLayout(QFormLayout(parent=self))
        self.request = QGalleryQueryRequest(gallery, self)
        self.request.setFilter(
            QDocumentGallery.filePath.equals(fileInfo.absoluteFilePath()))
        self.resultSet = None

        self.propertyKeys = []
        self.widgets = []

        propertyNames = [
            QDocumentGallery.fileName,
            QDocumentGallery.mimeType,
            QDocumentGallery.path,
            QDocumentGallery.fileSize,
            QDocumentGallery.lastModified,
            QDocumentGallery.lastAccessed,
        ]

        labels = [
            self.tr('File Name'),
            self.tr('Type'),
            self.tr('Path'),
            self.tr('Size'),
            self.tr('Modified'),
            self.tr('Accessed'),
        ]

        self.requestProperties(QDocumentGallery.File, propertyNames, labels)
Example #24
0
    def __init__(self,parent=None):
        super(QtReducePreferencesToolBar,self).__init__(parent)

        settings = QSettings()

        toolBarGroup = QGroupBox(self.tr("Toolbar"))

        self.iconSetCombo = QtReduceComboBox()
        iDbKeys = QtReduceIconSets().db.keys()
        iDbKeys.sort()
        self.iconSetCombo.addItems(iDbKeys)

        settings.setValue("toolbar/iconset","Oxygen") # Hack

        traceLogger.debug("toolbar/iconset=%s" % settings.value("toolbar/iconset"))

        self.iconSetCombo.setCurrentIndex(
            self.iconSetCombo.findText(
                settings.value("toolbar/iconset",QtReduceDefaults.ICONSET)))

        self.iconSizeCombo = QtReduceIconSizeComboBox()
        self.iconSizeCombo.addItems(["16","22","32"])
        self.iconSizeCombo.setCurrentIndex(
            self.iconSizeCombo.findText(
                str(settings.value("toolbar/iconsize",
                                   QtReduceDefaults.ICONSIZE))))

        self.showCombo = QtReduceComboBox()
        self.showCombo.addItems([self.tr("Symbol and Text"),
                                 self.tr("Only Symbol"),
                                 self.tr("Only Text")])
        self.showCombo.setCurrentIndex(self.showCombo.findText(
            settings.value("toolbar/buttonstyle",
                           self.tr(QtReduceDefaults.BUTTONSTYLE))))

        toolBarLayout = QFormLayout()
#        toolBarLayout.addRow(self.tr("Symbol Set"),self.iconSetCombo)
        toolBarLayout.addRow(self.tr("Symbol Size"),self.iconSizeCombo)
        toolBarLayout.addRow(self.tr("Show"),self.showCombo)

        toolBarGroup.setLayout(toolBarLayout)

        mainLayout = QVBoxLayout()
        mainLayout.addWidget(toolBarGroup)

        self.setLayout(mainLayout)
Example #25
0
    def _initUI(self):
        # Widgets
        self._txt_showers = QLineEdit()
        self._txt_showers.setText(str(self.result().showers))

        # Layouts
        layout = _SaveableResultWidget._initUI(self)

        sublayout = QFormLayout()
        if sys.platform == "darwin":  # Fix for Mac OS
            layout.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
        sublayout.addRow("Number of showers", self._txt_showers)
        layout.addLayout(sublayout)

        layout.addStretch()

        return layout
Example #26
0
    def _initGUI(self):
        self.layout = QVBoxLayout()
        self.form = QFormLayout()

        self.name = QLineEdit()
        self.surname = QLineEdit()

        self.birthdate = QCalendarWidget()
        self.birthdate.setGridVisible(True)
        self.birthdate.setMinimumDate(QDate(1850, 1, 1))
        self.birthdate.setMaximumDate(QDate.currentDate())

        self.male = QRadioButton("Male")
        self.male.setChecked(True)
        self.female = QRadioButton("Female")

        self.height = QDoubleSpinBox()
        self.height.setMaximum(250)
        self.height.setMinimum(50)
        self.height.setValue(165)
        self.height.setSuffix(" cm")

        self.mass = QDoubleSpinBox()
        self.mass.setMaximum(300)
        self.mass.setMinimum(20)
        self.mass.setValue(60)
        self.mass.setSuffix(" Kg")

        btnLayout = QVBoxLayout()

        self.form.addRow("Name", self.name)
        self.form.addRow("Surname", self.surname)
        self.form.addRow("Birth date", self.birthdate)

        sexLayout = QHBoxLayout()
        sexLayout.addWidget(self.male)
        sexLayout.addWidget(self.female)
        self.form.addRow("Sex", sexLayout)

        self.form.addRow("Height", self.height)
        self.form.addRow("Mass", self.mass)

        self.layout.addLayout(self.form)
        self.layout.addLayout(btnLayout)
        self.setLayout(self.layout)
Example #27
0
    def _initUI(self):
        # Widgets
        val, unc = self.result().absorbed
        self._txt_absorbed = QLineEdit()
        self._txt_absorbed.setText(u"{0:n} \u00b1 {1:n}".format(val, unc))
        self._txt_absorbed.setReadOnly(True)

        val, unc = self.result().backscattered
        self._txt_backscattered = QLineEdit()
        self._txt_backscattered.setText(u"{0:n} \u00b1 {1:n}".format(val, unc))
        self._txt_backscattered.setReadOnly(True)

        val, unc = self.result().transmitted
        self._txt_transmitted = QLineEdit()
        self._txt_transmitted.setText(u"{0:n} \u00b1 {1:n}".format(val, unc))
        self._txt_transmitted.setReadOnly(True)

        # Layouts
        layout = _SaveableResultWidget._initUI(self)

        sublayout = QFormLayout()
        if sys.platform == "darwin":  # Fix for Mac OS
            layout.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
        sublayout.addRow("Absorbed fraction", self._txt_absorbed)
        sublayout.addRow("Backscattered fraction", self._txt_backscattered)
        sublayout.addRow("Transmitted fraction", self._txt_transmitted)
        layout.addLayout(sublayout)

        layout.addStretch()

        return layout
Example #28
0
    def __init__(self, parent=None):
        if not parent:
            parent = hiero.ui.mainWindow()
        super(ExportPdfOptionDialog, self).__init__(parent)

        layout = QFormLayout()
        self._fileNameField = FnFilenameField(False, isSaveFile=False, caption="Set PDF name", filter="*.pdf")
        self._fileNameField.setFilename(os.path.join(os.getenv("HOME"), "Desktop", "Sequence.pdf"))
        self._optionDropdown = QComboBox()
        self._buttonbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        self._buttonbox.button(QDialogButtonBox.Ok).setText("Export")
        self._buttonbox.accepted.connect(self.accept)
        self._buttonbox.rejected.connect(self.reject)

        self._pdfActionSettings = {"1 Shot per page": [1, 1], "4 Shots per page)": [2, 2], "9 Shots per page)": [3, 3]}

        for pdfMode in sorted(self._pdfActionSettings, reverse=True):
            self._optionDropdown.addItem(pdfMode)

        layout.addRow("Save to:", self._fileNameField)
        layout.addRow("PDF Layout:", self._optionDropdown)
        layout.addRow("", self._buttonbox)

        self.setLayout(layout)
        self.setWindowTitle("Export PDF Options")
        self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
    def setup_advanced_storage_group(self):
        """ Setup the 'Storage' group in the 'Advanced' tab.

        Returns:
        --------
        A QGroupBox widget
        """
        group = QGroupBox('Storage')
        layout = QFormLayout()
        layout.setFieldGrowthPolicy(QFormLayout.AllNonFixedFieldsGrow)

        path = Config.get('WEB_SOURCE_STORE', '')
        self.message_storage_edit = QLineEdit(path)
        self.message_storage_edit.textChanged.connect(self.update_message_storage)
        layout.addRow('Message Storage Path', self.message_storage_edit)

        group.setLayout(layout)
        return group
    def setup_advanced_server_group(self):
        """ Setup the 'Server' group in the 'Advanced' tab.

        Returns:
        --------
        A QGroupBox widget

        """
        group = QGroupBox('Server')
        layout = QFormLayout()
        layout.setFieldGrowthPolicy(QFormLayout.AllNonFixedFieldsGrow)

        self.message_url_edit = QLineEdit(Config.get('WS_HOST', ''))
        self.message_url_edit.textChanged.connect(self.update_message_url)
        layout.addRow('Messages API URL', self.message_url_edit)

        group.setLayout(layout)
        return group
Example #31
0
 def __init__(self, athlete):
     '''
     Constructor
     '''
     QDialog.__init__(self)
     
     self.setWindowTitle("Pushup form")
     self.athlete = athlete
     self.pushupForm = QFormLayout()
     self.createGUI()
Example #32
0
    def make_main_frame(self):
        self.main_frame = QWidget()
        win = pg.GraphicsWindow()
        self.crosshair_lb = pg.LabelItem(justify='right')
        win.addItem(self.crosshair_lb) 
        self.plot = win.addPlot(row=1, col=0) 
        self.plot.showGrid(x=True, y=True)
        self.right_panel = QGroupBox("Spectrometer Settings")
        
        hbox = QHBoxLayout()
        for w in [win, self.right_panel]:
            hbox.addWidget(w)

        form = QFormLayout()
        
        self.integration_sb = pg.SpinBox(value=0.001, bounds=(10*1e-6, 6553500*1e-6), suffix='s', siPrefix=True, \
                dec=True, step=1)
        self.integration_sb.valueChanged.connect(self.change_integration_time)

        self.persistence_sb = QtGui.QSpinBox()
        self.persistence_sb.setValue(7)
        self.persistence_sb.setRange(1,10)
        self.persistence_sb.valueChanged.connect(self.change_persistence)

        self.take_background_btn = QtGui.QPushButton('Take background')
        self.take_background_btn.clicked.connect(self.on_take_background)
        self.conc_lb = pg.ValueLabel()

        self.spec_temp_lb = pg.ValueLabel()

        self.use_background_cb = QtGui.QCheckBox("enabled")
        self.use_background_cb.stateChanged.connect(self.on_use_background)

        form.addRow("Integration time", self.integration_sb)
        form.addRow("Persistence",  self.persistence_sb)
        
        form.addRow("Background", self.take_background_btn)
        form.addRow("Use background", self.use_background_cb)
        self.right_panel.setLayout(form)
        self.main_frame.setLayout(hbox)
        self.setCentralWidget(self.main_frame)
Example #33
0
 def _table(self, a):
     if self.mySQL.do:
         da_2 = QDialog(self.app)
         if self.Data_Name != None:
             da_2.setWindowTitle("%s in %s" % (a.text(), self.Data_Name))
             da_2.resize(500, 280)
             line = QLineEdit()
             edi_t = edit.editText()
             but = QPushButton('Create')
             vbox = QVBoxLayout(da_2)
             form = QFormLayout()
             form.addRow(QLabel("Name Table"), line)
             vbox.addLayout(form)
             vbox.addWidget(edi_t)
             vbox.addWidget(but)
             but.clicked.connect(lambda: self.mySQL.create_table(
                 self.Data_Name, line.text(), edi_t.toPlainText()))
             self.app.ref = True
             da_2.exec_()
         else:
             MsgBox_2().showMsg("Plz Select Database ")
 def setUpUI(self):
     layout = QVBoxLayout()
     form = QFormLayout()
     form.addRow(QLabel("Satellite Data File"), self.files1)
     form.addRow(QLabel("Work Station Position DataFile"), self.files2)
     layout.addLayout(form)
     self.setLayout(layout)
 def __init__(self):
     super(PhoneFrame, self).__init__()
     self.setWindowTitle('Phone Book.')
     self.name = QLineEdit()
     self.number = QLineEdit()
     entry = QFormLayout()
     entry.addRow(QLabel('Name'), self.name)
     entry.addRow(QLabel('Number'), self.number)
     buttons = QHBoxLayout()
     button = QPushButton('&Add')
     button.clicked.connect(self._addEntry)
     buttons.addWidget(button)
     button = QPushButton('&Update')
     button.clicked.connect(self._updateEntry)
     buttons.addWidget(button)
     button = QPushButton('&Delete')
     button.clicked.connect(self._deleteEntry)
     buttons.addWidget(button)
     dataDisplay = QTableView()
     dataDisplay.setModel(PhoneDataModel())
     layout = QVBoxLayout()
     layout.addLayout(entry)
     layout.addLayout(buttons)
     layout.addWidget(dataDisplay)
     self.setLayout(layout)
     self.show()
Example #36
0
    def __init__(self, parent):
        global configuration
        super(EditConfigurationDialog, self).__init__(parent)

        title = _("Preferences")
        self.setWindowTitle(title)
        self.title_widget = TitleWidget(title, self)

        self.buttons = QDialogButtonBox()
        self.buttons.addButton(QDialogButtonBox.Ok)
        self.buttons.addButton(QDialogButtonBox.Cancel)

        self.font_select = QCheckBox()
        self.server_address = QLineEdit()

        form_layout = QFormLayout()
        form_layout.addRow(_("Fonts"), self.font_select)
        form_layout.addRow(_("Server's IP address"), self.server_address)

        top_layout = QVBoxLayout()
        top_layout.addWidget(self.title_widget)
        top_layout.addLayout(form_layout)
        top_layout.addWidget(self.buttons)

        self.setLayout(top_layout)  # QWidget takes ownership of the layout
        self.buttons.accepted.connect(self.save_and_accept)
        self.buttons.rejected.connect(self.cancel)

        self._load_configuration(configuration)
Example #37
0
 def _fill_form_layout(self, layout: QtGui.QFormLayout):
     """ Fill a QGridLayout with all MultiForms and Field, in the right order
     :param layout:
     :return:
     """
     all_components = []
     for multiform in self._multiforms.values():
         all_components.append(multiform)
     for field in self._fields.values():
         all_components.append(field)
     all_components.sort(key=self._sort_components)
     for row_index, obj in enumerate(all_components):
         if isinstance(obj, MultiForm):  # a MultiForm already is a QWidget
             layout.addRow(obj)
         elif isinstance(obj, SubForm):
             widget = QtGui.QGroupBox(str(obj.verbose_name), p(self))
             sub_layout = QtGui.QFormLayout(p(widget))
             obj._fill_form_layout(sub_layout)
             widget.setLayout(sub_layout)
             layout.addRow(widget)
         else:
             widget = obj.get_widget(self, self)
             self._widgets[obj.name] = widget
             obj.set_widget_value(widget, self._values[obj.name])
             layout.addRow(obj.label or '', widget)
Example #38
0
    def __init__(self, parent):
        super(PresenceDialog, self).__init__(parent)

        self.model = QuickComboModel(None)

        self.tar_type_edit = TaskActionReportTypeComboBox("action_type",
                                                          _("Action"),
                                                          nullable=False)
        self.tar_type_edit.set_model(
            [TaskActionReportType.day_in, TaskActionReportType.day_out])
        self.start_time_edit = TimeStampEdit("start_time",
                                             _("Start time"),
                                             nullable=False)
        self.form_fields = [self.tar_type_edit, self.start_time_edit]

        form_layout = QFormLayout()
        form_layout.addRow(_("Action"), self.tar_type_edit.widget)
        form_layout.addRow(_("Start time"), self.start_time_edit.widget)

        self.buttons = QDialogButtonBox()
        self.buttons.addButton(QDialogButtonBox.Ok)
        self.buttons.addButton(QDialogButtonBox.Cancel)
        self.buttons.accepted.connect(self.save_and_accept)
        self.buttons.rejected.connect(self.cancel)

        top_layout = QVBoxLayout()
        top_layout.addLayout(form_layout)
        top_layout.addWidget(self.buttons)

        self.setLayout(top_layout)
Example #39
0
    def initialize(self, words):
        self.removeComboBox = QComboBox()
        self.removeComboBox.addItems(words)
        self.tooltips.append((self.removeComboBox, """\
<p><b>Spelling Words combobox</b></p>
<p>This index's list of words that have been remembered as correctly
spelled or to be ignored even though they aren't in the dictionary for
the index's language.</p>"""))
        self.helpButton = QPushButton(QIcon(":/help.svg"), "Help")
        self.tooltips.append((self.helpButton,
                              "Help on the Forget Spelling Words dialog"))
        self.removeButton = QPushButton(QIcon(":/spelling-remove.svg"),
                                        "&Forget")
        self.tooltips.append((self.removeButton, """\
<p><b>Forget</b></p>
<p>Permanently forget the selected word from the index's spelling words
list. Afterwards, if this word appears in any entry, it will be
highlighted as misspelled.</p>"""))
        closeButton = QPushButton(QIcon(":/dialog-close.svg"),
                                  "&Close")
        self.tooltips.append((closeButton, """<p><b>Close</b></p>
<p>Close the dialog.</p>"""))
        self.buttonBox = QDialogButtonBox()
        self.buttonBox.addButton(closeButton, QDialogButtonBox.RejectRole)
        self.buttonBox.addButton(
            self.removeButton, QDialogButtonBox.ApplyRole)
        self.buttonBox.addButton(self.helpButton, QDialogButtonBox.HelpRole)
        layout = QFormLayout()
        layout.addRow("F&orget", self.removeComboBox)
        layout.addRow(self.buttonBox)
        self.setLayout(layout)
        self.helpButton.clicked.connect(self.help)
        self.removeButton.clicked.connect(self.remove)
        self.buttonBox.rejected.connect(self.reject)
Example #40
0
 def __init__(self,element):
     #kreiramo prozor
     QWidget.__init__(self)
     self.element = element
     #iskljucujemo polja za uvecanje i minimizaciju
     self.setWindowFlags(self.windowFlags() & ~Qt.WindowMaximizeButtonHint & ~Qt.WindowMinimizeButtonHint)
     #Podesavamo naslov
     self.setWindowTitle(self.element.ime)
     self.focusWidget()
     #editor teksta
     self.textEditor = QTextEdit()
     self.textEditor.setText(self.element.data)
     #dodajemo dugmad za primenu i odbacivanje promena
     #i povezujemo ih sa odgovarajucim funkcijama
     self.dugmeOk = QPushButton("Potvrdi")
     self.dugmeOtkazi = QPushButton("Otkazi")
     self.connect(self.dugmeOk,SIGNAL('clicked()'),self,SLOT('podesi()'))
     self.connect(self.dugmeOtkazi,SIGNAL('clicked()'),self,SLOT('zatvori()'))
     #formiramo raspored
     raspored = QFormLayout()
     raspored.addRow(self.textEditor)
     raspored.addRow(self.dugmeOtkazi,self.dugmeOk)
     self.setLayout(raspored)
Example #41
0
    def _initUI(self):
        # Widgets
        self._txt_time = QLineEdit()
        self._txt_time.setText(human_time(self.result().simulation_time_s))
        self._txt_time.setReadOnly(True)

        self._txt_speed = QLineEdit()
        self._txt_speed.setText(human_time(self.result().simulation_speed_s[0]))
        self._txt_speed.setReadOnly(True)

        # Layouts
        layout = _SaveableResultWidget._initUI(self)

        sublayout = QFormLayout()
        if sys.platform == "darwin":  # Fix for Mac OS
            layout.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
        sublayout.addRow("Total time of the simulation", self._txt_time)
        sublayout.addRow("Average time of one trajectory", self._txt_speed)
        layout.addLayout(sublayout)

        layout.addStretch()

        return layout
Example #42
0
 def layoutWidgets(self):
     form = QFormLayout()
     grid = QGridLayout()
     grid.addWidget(self.indexViewOnLeft, 0, 0)
     grid.addWidget(self.alwaysShowSortAsCheckBox, 1, 0)
     grid.addWidget(self.showNotesCheckBox, 2, 0)
     grid.addWidget(self.showMenuToolTipsCheckBox, 0, 1)
     grid.addWidget(self.showMainWindowToolTipsCheckBox, 1, 1)
     grid.addWidget(self.showDialogToolTipsCheckBox, 2, 1)
     grid.addWidget(self.keepHelpOnTopCheckBox, 3, 1)
     grid.addWidget(self.showSplashCheckBox, 4, 1)
     hbox = QHBoxLayout()
     hbox.addLayout(grid)
     hbox.addStretch()
     form.addRow(hbox)
     hbox = QHBoxLayout()
     hbox.addWidget(self.displaystdFontComboBox, 1)
     hbox.addWidget(self.displaystdFontSizeSpinBox)
     hbox.addStretch()
     label = QLabel("&Std. Font")
     label.setBuddy(self.displaystdFontComboBox)
     form.addRow(label, hbox)
     hbox = QHBoxLayout()
     hbox.addWidget(self.displayaltFontComboBox, 1)
     hbox.addWidget(self.displayaltFontSizeSpinBox)
     hbox.addStretch()
     label = QLabel("&Alt. Font")
     label.setBuddy(self.displayaltFontComboBox)
     form.addRow(label, hbox)
     hbox = QHBoxLayout()
     hbox.addWidget(self.displaymonoFontComboBox, 1)
     hbox.addWidget(self.displaymonoFontSizeSpinBox)
     hbox.addStretch()
     label = QLabel("&Mono. Font")
     label.setBuddy(self.displaymonoFontComboBox)
     form.addRow(label, hbox)
     self.setLayout(form)
Example #43
0
    def _create_field_controls(self):
        """Creates QWidgets for editing each field in DWC_TERMS and returns
        tuple of two dicts ({ field name: control },
                            { group name: QGroupBox }
        """
        # Mapping { field name: control }
        controls = {}

        # Mapping { group name: ToggleFrame }
        groups = {}

        current_group = group_layout = None

        def finish_group():
            # Finish the existing group
            debug_print('Finishing', current_group)

            # The widget that holds this group's controls
            controls_widget = QWidget()
            controls_widget.setLayout(group_layout)
            controls_widget.setVisible(False)

            # The group box, which contains the label to toggle the controls#
            # and the controls themselves
            group_box_layout = QVBoxLayout()
            group_box_layout.addWidget(
                ToggleWidgetLabel(current_group, controls_widget))
            group_box_layout.addWidget(controls_widget)
            group_box = QGroupBox()
            group_box.setLayout(group_box_layout)

            # Add the group box to the main layout
            self._main_layout.addRow(group_box)

            #self._main_layout.addWidget(group_box)
            groups[current_group] = group_box

        # Create controls and group boxes
        for field in DWC_TERMS:
            if field['Group label'] != current_group:
                if current_group:
                    finish_group()

                group_layout = QFormLayout()
                group_layout.setFieldGrowthPolicy(
                    QFormLayout.ExpandingFieldsGrow)
                current_group = field['Group label']

            # Create control for this field
            control = self._create_field_control(field)
            group_layout.addRow(URLLabel(field['URI'], field['Label']),
                                control)
            controls[field['Name']] = control

        finish_group()

        return controls, groups
Example #44
0
 def initUI(self):
     self.fileWidget = FileBrowseWidget("Firmware file .hex (*.hex)")
     layout = QFormLayout()
     layout.addRow(QLabel("Firmware file (.hex):"), self.fileWidget)
     label = QLabel("<b>Note:</b> after updating the firmware, all layout "
                    "and device settings will be erased.")
     label.setTextInteractionFlags(Qt.TextSelectableByMouse)
     layout.addRow(label)
     self.setLayout(layout)
    def __init__(self, parent = None):
        if not parent:
            parent = hiero.ui.mainWindow()
        super(ExportPdfOptionDialog, self).__init__(parent)

        layout = QFormLayout()
        self._fileNameField  = FnFilenameField(False, isSaveFile=False, caption="Set PDF name", filter='*.pdf')
        self._fileNameField.setFilename(os.path.join(os.getenv('HOME'), "Desktop", "Sequence.pdf"))
        self._pdfLayoutDropdown  = QComboBox()
        self._pdfLayoutDropdown.setToolTip("Set the PDF page layout type.")
        self._thumbFrameTypeDropdown  = QComboBox()
        self._thumbFrameTypeDropdown.setToolTip("Set which frame to take the thumbnail from.")

        self._buttonbox = QDialogButtonBox( QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        self._buttonbox.button(QDialogButtonBox.Ok).setText("Export")
        self._buttonbox.accepted.connect(self.accept)
        self._buttonbox.rejected.connect(self.reject)

        self._pdfLayouts = PDFExporter.PAGE_LAYOUTS_DICT

        self._thumbFrameTypes = PDFExporter.THUMB_FRAME_TYPES

        for pdfLayout in sorted(self._pdfLayouts, reverse=True):
            self._pdfLayoutDropdown.addItem(pdfLayout)

        for frameType in self._thumbFrameTypes:
            self._thumbFrameTypeDropdown.addItem(frameType)

        layout.addRow("Save to:", self._fileNameField)
        layout.addRow("PDF Layout:", self._pdfLayoutDropdown)
        layout.addRow("Thumbnail Frame:", self._thumbFrameTypeDropdown)        
        layout.addRow("", self._buttonbox)

        self.setLayout(layout)
        self.setWindowTitle("Export PDF Options")
        self.setSizePolicy( QSizePolicy.Expanding, QSizePolicy.Fixed )
Example #46
0
    def __init__(self, parent):
        super(MonthTimeCorrectionDialog, self).__init__(parent)

        self.setWindowTitle(_("Correction for month"))
        self.info = QLabel(_("Correction for month"), self)
        self.info.setWordWrap(True)

        self.correction_time_widget = DurationEdit(self)
        form_layout = QFormLayout()
        form_layout.addRow(_("Correction (hours)"),
                           self.correction_time_widget)

        self.buttons = QDialogButtonBox()
        self.buttons.addButton(QDialogButtonBox.Ok)
        self.buttons.addButton(QDialogButtonBox.Cancel)
        self.buttons.accepted.connect(self.save_and_accept)
        self.buttons.rejected.connect(self.cancel)

        top_layout = QVBoxLayout()
        top_layout.addWidget(self.info)
        top_layout.addLayout(form_layout)
        top_layout.addWidget(self.buttons)

        self.setLayout(top_layout)
    def __init__(self, client, method):
        super(Tab, self).__init__(None)

        self.client = client
        self.method = method

        horiz = QHBoxLayout(self)
        
        left = QWidget()
        
        horiz.addWidget(left)
        
        layout = QFormLayout(left)
        
        self.fields = []
        for param in method[1]:
            field = QLineEdit()
            self.fields.append(field)
            layout.addRow(param[0], field)

        button = QPushButton("Execute Web Service")
        button.clicked.connect(self.execute)
        layout.addWidget(button)
        
        display = QTabWidget()
        
        self.result = QTextBrowser()
        display.addTab(self.result, "Result")
        
        self.request = QTextBrowser()
        display.addTab(self.request, "Request", )
        
        self.response = QTextBrowser()
        display.addTab(self.response, "Response")
        
        horiz.addWidget(display)
Example #48
0
 def __init__(self, window = None):
     super(SelectUser, self).__init__(window)
     layout = QFormLayout(self)
     self.email = QLineEdit(self)
     fm = self.email.fontMetrics()
     self.email.setMaximumWidth(30 * fm.maxWidth() + 11)
     layout.addRow("&User ID:", self.email)
     self.pwd = QLineEdit(self)
     self.pwd.setEchoMode(QLineEdit.Password)
     fm = self.pwd.fontMetrics()
     self.pwd.setMaximumWidth(30 * fm.width('*') + 11)
     layout.addRow("&Password:"******"&Save Credentials (unsafe)")
     layout.addRow(self.savecreds)
     self.buttonbox = QDialogButtonBox(
         QDialogButtonBox.Ok | QDialogButtonBox.Cancel,
         Qt.Horizontal, self)
     self.buttonbox.accepted.connect(self.authenticate)
     self.buttonbox.rejected.connect(self.reject)
     layout.addRow(self.buttonbox)
     self.setLayout(layout)
    def testGetLayoutPosition(self):
        formlayout = QFormLayout()
        layout = QFormLayout()
        row, role = formlayout.getLayoutPosition(layout)
        self.assert_(isinstance(row, int))
        self.assert_(isinstance(role, QFormLayout.ItemRole))
        self.assertEqual(row, -1)

        formlayout.addRow(layout)
        row, role = formlayout.getLayoutPosition(layout)
        self.assert_(isinstance(row, int))
        self.assert_(isinstance(role, QFormLayout.ItemRole))
        self.assertEqual(row, 0)
        self.assertEqual(role, QFormLayout.SpanningRole)
Example #50
0
    def __init__(self, parent, user_session):
        super(LoginDialog, self).__init__(parent)
        self.user = None
        self.user_session = user_session

        title = _("{} Login").format(configuration.get("Globals", "name"))

        self.setWindowTitle(title)
        self.title_widget = TitleWidget(title, self)

        self.userid = QLineEdit()
        self.password = QLineEdit()
        self.password.setEchoMode(QLineEdit.Password)

        self.remember_me = QCheckBox()

        form_layout = QFormLayout()
        form_layout.addRow(_("User ID"), self.userid)
        form_layout.addRow(_("Password"), self.password)
        form_layout.addRow(_("Remember me"), self.remember_me)

        self.buttons = QDialogButtonBox()
        self.buttons.addButton(QDialogButtonBox.Ok)

        top_layout = QVBoxLayout()
        top_layout.addWidget(self.title_widget)
        top_layout.addWidget(QLabel(_("Please identify yourself")))
        top_layout.addLayout(form_layout)
        top_layout.addWidget(self.buttons)

        self.setLayout(top_layout)  # QWidget takes ownership of the layout

        self.buttons.accepted.connect(self.try_login)
        self.buttons.rejected.connect(self.cancel)

        self.userid.textEdited.connect(self.login_changed)

        if configuration.get("AutoLogin", "user"):
            self.remember_me.setCheckState(Qt.Checked)
            self.userid.setText(configuration.get("AutoLogin", "user"))
            self.password.setText(configuration.get("AutoLogin", "password"))

        mainlog.debug("__init__ login dialog")
Example #51
0
    def __init__(self):
        QDialog.__init__(self)

        layout = QFormLayout(self)
        self.setLayout(layout)
        layout.addRow("Python version:", QLabel("%s.%s.%s (%s)" % 
                        (sys.version_info[0], 
                         sys.version_info[1], 
                         sys.version_info[2], 
                         sys.version_info[3])))

        layout.addRow("Qt version:", QLabel( qVersion()))
Example #52
0
 def _initGUI(self):
     self.layout = QVBoxLayout()
     self.form = QFormLayout()
     
     self.name = QLineEdit()
     self.surname = QLineEdit()
     
     self.birthdate = QCalendarWidget()
     self.birthdate.setGridVisible(True)
     self.birthdate.setMinimumDate(QDate(1850,1,1))
     self.birthdate.setMaximumDate(QDate.currentDate())
     
     self.male = QRadioButton("Male")
     self.male.setChecked(True)
     self.female = QRadioButton("Female")
     
     self.height = QDoubleSpinBox()
     self.height.setMaximum(250)
     self.height.setMinimum(50)
     self.height.setValue(165)
     self.height.setSuffix(" cm")
     
     self.mass = QDoubleSpinBox()
     self.mass.setMaximum(300)
     self.mass.setMinimum(20)
     self.mass.setValue(60)
     self.mass.setSuffix(" Kg")
     
     btnLayout = QVBoxLayout()
     
     self.form.addRow("Name", self.name)
     self.form.addRow("Surname", self.surname)
     self.form.addRow("Birth date",self.birthdate)
     
     sexLayout = QHBoxLayout()
     sexLayout.addWidget(self.male)
     sexLayout.addWidget(self.female)
     self.form.addRow("Sex", sexLayout)
     
     self.form.addRow("Height", self.height)
     self.form.addRow("Mass", self.mass)
             
     self.layout.addLayout(self.form)
     self.layout.addLayout(btnLayout)
     self.setLayout(self.layout)
Example #53
0
    def __init__(self, wdg_limit, parent=None):
        QDialog.__init__(self, parent)
        self.setWindowTitle(wdg_limit.accessibleName())

        # Widgets
        self._wdg_limit = wdg_limit

        buttons = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)

        # Layouts
        layout = QFormLayout()
        layout.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow) # Fix for Mac OS
        layout.addRow(self._wdg_limit)
        layout.addRow(buttons)
        self.setLayout(layout)

        # Signals
        buttons.accepted.connect(self._onOk)
        buttons.rejected.connect(self.reject)
Example #54
0
    def __init__(self, parent=None, submit_callback=None, inputs=None):
        super(FormWidget, self).__init__(parent)

        if inputs is None:
            inputs = {}

        self.submit_callback = submit_callback

        self.form = QFormLayout()

        self.inputs = {}
        for key in inputs:
            self.inputs[key] = QLineEdit()
            self.form.addRow(QLabel(key), self.inputs[key])

        self.submitButton = QPushButton("Submit")
        self.submitButton.clicked.connect(self.button_pushed)

        self.form.addRow(self.submitButton)

        self.setLayout(self.form)