本文整理匯總了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()
示例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()
示例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()
示例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)
示例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)
示例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
示例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"))
示例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)
示例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)
示例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)
示例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()
示例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)
示例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)
示例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()
示例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()