PDA

View Full Version : Insert the string into QTableWidget



suresh
8th September 2006, 15:06
Can I directly insert the string into particular cell in QTableWidget? ( Without using QTableViewItem)

jacek
8th September 2006, 15:09
No, you can't --- QTableWidgetItems are the cells.

wysota
8th September 2006, 15:27
I guess you were both speaking about QTableWidgetItems, right? :)

suresh
8th September 2006, 15:56
Yes, QTableWidgetItems.

vinithr
5th August 2012, 14:06
Hi all,

I am trying to use QTableWidgetItem to add a string to a tablewidget.But i coudnt able to add.

strcpy(Temp,val_pnt->Row[i].Column[j].ColumnValue);
str.sprintf("%s",Temp);
ui->tableWidget->setItem(i,j,new QTableWidgetItem(str));


The above code is not working properly.
Could anyone please tell me what i am wrong.?

Thanks in advance.

Regards
Vinithr

Added after 22 minutes:

hi,
The problem is fixed.The problem was Temp declared as pointer instead of a specific array

Thanks
Vinithr