I have a 2 column QTableView where column 0 is checkable
and column 1 is editable. I've written a custom editor by implement
QItemDelegate which is working fine. Also, the checkbox in column 0 is
also working fine. But, unfortunately, not both at the same time.
<br><br>If I use view.<span style="font-weight: bold;">setItemDelegate</span>(myDelegate)
than my delegate is called to create my custom editor and everything
about column 1 works correctly. But column 0 doesn't work correctly.
It is displaying a checkbox with the correct current value but clicking
on it does not call my model's setData() method or do anything at all
as far as I can tell.
<br><br>If I use view.<span style="font-weight: bold;">setItemDelegateForColumn</span>(1,
myDelegate) than the checkbox in colum 0 works but double-clicking on
column 1 will ignore my delegate and create a default editor.
<br><br>Is this a known bug in either PyQt or Qt itself? Or am I doing something wrong?<br><br>I'm
using PyQt 4.1.1 with Qt 4.2 on SUSE 10.1. (BTW, Is there a proper way
to verify that I'm using the versions that I think I'm using?)
<br><br>Here is my model.flags() method.<br><br> def flags(self, index):<br> if not index.isValid():<br> return QtCore.Qt.ItemIsEnabled<br><br> if index.column() == 0:<br> return QtCore.Qt.ItemIsEnabled
| QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsUserCheckable<br> elif index.column() == 1:<br> return QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEditable<br><br> return
QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable<br><br><br>Any help would be greatly appreciated.<br><br>Thanks,<br><span class="sg">Brian DeWeese<br>
</span>