PDA

View Full Version : Add QPushButton to cell in QTableView?



nikhil
13th July 2010, 12:20
Hi to all
I'm using QTableView I'd like to include in each row a QPushButton Is there a way to get a button into a QTableView cell?
Thanks you.

Lykurg
13th July 2010, 12:32
No Problem with a custom delegate. See QAbstractItemView::setItemDelegateForColumn().

ahmdsd_ostora
13th July 2010, 13:07
If you aren't forced to use QTableView, you can use QTableWidget, it's straightforward


//use this to add any widget to any cell in the table:
QTableWidget::setCellWidget();
// and this to get a pointer to this added widget:
QTableWidget::cellWidget()

nikhil
14th July 2010, 10:01
is it Possible two split cell ?
or merge horizontal headers in QTableWidget.
Thanks in advance