class MyDelegate(QtGui.QStyledItemDelegate):
def __init__(self, parent=None, *args):
QtGui.QStyledItemDelegate.__init__(self, parent, *args)
def createEditor(self,parent,option,index):
print "CREATE EDITOR"
editor = QtGui.QCheckBox(parent)
return editor
I’m doing some testing with using QItemDelegate and QStyledItemDelegate.
I’m using this delegate in QListView and exploring possibilities of adding controls to my QListView items.
But this function doesn’t even get called… while paint method does and that works well. I should mention that I use custom model for view.
I plan to do something bigger with controls, checkbox is only an example.
Any ideas?