PDA

View Full Version : having problem with setIndexWidget



hamid ghous
10th November 2009, 05:01
Hi,

I am trying to get button in last col of my Qtableview an dhaving trouble while try to implement the setIndexWidget(). Here is my code..


gene->insertColumns(0,1); // where gene is QstandarditemModel class object

for(int i=0;i<counttableentries;i++)
{
QPushButton *pb = new QPushButton( "options");
geneList->setIndexWidget(gene->index(i,0),pb);// where geneList is Qtableview Object

}

I also have another coloumn in this table which load some data from a file(Working fine). I also dont want to use Qitemdelegate class as I dont want to edit anything in table from this button.

Any suggestion where I am doing wrong...

Cheers,