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


Python QtWidgets.QSpinBox方法代码示例

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


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

示例1: __init__

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

        self.updating_gui_bool = False

        self.toggle_switch = ToggleSwitchWt()
        self.both_qrb = RadioButtonLeft(self.tr("Visual + Audio"))
        self.visual_qrb = RadioButtonMiddle(self.tr("Visual"))
        self.audio_qrb = RadioButtonRight(self.tr("Audio"))
        self.notification_interval_qsb = QtWidgets.QSpinBox()
        self.notif_select_audio_qpb = QtWidgets.QPushButton(self.tr("Select audio"))
        self.notif_volume_qsr = QtWidgets.QSlider()

        self.phrases_qlw = RestActionListWt()

        self._init_ui()
        self._connect_slots_to_signals() 
开发者ID:mindfulness-at-the-computer,项目名称:mindfulness-at-the-computer,代码行数:19,代码来源:rest_settings_wt.py

示例2: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSpinBox [as 别名]
def __init__(self, dataitem, parent=None):
        super(otherPanel, self).__init__(parent)
        self.setFrameStyle(widgets.QFrame.Sunken)
        self.setFrameShape(widgets.QFrame.Box)
        self.data = dataitem

        layout = widgets.QGridLayout()
        labelnob = widgets.QLabel(_("Number of bytes"))
        lableunit = widgets.QLabel(_("Unit"))

        layout.addWidget(labelnob, 0, 0)
        layout.addWidget(lableunit, 1, 0)
        layout.setRowStretch(2, 1)

        self.inputnob = widgets.QSpinBox()
        self.inputnob.setRange(1, 10240)
        self.inputtype = widgets.QComboBox()
        self.inputtype.addItem("ASCII")
        self.inputtype.addItem("BCD/HEX")

        layout.addWidget(self.inputnob, 0, 1)
        layout.addWidget(self.inputtype, 1, 1)

        self.setLayout(layout)
        self.init() 
开发者ID:cedricp,项目名称:ddt4all,代码行数:27,代码来源:dataeditor.py

示例3: accept

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSpinBox [as 别名]
def accept(self):
        """Saves state on inputs; rough opposite of show()."""

        for list_view in self.findChildren(QtWidgets.QListView):
            for editor in list_view.findChildren(QtWidgets.QWidget, 'editor'):
                list_view.commitData(editor)  # if an editor is open, save it

        self._addon.config.update({
            widget.objectName(): (
                widget.isChecked() if isinstance(widget, Checkbox)
                else widget.atts_value if isinstance(widget, QtWidgets.QPushButton)
                else widget.value() if isinstance(widget, QtWidgets.QSpinBox)
                else widget.itemData(widget.currentIndex()) if isinstance(
                    widget, QtWidgets.QComboBox)
                else [
                    i for i in widget.model().raw_data
                    if i['compiled'] and 'bad_replace' not in i
                ] if isinstance(widget, QtWidgets.QListView)
                else widget.text()
            )
            for widget in self.findChildren(self._PROPERTY_WIDGETS)
            if widget.objectName() in self._PROPERTY_KEYS
        })

        super(Configurator, self).accept() 
开发者ID:AwesomeTTS,项目名称:awesometts-anki-addon,代码行数:27,代码来源:configurator.py

示例4: __init__

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

        self.setVisible(False)

        layout = QtWidgets.QHBoxLayout(self)
        layout.setSpacing(0)
        layout.setContentsMargins(0,0,0,0)

        spinbox1 = QtWidgets.QSpinBox()
        spinbox1.setFixedSize(32, 24)
        spinbox1.valueChanged.connect(self.startValChanged)
        layout.addWidget(spinbox1)

        spinbox2 = QtWidgets.QSpinBox()
        spinbox2.setFixedSize(32, 24)
        spinbox2.valueChanged.connect(self.endValChanged)
        layout.addWidget(spinbox2)

        self.spinboxes = (spinbox1, spinbox2)
        self.updating = False

        self.setFixedWidth(64) 
开发者ID:aboood40091,项目名称:Miyamoto,代码行数:25,代码来源:puzzle.py

示例5: __init__

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

        self.label = QtWidgets.QLabel('-')
        self.label.setWordWrap(True)

        if type == InputBox.Type_TextBox:
            self.textbox = QtWidgets.QLineEdit()
            widget = self.textbox
        elif type == InputBox.Type_SpinBox:
            self.spinbox = QtWidgets.QSpinBox()
            widget = self.spinbox
        elif type == InputBox.Type_HexSpinBox:
            self.spinbox = HexSpinBox()
            widget = self.spinbox

        self.buttons = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel)
        self.buttons.accepted.connect(self.accept)
        self.buttons.rejected.connect(self.reject)

        self.layout = QtWidgets.QVBoxLayout()
        self.layout.addWidget(self.label)
        self.layout.addWidget(widget)
        self.layout.addWidget(self.buttons)
        self.setLayout(self.layout) 
开发者ID:aboood40091,项目名称:Miyamoto,代码行数:27,代码来源:dialogs.py

示例6: saveFilterValue

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSpinBox [as 别名]
def saveFilterValue( self, obj ):
        assert( isinstance( obj.caller, QSpinBox ) or isinstance( obj.caller, QCheckBox ) or isinstance( obj.caller, QLineEdit ) )

        if isinstance( obj.caller, QSpinBox ):
            newVal = obj.caller.value()
        elif isinstance( obj.caller, QCheckBox ):
            newVal = obj.caller.isChecked()
        elif isinstance( obj.caller, QLineEdit ):
            if self.check_state( obj.caller ) != True:
                return
            newVal = [ int( t ) for t in obj.caller.text().split( "," ) ]

        try:
            func = getattr( obj.called, obj.action )
        except AttributeError:
            print( "Whoops, for some reason the callback isn't valid." )
        else:
            result = func( newVal )

        # reset the frame rate
        self._frameRate_RunningAvg = -1 
开发者ID:jchrisweaver,项目名称:vidpipe,代码行数:23,代码来源:main.py

示例7: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSpinBox [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

示例8: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSpinBox [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

示例9: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSpinBox [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

示例10: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSpinBox [as 别名]
def __init__(self, title=None, parent=None):
        super(CropBoxWidget, self).__init__(parent)
        self.value = [0]*4
        layout = QtWidgets.QGridLayout(self)
        if isinstance(title, str):
            layout.addWidget(QtWidgets.QLabel(title), 0, 0)
        self.crop1 = QtWidgets.QSpinBox()
        self.crop2 = QtWidgets.QSpinBox()
        self.crop3 = QtWidgets.QSpinBox()
        self.crop4 = QtWidgets.QSpinBox()
        cropbox = QtWidgets.QGridLayout()
        cropbox.addWidget(QtWidgets.QLabel("range start"), 0, 0)
        cropbox.addWidget(self.crop1, 1, 0)
        cropbox.addWidget(QtWidgets.QLabel("range end"), 2, 0)
        cropbox.addWidget(self.crop2, 3, 0)
        cropbox.addWidget(QtWidgets.QLabel("azimuth start"), 0, 1)
        cropbox.addWidget(self.crop3, 1, 1)
        cropbox.addWidget(QtWidgets.QLabel("azimuth end"), 2, 1)
        cropbox.addWidget(self.crop4, 3, 1)
        layout.addLayout(cropbox, 1, 0)
        self.minmaxMemory = []
        self.setrange([[0, 9999999], [0, 9999999], [0, 9999999], [0, 9999999]])
        self.setContentsMargins(0, 0, 0, 0)
        self.layout().setContentsMargins(0, 0, 0, 0) 
开发者ID:birgander2,项目名称:PyRAT,代码行数:26,代码来源:Widgets.py

示例11: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSpinBox [as 别名]
def __init__(self, settings, parent=None):
        super(SettingsPop, self).__init__(parent)
        self.main_layout = QtWidgets.QVBoxLayout()

        self.fps_layout = QtWidgets.QHBoxLayout()
        self.fps_label = QtWidgets.QLabel()
        self.fps_spin = QtWidgets.QSpinBox()

        self.step_layout = QtWidgets.QHBoxLayout()
        self.step_label = QtWidgets.QLabel()
        self.step_combo = QtWidgets.QComboBox()

        self.color_map_layout = QtWidgets.QHBoxLayout()
        self.color_map = QtWidgets.QPushButton()
        self.color_map_label = QtWidgets.QLabel()

        self.settings = settings

        self.save_button = QtWidgets.QPushButton()
        self.license_button = QtWidgets.QPushButton() 
开发者ID:python-discord,项目名称:code-jam-5,代码行数:22,代码来源:gui.py

示例12: op1_constant_changed

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSpinBox [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

示例13: op2_constant_changed

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSpinBox [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

示例14: __init__

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

        self.updating_gui_bool = False

        self.overview_qlw = TimingOverviewWt()
        self.grid = QtWidgets.QGridLayout()
        self.notification_interval_qsp = QtWidgets.QSpinBox()
        self.show_after_qsb = QtWidgets.QSpinBox()
        self.rest_interval_qsp = QtWidgets.QSpinBox()

        self._init_ui()
        self.update_gui()
        self._connect_slots_to_signals() 
开发者ID:mindfulness-at-the-computer,项目名称:mindfulness-at-the-computer,代码行数:16,代码来源:intro_dlg.py

示例15: add_item

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSpinBox [as 别名]
def add_item(self):
        value = -999
        self.itemtable.setRowCount(self.itemtable.rowCount() + 1)
        newrow = self.itemtable.rowCount() - 1
        spinvalue = widgets.QSpinBox()
        spinvalue.setRange(-1000000, 1000000)
        spinvalue.setValue(value)
        self.itemtable.setCellWidget(newrow, 0, spinvalue)
        self.itemtable.setItem(newrow, 1, widgets.QTableWidgetItem(_("New item")))
        self.itemtable.setItem(newrow, 0, widgets.QTableWidgetItem(str(value).zfill(5)))
        self.itemtable.resizeRowsToContents()
        self.itemtable.resizeColumnsToContents() 
开发者ID:cedricp,项目名称:ddt4all,代码行数:14,代码来源:dataeditor.py


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