Python PyQt4.QtGui 模块,QDoubleSpinBox() 实例源码

我们从Python开源项目中,提取了以下19个代码示例,用于说明如何使用PyQt4.QtGui.QDoubleSpinBox()

项目:picasso    作者:jungmannlab    | 项目源码 | 文件源码
def __init__(self, window):
        super().__init__(window)
        self.window = window
        self.setWindowTitle('Parameters')
        self.setModal(False)
        grid = QtGui.QGridLayout(self)

        grid.addWidget(QtGui.QLabel('Oversampling:'), 0, 0)
        self.oversampling = QtGui.QDoubleSpinBox()
        self.oversampling.setRange(1, 200)
        self.oversampling.setValue(4)
        self.oversampling.setDecimals(1)
        self.oversampling.setKeyboardTracking(False)
        self.oversampling.valueChanged.connect(self.window.updateLayout)
        grid.addWidget(self.oversampling, 0, 1)

        self.iterations = QtGui.QSpinBox()
        self.iterations.setRange(1, 1)
        self.iterations.setValue(1)
项目:picasso    作者:jungmannlab    | 项目源码 | 文件源码
def __init__(self, window):
        super().__init__(window)
        self.window = window
        self.setWindowTitle('Parameters')
        self.setModal(False)
        grid = QtGui.QGridLayout(self)

        grid.addWidget(QtGui.QLabel('Oversampling:'), 0, 0)
        self.oversampling = QtGui.QDoubleSpinBox()
        self.oversampling.setRange(1, 1e7)
        self.oversampling.setValue(10)
        self.oversampling.setDecimals(1)
        self.oversampling.setKeyboardTracking(False)
        self.oversampling.valueChanged.connect(self.window.view.update_image)
        grid.addWidget(self.oversampling, 0, 1)

        grid.addWidget(QtGui.QLabel('Iterations:'), 1, 0)
        self.iterations = QtGui.QSpinBox()
        self.iterations.setRange(0, 1e7)
        self.iterations.setValue(10)
        grid.addWidget(self.iterations, 1, 1)
项目:Bigglesworth    作者:MaurizioB    | 项目源码 | 文件源码
def valueFromText(self, text):
        new_value = QtGui.QDoubleSpinBox.valueFromText(self, text)
        pos = bisect_left(popup_values, new_value)
        if pos == 1:
            self.index = pos
            self.indexChanged.emit(pos)
            return popup_values[0]
        if pos == len(popup_values):
            self.index = pos
            self.indexChanged.emit(pos)
            return popup_values[-1]
        before = popup_values[pos-1]
        after = popup_values[pos]
        if after-new_value < new_value-before:
            self.index = after
            self.indexChanged.emit(after)
            return after
        self.index = before
        self.indexChanged.emit(before)
        return before
项目:SamuROI    作者:samuroi    | 项目源码 | 文件源码
def __init__(self, parent, *args, **kwargs):
        super(MaskToolbar, self).__init__(parent=parent, *args, **kwargs)

        # memorize the original threshold value and keep track of updates
        self.__threshold_base = self.active_segmentation.threshold
        # connect to get informed about theshold adaptions from user
        self.active_segmentation.data_changed.append(self.data_changed)
        # update the spinbox such that it reflects threshold changes e.g. via ipython
        # fixme will lead to infinte signal loop
        # self.active_segmentation.data_changed.append(self.threshold_changed)

        self.btn_toggle = self.addAction("Mask")
        self.btn_toggle.setToolTip("Toggle the mask overlay.")
        self.btn_toggle.setCheckable(True)
        self.btn_toggle.setChecked(self.active_frame_canvas.show_overlay)
        self.btn_toggle.triggered.connect(lambda on: setattr(self.active_frame_canvas, "show_overlay", on))

        self.threshold_spin_box = QtGui.QDoubleSpinBox(value=100.)
        self.threshold_spin_box.setRange(0., 99999.)
        self.threshold_spin_box.setValue(100.)
        self.threshold_spin_box.setAlignment(QtCore.Qt.Alignment(QtCore.Qt.AlignRight))
        self.threshold_spin_box.setSingleStep(.5)
        self.threshold_spin_box.valueChanged.connect(self.update_threshold)

        self.addWidget(self.threshold_spin_box)
项目:segyviewer    作者:Statoil    | 项目源码 | 文件源码
def _set_up_opt_spin_box(self):
        check_box = QCheckBox()
        spin_box = QDoubleSpinBox()
        spin_box.setDecimals(5)
        spin_box.setSingleStep(0.01)
        spin_box.setMinimum(-sys.float_info.max)
        spin_box.setMaximum(sys.float_info.max)
        spin_box.setDisabled(True)
        check_box.toggled.connect(spin_box.setEnabled)

        return check_box, spin_box
项目:picasso    作者:jungmannlab    | 项目源码 | 文件源码
def __init__(self, window):
        super().__init__(window)
        self.window = window
        self.setWindowTitle('Enter parameters')
        vbox = QtGui.QVBoxLayout(self)
        grid = QtGui.QGridLayout()
        grid.addWidget(QtGui.QLabel('Max. distance (pixels):'), 0, 0)
        self.max_distance = QtGui.QDoubleSpinBox()
        self.max_distance.setRange(0, 1e6)
        self.max_distance.setValue(1)
        grid.addWidget(self.max_distance, 0, 1)
        grid.addWidget(QtGui.QLabel('Max. transient dark frames:'), 1, 0)
        self.max_dark_time = QtGui.QDoubleSpinBox()
        self.max_dark_time.setRange(0, 1e9)
        self.max_dark_time.setValue(1)
        grid.addWidget(self.max_dark_time, 1, 1)
        vbox.addLayout(grid)
        hbox = QtGui.QHBoxLayout()
        vbox.addLayout(hbox)
        # OK and Cancel buttons
        self.buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel,
                                              QtCore.Qt.Horizontal,
                                              self)
        vbox.addWidget(self.buttons)
        self.buttons.accepted.connect(self.accept)
        self.buttons.rejected.connect(self.reject)

    # static method to create the dialog and return input
项目:picasso    作者:jungmannlab    | 项目源码 | 文件源码
def __init__(self, window):
        super().__init__(window)
        self.window = window
        self.setWindowTitle('Tools Settings')
        self.setModal(False)
        vbox = QtGui.QVBoxLayout(self)
        pick_groupbox = QtGui.QGroupBox('Pick')
        vbox.addWidget(pick_groupbox)
        pick_grid = QtGui.QGridLayout(pick_groupbox)
        pick_grid.addWidget(QtGui.QLabel('Diameter (cam. pixel):'), 0, 0)
        self.pick_diameter = QtGui.QDoubleSpinBox()
        self.pick_diameter.setRange(0, 999999)
        self.pick_diameter.setValue(1)
        self.pick_diameter.setSingleStep(0.1)
        self.pick_diameter.setDecimals(3)
        self.pick_diameter.setKeyboardTracking(False)
        self.pick_diameter.valueChanged.connect(self.on_pick_diameter_changed)
        pick_grid.addWidget(self.pick_diameter, 0, 1)
        pick_grid.addWidget(QtGui.QLabel('Pick similar +/- range (std)'), 1, 0)
        self.pick_similar_range = QtGui.QDoubleSpinBox()
        self.pick_similar_range.setRange(0, 100000)
        self.pick_similar_range.setValue(2)
        self.pick_similar_range.setSingleStep(0.1)
        self.pick_similar_range.setDecimals(1)
        pick_grid.addWidget(self.pick_similar_range, 1, 1)
        self.pick_annotation = QtGui.QCheckBox('Annotate picks')
        self.pick_annotation.stateChanged.connect(self.on_pick_diameter_changed)
        pick_grid.addWidget(self.pick_annotation, 2, 0)
项目:Bigglesworth    作者:MaurizioB    | 项目源码 | 文件源码
def __init__(self, parent):
        self.indexMinimum = 1
        self.indexMaximum = len(popup_values) - 1
        self.indexRange = self.indexMinimum, self.indexMaximum
        QtGui.QDoubleSpinBox.__init__(self, parent)
        self.setRange(.1, 15.5)
        self.setSuffix('s')
        self.setDecimals(1)
        self.setSingleStep(.1)
        self.index = 0
        self.setIndex(1)
项目:Bigglesworth    作者:MaurizioB    | 项目源码 | 文件源码
def validate(self, text, pos):
        res = QtGui.QDoubleSpinBox.validate(self, text, pos)
        if res in (QtGui.QValidator.Invalid, QtGui.QValidator.Intermediate):
            return res
        new_value = QtGui.QDoubleSpinBox.valueFromText(self, text)
        if not popup_values[self.indexMinimum] <= new_value <= popup_values[self.indexMaximum]:
            return QtGui.QValidator.Invalid, res[1]
        return res
项目:MidiMemo    作者:MaurizioB    | 项目源码 | 文件源码
def ratio_spin_focus_in(self, event):
        self.ratio_spin.setDecimals(2)
#        self.ratio_spin.lineEdit().setText(self.ratio_spin.lineEdit().text().replace('x', ''))
#        self.ratio_spin.lineEdit().setText(self.ratio_spin.textFromValue(self.ratio_spin.value()).replace(self.ratio_spin.prefix(), ''))
        self.ratio_spin.setPrefix('')
        QtGui.QDoubleSpinBox.focusInEvent(self.ratio_spin, event)
        self.ratio_spin.lineEdit().selectAll()
项目:MidiMemo    作者:MaurizioB    | 项目源码 | 文件源码
def ratio_spin_focus_out(self, event):
        value = self.ratio_spin.lineEdit().text()
        dec_locale = QtCore.QString(QtCore.QLocale().decimalPoint())
        dec_point = QtCore.QString('.')
        value = str(value.replace(dec_locale, dec_point))
        dec = len(value.rstrip('0')[value.index('.')+1:])
        self.ratio_spin.setDecimals(dec)
        self.ratio_spin.setValue(float(value))
        self.ratio_spin.setPrefix('x')
        QtGui.QDoubleSpinBox.focusOutEvent(self.ratio_spin, event)
项目:NIRCA-Database    作者:Snyder005    | 项目源码 | 文件源码
def __init__(self, database_ref):
        super(ModifyPage, self).__init__()

        self.database_ref = database_ref

        ## Create QWidget objects
        self.ratingLabel = QtGui.QLabel('Assign 200 SR Time:')
        self.ratingSpinBox = QtGui.QDoubleSpinBox()
        self.ratingSpinBox.setDecimals(3)
        self.ratingSpinBox.setRange(500.000, 1800.000)
        self.ratingSpinBox.setSuffix(' s')

        self.errorLabel = QtGui.QLabel('Error:')
        self.errorEdit = QtGui.QLineEdit()

        self.raceTable = RaceTableWidget(15)

        self.generateButton = QtGui.QPushButton('Generate')
        self.exportButton = QtGui.QPushButton('Export')
        self.addButton = QtGui.QPushButton('Add')
        self.confirmCheckBox = QtGui.QCheckBox('Confirm')

        ## Set up layout
        self.grid = QtGui.QGridLayout()
        self.grid.setSpacing(20)

        self.grid.addWidget(self.ratingLabel, 0, 0)
        self.grid.addWidget(self.ratingSpinBox, 0, 1)
        self.grid.addWidget(self.generateButton, 0, 2)
        self.grid.addWidget(self.errorLabel, 0, 4)
        self.grid.addWidget(self.errorEdit, 0, 5)
        self.grid.addWidget(self.raceTable, 1, 0, 10, 6)
        self.grid.addWidget(self.exportButton, 12, 0)
        self.grid.addWidget(self.addButton, 12, 4)
        self.grid.addWidget(self.confirmCheckBox, 12, 5)
        self.setLayout(self.grid)

        ## Connect signals and slots

        ## Register fields
        self.registerField('modify_check*', self.confirmCheckBox)
项目:segyviewer    作者:Statoil    | 项目源码 | 文件源码
def __init__(self, parent, slice_view_widget, context):
        super(PlotExportSettingsWidget, self).__init__(parent)

        self._slice_view_widget = slice_view_widget
        self._context = context

        self._dpi_units = ["in", "cm", "px"]

        if parent is None or self._slice_view_widget is None:
            w, h, dpi = 11.7, 8.3, 100
        else:
            fig = self._slice_view_widget.layout_figure()
            w, h = fig.get_size_inches()
            dpi = fig.dpi

        self._label = QLabel()
        self._label.setDisabled(True)
        self._set_label_txt(w, h, self._dpi_units[0])

        self._fix_size = QCheckBox()
        self._fix_width = QDoubleSpinBox()
        self._fix_width.setDisabled(True)

        self._fix_height = QDoubleSpinBox()
        self._fix_height.setDisabled(True)

        self._fix_dpi_units = QComboBox()
        self._fix_dpi_units.setDisabled(True)

        self._fix_width.setMinimum(1)
        self._fix_width.setMaximum(32000)
        self._fix_width.setValue(w)

        self._fix_height.setMinimum(1)
        self._fix_height.setMaximum(32000)
        self._fix_height.setValue(h)

        self._fix_width.valueChanged.connect(self._fixed_image)
        self._fix_height.valueChanged.connect(self._fixed_image)

        self._fix_dpi_units.addItems(self._dpi_units)
        self._fix_dpi_units.activated.connect(self._fixed_image)
        self._fix_size.toggled.connect(self._fixed_image)

        self._label_widget = self._label
        self._enable_widget = self._fix_size
        self._dpi_widget = self._fix_dpi_units
        self._height_widget = self._fix_height
        self._width_widget = self._fix_width
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def guisave(ui, settings):
    #for child in ui.children():  # works like getmembers, but because it traverses the hierarachy, you would have to call guisave recursively to traverse down the tree
    for name, obj in inspect.getmembers(ui):
        if isinstance(obj, QtGui.QComboBox):
            name   = obj.objectName()      # get combobox name
            index  = obj.currentIndex()    # get current index from combobox
            settings.setValue(name, index)   # save combobox selection to registry
            #print 'combo',name,index

        elif isinstance(obj, QtGui.QLineEdit):
            name = obj.objectName()
            value = obj.text()
            settings.setValue(name, value)    # save ui values, so they can be restored next time
            #print 'line',name,value

        elif isinstance(obj, QtGui.QCheckBox):
            name = obj.objectName()
            state = obj.checkState()
            settings.setValue(name, state)
            #print 'check',name,state

        elif isinstance(obj, QtGui.QDial):
            name = obj.objectName()
            value = obj.value()
            settings.setValue(name, value)
            #print 'dial',name,value

        elif isinstance(obj, QtGui.QSlider):
            name = obj.objectName()
            value = obj.value()
            settings.setValue(name, value)
            #print 'slider',name,value

        elif isinstance(obj, QtGui.QSpinBox):
            name = obj.objectName()
            value = obj.value()
            settings.setValue(name, value)
            #print 'spin',name,value

        elif isinstance(obj, QtGui.QDoubleSpinBox):
            name = obj.objectName()
            value = obj.value()
            settings.setValue(name, value)
            #print 'doublespin',name,value


#===================================================================
# restore "ui" controls with values stored in registry "settings"
# ui = QMainWindow object
# settings = QSettings object
#===================================================================
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def guirestore(ui, settings):
    for name, obj in inspect.getmembers(ui):
        if isinstance(obj, QtGui.QComboBox):
            name   = obj.objectName()
            index = int(settings.value(name))
            if index == "" or index==-1:
                continue
            obj.setCurrentIndex(index)   # preselect a combobox value by index    

        elif isinstance(obj, QtGui.QLineEdit):
            name = obj.objectName()
            value = unicode(settings.value(name))  # get stored value from registry
            obj.setText(value)  # restore lineEditFile

        elif isinstance(obj, QtGui.QCheckBox):
            name = obj.objectName()
            value = int(settings.value(name))
            if value != None:
                obj.setChecked(bool(value))   # restore checkbox

        elif isinstance(obj, QtGui.QDial):
            name   = obj.objectName()
            value = int(settings.value(name))
            if value == "":
                continue
            obj.setValue(value)

        elif isinstance(obj, QtGui.QSlider):
            name   = obj.objectName()
            value = int(settings.value(name))
            if value == "":
                continue
            obj.setValue(value)

        elif isinstance(obj, QtGui.QSpinBox):
            name   = obj.objectName()
            value = int(settings.value(name))
            if value == "":
                continue
            obj.setValue(value)

        elif isinstance(obj, QtGui.QDoubleSpinBox):
            name   = obj.objectName()
            value = int(settings.value(name))
            if value == "":
                continue
            obj.setValue(value)


################################################################
项目:ddt4all    作者:cedricp    | 项目源码 | 文件源码
def __init__(self, dataitem, parent=None):
        super(numericPanel, self).__init__(parent)
        self.setFrameStyle(gui.QFrame.Sunken)
        self.setFrameShape(gui.QFrame.Box)
        self.data = dataitem

        layout = gui.QGridLayout()
        labelnob = gui.QLabel(_("Number of bit"))
        lableunit = gui.QLabel(_("Unit"))
        labelsigned = gui.QLabel(_("Signed"))
        labelformat = gui.QLabel(_("Format"))
        labeldoc = gui.QLabel(_("Value = (AX+B) / C"))
        labela = gui.QLabel("A")
        labelb = gui.QLabel("B")
        labelc = gui.QLabel("C")

        layout.addWidget(labelnob, 0, 0)
        layout.addWidget(lableunit, 1, 0)
        layout.addWidget(labelsigned, 2, 0)
        layout.addWidget(labelformat, 3, 0)
        layout.addWidget(labeldoc, 4, 0)
        layout.addWidget(labela, 5, 0)
        layout.addWidget(labelb, 6, 0)
        layout.addWidget(labelc, 7, 0)
        layout.setRowStretch(8, 1)

        self.inputnob = gui.QSpinBox()
        self.inputnob.setRange(1, 32)
        self.inputunit = gui.QLineEdit()
        self.inputsigned = gui.QCheckBox()
        self.inputformat = gui.QLineEdit()
        self.inputa = gui.QDoubleSpinBox()
        self.inputb = gui.QDoubleSpinBox()
        self.inputc = gui.QDoubleSpinBox()
        self.inputc.setRange(-1000000, 1000000)
        self.inputb.setRange(-1000000, 1000000)
        self.inputa.setRange(-1000000, 1000000)
        self.inputa.setDecimals(4)
        self.inputb.setDecimals(4)
        self.inputc.setDecimals(4)

        layout.addWidget(self.inputnob, 0, 1)
        layout.addWidget(self.inputunit, 1, 1)
        layout.addWidget(self.inputsigned, 2, 1)
        layout.addWidget(self.inputformat, 3, 1)
        layout.addWidget(self.inputa, 5, 1)
        layout.addWidget(self.inputb, 6, 1)
        layout.addWidget(self.inputc, 7, 1)

        self.setLayout(layout)

        self.init()
项目:barium    作者:barium-project    | 项目源码 | 文件源码
def setupUi(self):
        Form = self
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(400, 150)
        self.frame = QtGui.QFrame(Form)
        self.frame.setGeometry(QtCore.QRect(10, 10, 381, 131))
        self.frame.setFrameShape(QtGui.QFrame.Box)
        self.frame.setFrameShadow(QtGui.QFrame.Raised)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.label = QtGui.QLabel(self.frame)
        self.label.setGeometry(QtCore.QRect(10, 10, 121, 21))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setObjectName(_fromUtf8("label"))
        self.t_right_lcd = QtGui.QLCDNumber(self.frame)
        self.t_right_lcd.setGeometry(QtCore.QRect(260, 90, 111, 31))
        self.t_right_lcd.setObjectName(_fromUtf8("t_right_lcd"))
        self.t_middle_lcd = QtGui.QLCDNumber(self.frame)
        self.t_middle_lcd.setGeometry(QtCore.QRect(140, 90, 111, 31))
        self.t_middle_lcd.setObjectName(_fromUtf8("t_middle_lcd"))
        self.t_left_lcd = QtGui.QLCDNumber(self.frame)
        self.t_left_lcd.setGeometry(QtCore.QRect(20, 90, 111, 31))
        self.t_left_lcd.setObjectName(_fromUtf8("t_left_lcd"))
        self.t_left_label = QtGui.QLabel(self.frame)
        self.t_left_label.setGeometry(QtCore.QRect(20, 70, 111, 21))
        self.t_left_label.setObjectName(_fromUtf8("t_left_label"))
        self.t_middle_label = QtGui.QLabel(self.frame)
        self.t_middle_label.setGeometry(QtCore.QRect(140, 72, 111, 21))
        self.t_middle_label.setObjectName(_fromUtf8("t_middle_label"))
        self.t_right_label = QtGui.QLabel(self.frame)
        self.t_right_label.setGeometry(QtCore.QRect(260, 72, 111, 21))
        self.t_right_label.setObjectName(_fromUtf8("t_right_label"))
        self.t_right_button = QtGui.QPushButton(self.frame)
        self.t_right_button.setGeometry(QtCore.QRect(260, 20, 111, 41))
        self.t_right_button.setObjectName(_fromUtf8("t_right_button"))
        self.t_middle_button = QtGui.QPushButton(self.frame)
        self.t_middle_button.setGeometry(QtCore.QRect(140, 20, 111, 41))
        self.t_middle_button.setObjectName(_fromUtf8("t_middle_button"))
        self.t_spinbox = QtGui.QDoubleSpinBox(self.frame)
        self.t_spinbox.setGeometry(QtCore.QRect(20, 40, 111, 22))
        self.t_spinbox.setObjectName(_fromUtf8("t_spinbox"))

        self.retranslateUi()
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:barium    作者:barium-project    | 项目源码 | 文件源码
def setupUi(self):
        Form = self
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(400, 150)
        self.frame = QtGui.QFrame(Form)
        self.frame.setGeometry(QtCore.QRect(10, 10, 381, 131))
        self.frame.setFrameShape(QtGui.QFrame.Box)
        self.frame.setFrameShadow(QtGui.QFrame.Raised)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.label = QtGui.QLabel(self.frame)
        self.label.setGeometry(QtCore.QRect(10, 6, 361, 21))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setObjectName(_fromUtf8("label"))
        self.ps_max_voltage_spinbox = QtGui.QDoubleSpinBox(self.frame)
        self.ps_max_voltage_spinbox.setGeometry(QtCore.QRect(100, 40, 81, 31))
        self.ps_max_voltage_spinbox.setMaximum(20.0)
        self.ps_max_voltage_spinbox.setProperty("value", 20.0)
        self.ps_max_voltage_spinbox.setObjectName(_fromUtf8("ps_max_voltage_spinbox"))
        self.ps_min_voltage_spinbox = QtGui.QDoubleSpinBox(self.frame)
        self.ps_min_voltage_spinbox.setGeometry(QtCore.QRect(100, 81, 81, 31))
        self.ps_min_voltage_spinbox.setMaximum(20.0)
        self.ps_min_voltage_spinbox.setObjectName(_fromUtf8("ps_min_voltage_spinbox"))
        self.ps_max_current_spinbox = QtGui.QDoubleSpinBox(self.frame)
        self.ps_max_current_spinbox.setGeometry(QtCore.QRect(290, 40, 81, 31))
        self.ps_max_current_spinbox.setMaximum(30.0)
        self.ps_max_current_spinbox.setProperty("value", 30.0)
        self.ps_max_current_spinbox.setObjectName(_fromUtf8("ps_max_current_spinbox"))
        self.ps_min_current_spinbox = QtGui.QDoubleSpinBox(self.frame)
        self.ps_min_current_spinbox.setGeometry(QtCore.QRect(290, 81, 81, 31))
        self.ps_min_current_spinbox.setMaximum(30.0)
        self.ps_min_current_spinbox.setObjectName(_fromUtf8("ps_min_current_spinbox"))
        self.label_2 = QtGui.QLabel(self.frame)
        self.label_2.setGeometry(QtCore.QRect(10, 40, 91, 31))
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.label_3 = QtGui.QLabel(self.frame)
        self.label_3.setGeometry(QtCore.QRect(10, 82, 91, 31))
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.label_4 = QtGui.QLabel(self.frame)
        self.label_4.setGeometry(QtCore.QRect(210, 44, 81, 21))
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.label_5 = QtGui.QLabel(self.frame)
        self.label_5.setGeometry(QtCore.QRect(210, 80, 81, 31))
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.line = QtGui.QFrame(self.frame)
        self.line.setGeometry(QtCore.QRect(179, 40, 31, 81))
        self.line.setFrameShape(QtGui.QFrame.VLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))

        self.retranslateUi()
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:barium    作者:barium-project    | 项目源码 | 文件源码
def makeLayout(self):
        layout = QtGui.QGridLayout()

        shell_font = 'MS Shell Dlg 2'
        title = QtGui.QLabel('Ablation Loading')
        title.setFont(QtGui.QFont(shell_font, pointSize=16))
        title.setAlignment(QtCore.Qt.AlignCenter)

        loadingName = QtGui.QLabel('Trap Delay (usec)')
        loadingName.setFont(QtGui.QFont(shell_font, pointSize=16))
        loadingName.setAlignment(QtCore.Qt.AlignCenter)


        self.trigger_loading = QtGui.QPushButton('Ablation Load')
        self.trigger_loading.setMaximumHeight(30)
        self.trigger_loading.setMinimumHeight(30)
        self.trigger_loading.setFont(QtGui.QFont(shell_font, pointSize=14))
        self.trigger_loading.setStyleSheet("background-color: green")



        #self.update_dc.setMinimumWidth(180)

        # loading time
        self.loading_time_spin = QtGui.QDoubleSpinBox()
        self.loading_time_spin.setFont(QtGui.QFont(shell_font, pointSize=16))
        self.loading_time_spin.setDecimals(0)
        self.loading_time_spin.setSingleStep(1)
        self.loading_time_spin.setRange(6, 200)
        self.loading_time_spin.setKeyboardTracking(False)



        #layout 1 row at a time

        layout.addWidget(title,                     0, 0, 2, 2)
        layout.addWidget(loadingName,               2, 0, 1, 2)
        layout.addWidget(self.loading_time_spin,    3, 0, 1, 2)
        layout.addWidget(self.trigger_loading,      5, 0, 1, 2)


        layout.minimumSize()

        self.setLayout(layout)