ser_bur
29th May 2007, 15:05
Hi, All!
I think I need some advice... I want to copy row from one QTableWidget to another. The first idea was to copy cell-by-cell, something like this:
QTableWidgetItem Table2Item[Table1->columnCount()];
for(j=0;j<(Table1->columnCount());j++)
{
Table2Item[j] = *Table1->item(Table1->currentRow(),j);
Table2->setItem(Table2->currentRow(),j,&Table2Item[j]);
}
But this just inserts an empty row into Table2... I think I made a stupid mistake, but I do not see where... Maybe there is another way to copy the row? :confused:
I think I need some advice... I want to copy row from one QTableWidget to another. The first idea was to copy cell-by-cell, something like this:
QTableWidgetItem Table2Item[Table1->columnCount()];
for(j=0;j<(Table1->columnCount());j++)
{
Table2Item[j] = *Table1->item(Table1->currentRow(),j);
Table2->setItem(Table2->currentRow(),j,&Table2Item[j]);
}
But this just inserts an empty row into Table2... I think I made a stupid mistake, but I do not see where... Maybe there is another way to copy the row? :confused: