Go to the documentation of this file.00001 from IntegerSpinBoxDelegate import IntegerSpinBoxDelegate
00002
00003 import python_qt_binding.QtBindingHelper
00004 from QtCore import Qt
00005 from QtGui import QDoubleSpinBox
00006
00007 class DoubleSpinBoxDelegate(IntegerSpinBoxDelegate):
00008
00009 def __init__(self, parent = None):
00010 super(DoubleSpinBoxDelegate, self).__init__(parent)
00011 self._decimals = None
00012
00013 def setDecimals(self, decimals):
00014 self._decimals = decimals
00015
00016 def createEditor(self, parent, option, index):
00017 editor = super(DoubleSpinBoxDelegate, self).createEditor(parent, option, index)
00018 if self._decimals is not None:
00019 editor.setDecimals(self._decimals)
00020 return editor
00021
00022 def _create_editor(self, parent):
00023 return QDoubleSpinBox(parent)