本文整理汇总了Python中PySide.QtGui.QSpinBox.setToolTip方法的典型用法代码示例。如果您正苦于以下问题:Python QSpinBox.setToolTip方法的具体用法?Python QSpinBox.setToolTip怎么用?Python QSpinBox.setToolTip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QSpinBox
的用法示例。
在下文中一共展示了QSpinBox.setToolTip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_spinbox
# 需要导入模块: from PySide.QtGui import QSpinBox [as 别名]
# 或者: from PySide.QtGui.QSpinBox import setToolTip [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: DoFPCompound
# 需要导入模块: from PySide.QtGui import QSpinBox [as 别名]
# 或者: from PySide.QtGui.QSpinBox import setToolTip [as 别名]
class DoFPCompound(QGroupBox):
def __init__(self, parent=None):
super(DoFPCompound, self).__init__(parent)
self.setTitle("doFP")
self.button_execute = QPushButton("Execute ...")
self.spinbox_iterations = QSpinBox()
self.spinbox_iterations.setMaximum(9999)
self.spinbox_iterations.setValue(200)
self.spinbox_iterations.setToolTip("No. iterations")
layout = QHBoxLayout()
layout.addWidget(self.spinbox_iterations)
layout.addWidget(self.button_execute)
self.setLayout(layout)