[PyQt] setItemDelegateForColumn() doesn't work? (so setItemDelegateForRow() does)

simozack simozack at yahoo.it
Mon Jan 4 08:07:29 GMT 2010

2010/1/4 Zhaohao Liang <liangvls at gmail.com>:
> Hi
> I'm using PyQt 4.6.2 for Python 2.6. It seems that the
> setItemDelegateForColumn() of QTableWidget doesn't work.
> I have checked it with below code:
>    print ui.tableWidget.itemDelegateForColumn(0)
>    ui.tableWidget.setItemDelegateForColumn(0, MyItemDelegate())
>    print ui.tableWidget.itemDelegateForColumn(0)
> It will print two "None" as result.
> ps: This will happen for setItemDelegateForRow()
> Please help to check it. Thank you!

I've never used that setter, but in the doc there is that note:

"Note: If a delegate has been assigned to both a row and a column, the
row delegate will take presedence and manage the intersecting cell


More information about the PyQt mailing list