33 from python_qt_binding.QtCore
import QModelIndex
34 from python_qt_binding.QtWidgets
import QDoubleSpinBox, QItemDelegate
39 def __init__(self, min_value=0, max_value=100, decimals=2, *args):
43 super(SpinBoxDelegate, self).
__init__(*args)
46 editor = QDoubleSpinBox(parent)
48 editor.setMaximum(self.
_min)
49 editor.setMaximum(self.
_max)
56 Find out the hierarchy level of the selected item. 57 see: http://stackoverflow.com/a/4208240/577001 59 :type model_index: QModelIndex 67 seek_root = model_index
68 while(seek_root.parent() != QModelIndex()):
69 seek_root = seek_root.parent()
def _get_hierarchy_level(model_index)
def __init__(self, min_value=0, max_value=100, decimals=2, args)
def createEditor(self, parent, option, index)