本文整理汇总了Python中PyQt4.QtGui.QDoubleSpinBox.setObjectName方法的典型用法代码示例。如果您正苦于以下问题:Python QDoubleSpinBox.setObjectName方法的具体用法?Python QDoubleSpinBox.setObjectName怎么用?Python QDoubleSpinBox.setObjectName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QDoubleSpinBox
的用法示例。
在下文中一共展示了QDoubleSpinBox.setObjectName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createEditor
# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setObjectName [as 别名]
def createEditor(self, parent, option, index):
"""
Creates the combobox inside a parent.
:param parent: The container of the combobox
:type parent: QWidget
:param option: QStyleOptionViewItem class is used to describe the
parameters used to draw an item in a view widget.
:type option: Object
:param index: The index where the combobox
will be added.
:type index: QModelIndex
:return: The combobox
:rtype: QComboBox
"""
if index.column() == 0:
str_combo = QComboBox(parent)
str_combo.setObjectName(unicode(index.row()))
return str_combo
elif index.column() == 1:
spinbox = QDoubleSpinBox(parent)
spinbox.setObjectName(unicode(index.row()))
spinbox.setMinimum(0.00)
spinbox.setSuffix('%')
spinbox.setMaximum(100.00)
return spinbox
示例2: create_double_spinbox
# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setObjectName [as 别名]
def create_double_spinbox(self, parent, index):
"""
Creates double spinbox.
:param parent: The parent widget.
:type parent: QWidget
:param index: The index.
:type index: QModelIndex
:return: The double spinbox
:rtype: QDoubleSpinBox
"""
spinbox = QDoubleSpinBox(parent)
spinbox.setObjectName(unicode(index.row()))
return spinbox
示例3: spinBoxFromHabName
# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setObjectName [as 别名]
def spinBoxFromHabName(self,habname):
"""
If the spin box exists, return it. If not make it and return it.
"""
#print "looking for habname: %s" % habname
sbname = slugify( unicode(habname) ) + u"SpinBox"
htw = self.habitatTableWidget
try:
sb = htw.findChild(QDoubleSpinBox,sbname)
assert( sb!=None )
return sb
except AssertionError:
#print "making SB: %s" % sbname
newsb = QDoubleSpinBox(self.habitatTableWidget)
newsb.setMaximum(1.0)
newsb.setSingleStep(0.1)
newsb.setObjectName(_fromUtf8(sbname))
return newsb