PDA

View Full Version : how to add buttons to a table view



cyclic
27th August 2009, 12:41
Hi,

I have a QTableView and a QStandardItemModel showing some columns. Now I need to a new column with a QPushButton so that each row has a button.

But I can't figure out how to add the button, any ideas on how do it?

regards
Per

Kumosan
27th August 2009, 12:45
But I can't figure out how to add the button, any ideas on how do it?

You have to use a delegate.

cyclic
27th August 2009, 12:47
You have to use a delegate.

that's what I suspected, but I still don't understand how to do it

Kumosan
27th August 2009, 13:05
I am afraid I have to point you to the Qt docs:
http://qt.nokia.com/doc/4.5/model-view-delegate.html

I doubt I am capable of explaining it better more understandable than the stuff in there. Sorry.