View Full Version : Setting Delegates per Column

30th May 2006, 19:13
I have created a QTableView/QAbstractTableModel pair that I am using to display various types of data. Most of my columns display QString data, and when the user double-clicks that column the standard editing delegate (seems like a QLineEdit) works fine. Some of my other columns display QDate data and for editing those I would like to use a custom control I have written. I expected to be able to use the setItemDelegate method for this, but that applies the delegate to the entire QTableView. Is there any way for me to set a delegate specifically for one column in the table?


30th May 2006, 20:33
No, "there can be only One!"

But don't loose hope :) You can return different editors from the delegate depending on the column of the view.

BTW. You might want to search through the forum, as this issue has already been brought up some time ago.

30th May 2006, 22:39
Whoops :crying: - I did search the forum and skipped right over the thread you're referring to. :o

Thanks wysota