本文整理汇总了Python中PySide2.QtWidgets.QSpinBox方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QSpinBox方法的具体用法?Python QtWidgets.QSpinBox怎么用?Python QtWidgets.QSpinBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide2.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QSpinBox方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: itemAeropython
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpinBox [as 别名]
def itemAeropython(self):
form = QtWidgets.QFormLayout()
label1 = QtWidgets.QLabel(u'Angle of attack (°)')
self.aoa = QtWidgets.QDoubleSpinBox()
self.aoa.setSingleStep(0.1)
self.aoa.setDecimals(1)
self.aoa.setRange(-10.0, 10.0)
self.aoa.setValue(0.0)
form.addRow(label1, self.aoa)
label2 = QtWidgets.QLabel('Freestream velocity (m/s)')
self.freestream = QtWidgets.QDoubleSpinBox()
self.freestream.setSingleStep(0.1)
self.freestream.setDecimals(2)
self.freestream.setRange(0.0, 100.0)
self.freestream.setValue(10.0)
form.addRow(label2, self.freestream)
label3 = QtWidgets.QLabel('Number of panels (-)')
self.panels = QtWidgets.QSpinBox()
self.panels.setRange(10, 500)
self.panels.setValue(40)
form.addRow(label3, self.panels)
panelMethodButton = QtWidgets.QPushButton('Calculate lift coefficient')
form.addRow(panelMethodButton)
self.item_ap = QtWidgets.QGroupBox('AeroPython Panel Method')
self.item_ap.setLayout(form)
panelMethodButton.clicked.connect(self.runPanelMethod)
示例2: addAbsoluteFrameFromSpinbox
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpinBox [as 别名]
def addAbsoluteFrameFromSpinbox(self):
frame = self.sender().parent().findChild(QtWidgets.QSpinBox, 'absolute_add_spinBox').value()
self.addAbsoluteFrame(frame = frame)
#
示例3: eventFilter
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpinBox [as 别名]
def eventFilter(self, obj: QSpinBox, event: QEvent) -> bool:
if event.type() == QEvent.Wheel and isinstance(obj, QSpinBox):
if obj.focusPolicy() == Qt.WheelFocus:
event.accept()
return False
else:
event.ignore()
return True
return super().eventFilter(obj, event)
示例4: setupUi
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpinBox [as 别名]
def setupUi(self, BlockchainDock):
BlockchainDock.setObjectName("BlockchainDock")
BlockchainDock.resize(416, 167)
BlockchainDock.setFloating(False)
BlockchainDock.setFeatures(QtWidgets.QDockWidget.AllDockWidgetFeatures)
self.dockWidgetContents = QtWidgets.QWidget()
self.dockWidgetContents.setObjectName("dockWidgetContents")
self.formLayout = QtWidgets.QFormLayout(self.dockWidgetContents)
self.formLayout.setObjectName("formLayout")
self.generate = QtWidgets.QPushButton(self.dockWidgetContents)
self.generate.setObjectName("generate")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.generate)
self.blocks = QtWidgets.QSpinBox(self.dockWidgetContents)
self.blocks.setMinimum(1)
self.blocks.setMaximum(9999)
self.blocks.setProperty("value", 1)
self.blocks.setObjectName("blocks")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.blocks)
self.transfer = QtWidgets.QPushButton(self.dockWidgetContents)
self.transfer.setObjectName("transfer")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.transfer)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.amount = QtWidgets.QDoubleSpinBox(self.dockWidgetContents)
self.amount.setSuffix("")
self.amount.setMaximum(9999.99)
self.amount.setProperty("value", 10.0)
self.amount.setObjectName("amount")
self.horizontalLayout.addWidget(self.amount)
self.to_label = QtWidgets.QLabel(self.dockWidgetContents)
self.to_label.setObjectName("to_label")
self.horizontalLayout.addWidget(self.to_label)
self.address = QtWidgets.QLineEdit(self.dockWidgetContents)
self.address.setObjectName("address")
self.horizontalLayout.addWidget(self.address)
self.formLayout.setLayout(1, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout)
self.invalidate = QtWidgets.QPushButton(self.dockWidgetContents)
self.invalidate.setObjectName("invalidate")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.invalidate)
self.block_hash = QtWidgets.QLineEdit(self.dockWidgetContents)
self.block_hash.setObjectName("block_hash")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.block_hash)
BlockchainDock.setWidget(self.dockWidgetContents)
self.retranslateUi(BlockchainDock)
QtCore.QMetaObject.connectSlotsByName(BlockchainDock)
示例5: setupUi
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpinBox [as 别名]
def setupUi(self, onionSkinRendererPreferences):
onionSkinRendererPreferences.setObjectName("onionSkinRendererPreferences")
onionSkinRendererPreferences.resize(279, 157)
self.verticalLayout = QtWidgets.QVBoxLayout(onionSkinRendererPreferences)
self.verticalLayout.setObjectName("verticalLayout")
self.prefs_maxBuffer_layout = QtWidgets.QHBoxLayout()
self.prefs_maxBuffer_layout.setObjectName("prefs_maxBuffer_layout")
self.maxBuffer_label = QtWidgets.QLabel(onionSkinRendererPreferences)
self.maxBuffer_label.setObjectName("maxBuffer_label")
self.prefs_maxBuffer_layout.addWidget(self.maxBuffer_label)
self.maxBuffer_spinBox = QtWidgets.QSpinBox(onionSkinRendererPreferences)
self.maxBuffer_spinBox.setMinimum(1)
self.maxBuffer_spinBox.setMaximum(10000)
self.maxBuffer_spinBox.setProperty("value", 200)
self.maxBuffer_spinBox.setObjectName("maxBuffer_spinBox")
self.prefs_maxBuffer_layout.addWidget(self.maxBuffer_spinBox)
self.verticalLayout.addLayout(self.prefs_maxBuffer_layout)
self.prefs_relativeKeyCount_layout = QtWidgets.QHBoxLayout()
self.prefs_relativeKeyCount_layout.setObjectName("prefs_relativeKeyCount_layout")
self.relativeKeyCount_label = QtWidgets.QLabel(onionSkinRendererPreferences)
self.relativeKeyCount_label.setObjectName("relativeKeyCount_label")
self.prefs_relativeKeyCount_layout.addWidget(self.relativeKeyCount_label)
self.relativeKeyCount_spinBox = QtWidgets.QSpinBox(onionSkinRendererPreferences)
self.relativeKeyCount_spinBox.setMinimum(1)
self.relativeKeyCount_spinBox.setMaximum(10)
self.relativeKeyCount_spinBox.setProperty("value", 4)
self.relativeKeyCount_spinBox.setObjectName("relativeKeyCount_spinBox")
self.prefs_relativeKeyCount_layout.addWidget(self.relativeKeyCount_spinBox)
self.verticalLayout.addLayout(self.prefs_relativeKeyCount_layout)
self.prefs_outlineWidth = QtWidgets.QHBoxLayout()
self.prefs_outlineWidth.setObjectName("prefs_outlineWidth")
self.outlineWidth_label = QtWidgets.QLabel(onionSkinRendererPreferences)
self.outlineWidth_label.setObjectName("outlineWidth_label")
self.prefs_outlineWidth.addWidget(self.outlineWidth_label)
self.outlineWidth_spinBox = QtWidgets.QSpinBox(onionSkinRendererPreferences)
self.outlineWidth_spinBox.setMinimum(1)
self.outlineWidth_spinBox.setMaximum(512)
self.outlineWidth_spinBox.setProperty("value", 3)
self.outlineWidth_spinBox.setObjectName("outlineWidth_spinBox")
self.prefs_outlineWidth.addWidget(self.outlineWidth_spinBox)
self.verticalLayout.addLayout(self.prefs_outlineWidth)
self.prefs_tintSeed = QtWidgets.QHBoxLayout()
self.prefs_tintSeed.setObjectName("prefs_tintSeed")
self.tintSeed_label = QtWidgets.QLabel(onionSkinRendererPreferences)
self.tintSeed_label.setObjectName("tintSeed_label")
self.prefs_tintSeed.addWidget(self.tintSeed_label)
self.tintSeed_spinBox = QtWidgets.QSpinBox(onionSkinRendererPreferences)
self.tintSeed_spinBox.setObjectName("tintSeed_spinBox")
self.prefs_tintSeed.addWidget(self.tintSeed_spinBox)
self.verticalLayout.addLayout(self.prefs_tintSeed)
self.prefs_dialogButtonBox = QtWidgets.QDialogButtonBox(onionSkinRendererPreferences)
self.prefs_dialogButtonBox.setOrientation(QtCore.Qt.Horizontal)
self.prefs_dialogButtonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.prefs_dialogButtonBox.setObjectName("prefs_dialogButtonBox")
self.verticalLayout.addWidget(self.prefs_dialogButtonBox)
self.retranslateUi(onionSkinRendererPreferences)
QtCore.QObject.connect(self.prefs_dialogButtonBox, QtCore.SIGNAL("accepted()"), onionSkinRendererPreferences.accept)
QtCore.QObject.connect(self.prefs_dialogButtonBox, QtCore.SIGNAL("rejected()"), onionSkinRendererPreferences.reject)
QtCore.QMetaObject.connectSlotsByName(onionSkinRendererPreferences)
示例6: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpinBox [as 别名]
def __init__(self):
super(NewProfilesStructureDialogue, self).__init__()
self.setObjectName("self")
# self.resize(200, 71)
# self.setMinimumSize(QtCore.QSize(200, 71))
# self.setMaximumSize(QtCore.QSize(200, 71))
self.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
# icon = QtGui.QIcon()
# icon.addPixmap(QtGui.QPixmap("Icons/Plus-32.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
# self.setWindowIcon(icon)
self.layout = QtWidgets.QVBoxLayout(self)
# calendar
self.calendar = QtWidgets.QDateTimeEdit()
d = datetime.today()
self.calendar.setDateTime(QtCore.QDateTime(d.year, 1, 1, 00, 00, 00))
# number of time steps
self.steps_spinner = QtWidgets.QSpinBox()
self.steps_spinner.setMinimum(1)
self.steps_spinner.setMaximum(9999999)
self.steps_spinner.setValue(1)
# time step length
self.step_length = QtWidgets.QDoubleSpinBox()
self.step_length.setMinimum(1)
self.step_length.setMaximum(60)
self.step_length.setValue(1)
# units combo box
self.units = QtWidgets.QComboBox()
self.units.setModel(get_list_model(['h', 'm', 's']))
# accept button
self.accept_btn = QtWidgets.QPushButton()
self.accept_btn.setText('Accept')
self.accept_btn.clicked.connect(self.accept_click)
# labels
# add all to the GUI
self.layout.addWidget(QtWidgets.QLabel("Start date"))
self.layout.addWidget(self.calendar)
self.layout.addWidget(QtWidgets.QLabel("Number of time steps"))
self.layout.addWidget(self.steps_spinner)
self.layout.addWidget(QtWidgets.QLabel("Time step length"))
self.layout.addWidget(self.step_length)
self.layout.addWidget(QtWidgets.QLabel("Time units"))
self.layout.addWidget(self.units)
self.layout.addWidget(self.accept_btn)
self.setLayout(self.layout)
self.setWindowTitle('New profiles structure')