本文整理汇总了Python中PySide.QtGui.QSpinBox.setSingleStep方法的典型用法代码示例。如果您正苦于以下问题:Python QSpinBox.setSingleStep方法的具体用法?Python QSpinBox.setSingleStep怎么用?Python QSpinBox.setSingleStep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QSpinBox
的用法示例。
在下文中一共展示了QSpinBox.setSingleStep方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_spinbox
# 需要导入模块: from PySide.QtGui import QSpinBox [as 别名]
# 或者: from PySide.QtGui.QSpinBox import setSingleStep [as 别名]
def create_spinbox(self, prefix, suffix, option, default=NoDefault,
min_=None, max_=None, step=None, tip=None):
if prefix:
plabel = QLabel(prefix)
else:
plabel = None
if suffix:
slabel = QLabel(suffix)
else:
slabel = None
spinbox = QSpinBox()
if min_ is not None:
spinbox.setMinimum(min_)
if max_ is not None:
spinbox.setMaximum(max_)
if step is not None:
spinbox.setSingleStep(step)
if tip is not None:
spinbox.setToolTip(tip)
self.spinboxes[option] = spinbox
layout = QHBoxLayout()
for subwidget in (plabel, spinbox, slabel):
if subwidget is not None:
layout.addWidget(subwidget)
layout.addStretch(1)
layout.setContentsMargins(0, 0, 0, 0)
widget = QWidget(self)
widget.setLayout(layout)
return widget
示例2: EditorWindow
# 需要导入模块: from PySide.QtGui import QSpinBox [as 别名]
# 或者: from PySide.QtGui.QSpinBox import setSingleStep [as 别名]
#.........这里部分代码省略.........
msg = e.error_log.last_error.message
line = e.error_log.last_error.line
col = e.error_log.last_error.column
self.statusBar().showMessage("Invalid XML: Line %s, Col %s: %s"%(line,col,msg))
except:
self.statusBar().showMessage("Invalid XML: Unknown error")
'''
close and cleanup tixi
'''
def __del__(self):
pass
#self.tixi.close()
#self.tixi.cleanup()
'''
set and connect the search buttons
'''
def setupButtonMenu(self):
self.button1 = QPushButton("previous" )
self.button2 = QPushButton("next" )
self.label1 = QLabel("font")
self.fontsizeSpinBox = QSpinBox()
self.button1.hide()
self.button2.hide()
self.label1.hide()
self.fontsizeSpinBox.hide()
self.button1.clicked.connect(self.fire_search_backward)
self.button2.clicked.connect(self.fire_search_foreward)
self.fontsizeSpinBox.setRange(4, 30)
self.fontsizeSpinBox.setSingleStep(1)
self.fontsizeSpinBox.setSuffix('pt')
self.fontsizeSpinBox.setValue(10)
self.fontsizeSpinBox.valueChanged.connect(self.setfontsize)
def setfontsize(self, value):
self.font.setPointSize(value)
self.editor.setFont(self.font)
def setupEditor(self):
self.font = QFont()
self.font.setFamily('Courier')
self.font.setFixedPitch(True)
self.font.setPointSize(10)
self.editor = EditorCodeCompletion(Config().path_code_completion_dict)
self.editor.setFont(self.font)
self.editor.setTabStopWidth(20)
self.editor.setAcceptRichText(False)
self.editor.setLineWrapMode(QTextEdit.NoWrap)
self.editor.textChanged.connect(self.validate)
self.highlighter = Highlighter(self.editor.document())
def setupNumbar(self):
self.number_bar = NumberBar()
self.number_bar.setTextEdit(self.getStates())
self.editor.cursorPositionChanged.connect(self.fireUpdateNumbar)
self.connect(self.editor.verticalScrollBar(), SIGNAL("valueChanged(int)"), self.fireUpdateNumbar)
#self.editor.verticalScrollBar.valueChanged.connect(self.fireUpdateNumbar)
def setupStatusbar(self):
self.lineNumber = -1
示例3: QLabel
# 需要导入模块: from PySide.QtGui import QSpinBox [as 别名]
# 或者: from PySide.QtGui.QSpinBox import setSingleStep [as 别名]
logo_style_label = QLabel("Logo style:")
layout.addWidget(logo_style_label, 1, 2)
logo_style_combo_box = QComboBox()
logo_style_combo_box.addItem("Steady")
logo_style_combo_box.addItem("Slow breath")
logo_style_combo_box.addItem("Middle breath")
logo_style_combo_box.addItem("Fast breath")
layout.addWidget(logo_style_combo_box, 1, 3)
# cpi1
cpi_one_label = QLabel("CPI1 (800):")
layout.addWidget(cpi_one_label, 2, 0)
cpi_one_spin_box = QSpinBox()
cpi_one_spin_box.setRange(50, 6500)
cpi_one_spin_box.setValue(800)
cpi_one_spin_box.setSingleStep(50)
layout.addWidget(cpi_one_spin_box, 2, 1)
# cpi2
cpi_two_label = QLabel("CPI2 (1600):")
layout.addWidget(cpi_two_label, 2, 2)
cpi_two_spin_box = QSpinBox()
cpi_two_spin_box.setRange(50, 6500)
cpi_two_spin_box.setValue(1600)
cpi_two_spin_box.setSingleStep(50)
layout.addWidget(cpi_two_spin_box, 2, 3)
# polling_rate
polling_rate_label = QLabel("Polling rate (1000):")
layout.addWidget(polling_rate_label, 3, 0)
polling_rate_combo_box = QComboBox()