当前位置: 首页>>代码示例>>Python>>正文


Python QtWidgets.QDoubleSpinBox方法代码示例

本文整理汇总了Python中PyQt5.QtWidgets.QDoubleSpinBox方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QDoubleSpinBox方法的具体用法?Python QtWidgets.QDoubleSpinBox怎么用?Python QtWidgets.QDoubleSpinBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtWidgets的用法示例。


在下文中一共展示了QtWidgets.QDoubleSpinBox方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def __init__(self):
        #self.position_struc = sim_struct.POSITION()
        self.p1 = []
        self.p2 = []
        #self.ogl_object = None
        #self.electrode.definition = 'plane'
        self.didt_box = QtWidgets.QDoubleSpinBox()
        self.didt_box.setSuffix("x10e6 A/s")
        self.didt_box.setMinimum(0)
        self.didt_box.setMaximum(200)
        self.didt_box.setSingleStep(0.5)
        self.didt_box.setValue(1)

        self.dist_box = QtWidgets.QDoubleSpinBox()
        self.dist_box.setSuffix("mm")
        self.dist_box.setMinimum(0.)
        self.dist_box.setMaximum(200)
        self.dist_box.setSingleStep(1)
        self.dist_box.setValue(4)

        self.position_item = QtWidgets.QTableWidgetItem('')
        self.position_item.setFlags(self.position_item.flags() ^ QtCore.Qt.ItemIsEditable)

        self.name_item = QtWidgets.QTableWidgetItem('') 
开发者ID:simnibs,项目名称:simnibs,代码行数:26,代码来源:main_gui.py

示例2: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def __init__(self, *args, mode=FadeComboBox.Mode.FadeOut, **kwargs):
        super().__init__(*args, **kwargs)
        self.setLayout(QGridLayout())

        self.fadeDurationSpin = QDoubleSpinBox(self)
        self.fadeDurationSpin.setRange(0, 3600)
        self.layout().addWidget(self.fadeDurationSpin, 0, 0)

        self.fadeDurationLabel = QLabel(self)
        self.fadeDurationLabel.setAlignment(Qt.AlignCenter)
        self.layout().addWidget(self.fadeDurationLabel, 0, 1)

        self.fadeTypeCombo = FadeComboBox(self, mode=mode)
        self.layout().addWidget(self.fadeTypeCombo, 1, 0)

        self.fadeTypeLabel = QLabel(self)
        self.fadeTypeLabel.setAlignment(Qt.AlignCenter)
        self.layout().addWidget(self.fadeTypeLabel, 1, 1)

        self.retranslateUi() 
开发者ID:FrancescoCeruti,项目名称:linux-show-player,代码行数:22,代码来源:fade_edit.py

示例3: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def __init__(self, app):
        super().__init__(app)

        self._widget = QtWidgets.QWidget()
        self.layout = QtWidgets.QFormLayout()
        self._widget.setLayout(self.layout)

        self.input_vswr_limit = QtWidgets.QDoubleSpinBox()
        self.input_vswr_limit.setValue(self.vswr_limit_value)
        self.input_vswr_limit.setSingleStep(0.1)
        self.input_vswr_limit.setMinimum(1)
        self.input_vswr_limit.setMaximum(25)
        self.input_vswr_limit.setDecimals(2)

        self.checkbox_move_marker = QtWidgets.QCheckBox()
        self.layout.addRow(QtWidgets.QLabel("<b>Settings</b>"))
        self.layout.addRow("VSWR limit", self.input_vswr_limit)
        self.layout.addRow(VSWRAnalysis.QHLine())

        self.results_label = QtWidgets.QLabel("<b>Results</b>")
        self.layout.addRow(self.results_label) 
开发者ID:NanoVNA-Saver,项目名称:nanovna-saver,代码行数:23,代码来源:VSWRAnalysis.py

示例4: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def __init__(self, parent=None):
        super(BaseModelSelectionPage, self).__init__(parent)
        self.setTitle("Base Model Selection")
        self._layout = QVBoxLayout(self)
        _model_section_widget = QWidget()
        _section_layout = QFormLayout(_model_section_widget)
        self.ds_picker = DatasetPicker()
        self.arch_picker = ModelPicker()
        self._num_of_epochs_picker = QSpinBox()
        self._num_of_workers_picker = QSpinBox()
        self._batch_size_picker = QSpinBox()
        self._learning_rate_picker = QDoubleSpinBox()
        self._learning_momentum_picker = QDoubleSpinBox()
        self._learning_weight_decay_picker = QDoubleSpinBox()
        self._learning_weight_decay_picker = QDoubleSpinBox()
        _section_layout.addRow(self.tr("Dataset: "), self.ds_picker)
        _section_layout.addRow(self.tr("Architecture: "), self.arch_picker)
        _section_layout.addRow(self.tr("Number of epochs: "), self._num_of_epochs_picker)
        _section_layout.addRow(self.tr("Number of workers: "), self._num_of_workers_picker)
        _section_layout.addRow(self.tr("Batch Size: "), self._batch_size_picker)
        _section_layout.addRow(self.tr("Learning rate: "), self._learning_rate_picker)
        self._layout.addWidget(GUIUtilities.wrap_with_groupbox(_model_section_widget, "Model Details")) 
开发者ID:haruiz,项目名称:CvStudio,代码行数:24,代码来源:model_wizard.py

示例5: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def __init__(self, window):
        super().__init__(window)
        self.window = window
        self.setWindowTitle("Parameters")
        self.setModal(False)
        grid = QtWidgets.QGridLayout(self)

        grid.addWidget(QtWidgets.QLabel("Oversampling:"), 0, 0)
        self.oversampling = QtWidgets.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(QtWidgets.QLabel("Iterations:"), 1, 0)
        self.iterations = QtWidgets.QSpinBox()
        self.iterations.setRange(0, 1e7)
        self.iterations.setValue(10)
        grid.addWidget(self.iterations, 1, 1) 
开发者ID:jungmannlab,项目名称:picasso,代码行数:23,代码来源:average.py

示例6: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def __init__(self, window):
        super().__init__(window)
        self.window = window
        self.setWindowTitle("Parameters")
        self.setModal(False)
        grid = QtWidgets.QGridLayout(self)

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

        self.iterations = QtWidgets.QSpinBox()
        self.iterations.setRange(1, 1)
        self.iterations.setValue(1) 
开发者ID:jungmannlab,项目名称:picasso,代码行数:21,代码来源:average3.py

示例7: cell_pressed

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def cell_pressed(self, row, column, range=(0, 0), color="#000000"):

        for col in (0, 1):
            box = QtWidgets.QDoubleSpinBox(self.table)
            box.setSuffix(f" {self.unit}")
            box.setRange(-(10 ** 10), 10 ** 10)
            box.setDecimals(6)
            box.setValue(range[col])

            self.table.setCellWidget(row, col, box)

        button = QtWidgets.QPushButton("", self.table)
        button.setStyleSheet(f"background-color: {color};")
        self.table.setCellWidget(row, 2, button)
        button.clicked.connect(partial(self.select_color, button=button))

        button = QtWidgets.QPushButton("Delete", self.table)
        self.table.setCellWidget(row, 3, button)
        button.clicked.connect(partial(self.delete_row, row=row)) 
开发者ID:danielhrisca,项目名称:asammdf,代码行数:21,代码来源:range_editor.py

示例8: op1_constant_changed

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def op1_constant_changed(self, index):
        if self.op1_type.currentText() == "int":
            if self.op1_value is not None:
                self.op1_value.setParent(None)
                self.op1_value = None
            self.op1_value = QtWidgets.QSpinBox()
            self.op1_value.setRange(-2147483648, 2147483647)
            self.gridLayout.addWidget(self.op1_value, 0, 3)
        else:
            if self.op1_value is not None:
                self.op1_value.setParent(None)
                self.op1_value = None
            self.op1_value = QtWidgets.QDoubleSpinBox()
            self.op1_value.setDecimals(6)
            self.op1_value.setRange(-(2 ** 64), 2 ** 64 - 1)
            self.gridLayout.addWidget(self.op1_value, 0, 3) 
开发者ID:danielhrisca,项目名称:asammdf,代码行数:18,代码来源:define_channel.py

示例9: op2_constant_changed

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def op2_constant_changed(self, index):
        if self.op2_type.currentText() == "int":
            if self.op2_value is not None:
                self.op2_value.setParent(None)
                self.op2_value = None
            self.op2_value = QtWidgets.QSpinBox()
            self.op2_value.setRange(-2147483648, 2147483647)
            self.gridLayout.addWidget(self.op2_value, 2, 3)
        else:
            if self.op2_value is not None:
                self.op2_value.setParent(None)
                self.op2_value = None
            self.op2_value = QtWidgets.QDoubleSpinBox()
            self.op2_value.setDecimals(6)
            self.op2_value.setRange(-(2 ** 64), 2 ** 64 - 1)
            self.gridLayout.addWidget(self.op2_value, 2, 3) 
开发者ID:danielhrisca,项目名称:asammdf,代码行数:18,代码来源:define_channel.py

示例10: set_position_layout

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def set_position_layout(self):
        self.position_box = QtWidgets.QGroupBox("Position")
        load_pos = self.centre is not None and len(self.centre) == 3

        Layout = QtWidgets.QGridLayout()
        self.eeg_pos_selector = QtWidgets.QComboBox()
        self.eeg_pos_selector.activated.connect(self.select_eeg_pos)
        Layout.addWidget(self.eeg_pos_selector, 1,0)
        self.eeg_pos_selector.setEnabled(False)

        self.label_x = QtWidgets.QLabel("X:")
        Layout.addWidget(self.label_x,0,1)
        self.pos_x = QtWidgets.QDoubleSpinBox()
        self.pos_x.setRange(-1000,1000)
        if load_pos: self.pos_x.setValue(self.centre[0])
        #self.pos_x.valueChanged.connect(self.update_center)
        Layout.addWidget(self.pos_x,1,1)

        self.label_y = QtWidgets.QLabel("Y:")
        Layout.addWidget(self.label_y,0,2)
        self.pos_y = QtWidgets.QDoubleSpinBox()
        self.pos_y.setRange(-1000,1000)
        if load_pos: self.pos_y.setValue(self.centre[1])
       # self.pos_y.valueChanged.connect(self.update_center)
        Layout.addWidget(self.pos_y,1,2)

        self.label_z = QtWidgets.QLabel("Z:")
        Layout.addWidget(self.label_z,0,3)
        self.pos_z = QtWidgets.QDoubleSpinBox()
        self.pos_z.setRange(-1000,1000)
        if load_pos: self.pos_z.setValue(self.centre[2])
        #self.pos_z.valueChanged.connect(self.update_center)
        Layout.addWidget(self.pos_z,1,3)

        self.position_box.setLayout(Layout) 
开发者ID:simnibs,项目名称:simnibs,代码行数:37,代码来源:main_gui.py

示例11: set_direction_layout

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def set_direction_layout(self):
        box_text = "Direction Reference"
        self.direction_box = QtWidgets.QGroupBox(box_text)

        load_ref = self.reference is not None and len(self.reference) == 3

        Layout = QtWidgets.QGridLayout()

        self.check = QtWidgets.QCheckBox('Define Reference Coordinates')

        Layout.addWidget(self.check, 0,0,1,3)

        self.label_x2 = QtWidgets.QLabel("X:")
        Layout.addWidget(self.label_x2,1,1)
        self.ref_x = QtWidgets.QDoubleSpinBox()
        self.ref_x.setRange(-1000, 1000)
        if load_ref: self.ref_x.setValue(self.reference[0])
        #self.ref_x.valueChanged.connect(self.update_stimulator)
        Layout.addWidget(self.ref_x,2,1)

        self.label_y2 = QtWidgets.QLabel("Y:")
        Layout.addWidget(self.label_y2,1,2)
        self.ref_y = QtWidgets.QDoubleSpinBox()
        self.ref_y.setRange(-1000, 1000)
        if load_ref: self.ref_y.setValue(self.reference[1])
        #self.ref_y.valueChanged.connect(self.update_stimulator)
        Layout.addWidget(self.ref_y,2,2)

        self.label_z2 = QtWidgets.QLabel("Z:")
        Layout.addWidget(self.label_z2,1,3)
        self.ref_z = QtWidgets.QDoubleSpinBox()
        self.ref_z.setRange(-1000, 1000)
        if load_ref: self.ref_z.setValue(self.reference[2])
        #self.ref_z.valueChanged.connect(self.update_stimulator)
        Layout.addWidget(self.ref_z,2,3)

        self.direction_box.setLayout(Layout)

    #Returns the positions 
开发者ID:simnibs,项目名称:simnibs,代码行数:41,代码来源:main_gui.py

示例12: setInputValue

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def setInputValue(self, key, value):
        """
        Set the input value based on a string from the options
        """
        one_input = self.inputs.get(key)
        if one_input:
            if isinstance(one_input, QtWidgets.QDateTimeEdit):
                # Ugh, complicated conversion from UTCDateTime
                dt = QtCore.QDateTime.fromString(value, QtCore.Qt.ISODate)
                one_input.setDateTime(dt)
            elif isinstance(one_input, QtWidgets.QDoubleSpinBox):
                # Float value
                one_input.setValue(float(value))
            elif isinstance(one_input, QtWidgets.QComboBox):
                # Combo box
                index = one_input.findText(value)
                if index > -1:
                    one_input.setCurrentIndex(index)
            elif isinstance(one_input, QtWidgets.QLineEdit):
                # Text input
                one_input.setText(value)
            elif isinstance(one_input, QtWidgets.QAbstractButton):
                # Radio/checkbox button
                one_input.setChecked(strtobool(str(value)))
            else:
                raise Exception("Don't know how to set an input for %s (%s)" % (key, one_input)) 
开发者ID:iris-edu,项目名称:pyweed,代码行数:28,代码来源:OptionsWidget.py

示例13: stepsPref

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def stepsPref(workspace):

    workspace.sizeChangeText = QLabel("Steps font size: " + str(round(workspace.stepsFontSize, 1)) + "x")
    workspace.sizeChangeBox = QDoubleSpinBox()
    workspace.sizeChangeBox.setFixedSize(200, 30)
    workspace.sizeChangeBox.setRange(0.1, 10)
    workspace.sizeChangeBox.setValue(1)
    workspace.sizeChangeBox.setSingleStep(0.1)
    workspace.sizeChangeBox.setSuffix('x')
    workspace.sizeChangeBox.valueChanged.connect(lambda: sizeChange(workspace))
    return workspace.sizeChangeText, workspace.sizeChangeBox 
开发者ID:aerospaceresearch,项目名称:visma,代码行数:13,代码来源:steps.py

示例14: create_new_picker

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def create_new_picker(max_value, min_value, step, picker_value, value_changed_func):
        if isinstance(max_value, int):
            picker = QtWidgets.QSpinBox()
        else:
            picker = QtWidgets.QDoubleSpinBox()

        picker.setMaximum(max_value)
        picker.setMinimum(min_value)
        picker.setSingleStep(step)
        picker.setValue(picker_value)
        picker.valueChanged.connect(value_changed_func)
        return picker 
开发者ID:adamkwolf,项目名称:3d-nii-visualizer,代码行数:14,代码来源:MainWindow.py

示例15: setupUi

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDoubleSpinBox [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(580, 162)
        self.label = QtWidgets.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(16, 30, 81, 20))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label.setFont(font)
        self.label.setObjectName("label")
        self.lineEditBookPrice = QtWidgets.QLineEdit(Dialog)
        self.lineEditBookPrice.setGeometry(QtCore.QRect(120, 30, 113, 20))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.lineEditBookPrice.setFont(font)
        self.lineEditBookPrice.setObjectName("lineEditBookPrice")
        self.spinBoxBookQty = QtWidgets.QSpinBox(Dialog)
        self.spinBoxBookQty.setGeometry(QtCore.QRect(290, 30, 42, 22))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.spinBoxBookQty.setFont(font)
        self.spinBoxBookQty.setObjectName("spinBoxBookQty")
        self.lineEditBookAmount = QtWidgets.QLineEdit(Dialog)
        self.lineEditBookAmount.setGeometry(QtCore.QRect(390, 30, 113, 20))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.lineEditBookAmount.setFont(font)
        self.lineEditBookAmount.setObjectName("lineEditBookAmount")
        self.label_2 = QtWidgets.QLabel(Dialog)
        self.label_2.setGeometry(QtCore.QRect(10, 70, 81, 21))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_2.setFont(font)
        self.label_2.setObjectName("label_2")
        self.lineEditSugarPrice = QtWidgets.QLineEdit(Dialog)
        self.lineEditSugarPrice.setGeometry(QtCore.QRect(120, 70, 113, 20))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.lineEditSugarPrice.setFont(font)
        self.lineEditSugarPrice.setObjectName("lineEditSugarPrice")
        self.doubleSpinBoxSugarWeight = QtWidgets.QDoubleSpinBox(Dialog)
        self.doubleSpinBoxSugarWeight.setGeometry(QtCore.QRect(290, 70, 62, 22))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.doubleSpinBoxSugarWeight.setFont(font)
        self.doubleSpinBoxSugarWeight.setObjectName("doubleSpinBoxSugarWeight")
        self.lineEditSugarAmount = QtWidgets.QLineEdit(Dialog)
        self.lineEditSugarAmount.setGeometry(QtCore.QRect(390, 70, 113, 20))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.lineEditSugarAmount.setFont(font)
        self.lineEditSugarAmount.setObjectName("lineEditSugarAmount")
        self.labelTotalAmount = QtWidgets.QLabel(Dialog)
        self.labelTotalAmount.setGeometry(QtCore.QRect(396, 120, 121, 20))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.labelTotalAmount.setFont(font)
        self.labelTotalAmount.setObjectName("labelTotalAmount")

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
开发者ID:PacktPublishing,项目名称:Qt5-Python-GUI-Programming-Cookbook,代码行数:62,代码来源:demoSpinBox.py


注:本文中的PyQt5.QtWidgets.QDoubleSpinBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。