本文整理汇总了Python中PyQt4.QtGui.QDoubleSpinBox.setAlignment方法的典型用法代码示例。如果您正苦于以下问题:Python QDoubleSpinBox.setAlignment方法的具体用法?Python QDoubleSpinBox.setAlignment怎么用?Python QDoubleSpinBox.setAlignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QDoubleSpinBox
的用法示例。
在下文中一共展示了QDoubleSpinBox.setAlignment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createEditor
# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setAlignment [as 别名]
def createEditor( self, parent, option, index ):
if index.column() == DESCRIPCION:
combo = QComboBox( parent )
combo.setEditable( True )
value = index.data().toString()
self.filtrados.append( value )
self.proxymodel.setFilterRegExp( self.filter() )
combo.setModel( self.proxymodel )
combo.setModelColumn( 1 )
combo.setCompleter( self.completer )
return combo
elif index.column() == BANCO:
combo = QComboBox( parent )
#combo.setEditable(True)
combo.setModel( self.bancosmodel )
combo.setModelColumn( 1 )
#combo.setCompleter(self.completer)
return combo
elif index.column() == MONTO:
doublespinbox = QDoubleSpinBox( parent )
doublespinbox.setMinimum( -1000000 )
doublespinbox.setMaximum( 1000000 )
doublespinbox.setDecimals( 4 )
doublespinbox.setAlignment( Qt.AlignHCenter )
return doublespinbox
elif index.column() == REFERENCIA:
textbox = QStyledItemDelegate.createEditor( self, parent, option, index )
textbox.setAlignment( Qt.AlignHCenter )
return textbox
示例2: createEditor
# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setAlignment [as 别名]
def createEditor( self, parent, _option, index ):
if index.column() == ABONO:
spinbox = QDoubleSpinBox( parent )
max = index.model().lines[index.row()].totalFac
spinbox.setRange( 0.0001, max )
spinbox.setDecimals( 4 )
spinbox.setSingleStep( 1 )
spinbox.setAlignment( Qt.AlignRight | Qt.AlignVCenter )
return spinbox
else:
None