mmm286
26th May 2010, 10:13
Hi,
I have a problem filling a qtablewidget. Allways fill the first row. I 've checked the code but I dont see any error. Could you help me please? Many thanks and sorry for my english!
ui->tabla->setColumnCount(5);
while ( query4.next() )
{
//QString group = query4.value( 0 ).toString();
item->setText(query4.value(0).toString());
ui->tabla->setItem(a,0,item);
item2->setText(query4.value(1).toString());
ui->tabla->setItem(a,1,item2);
item3->setText(query4.value(2).toString());
ui->tabla->setItem(a,2,item3);
item4->setText(query4.value(3).toString());
ui->tabla->setItem(a,3,item4);
//QMessageBox::information(this,"",query4.value(3).toString());
item5->setText(query4.value(4).toString());
ui->tabla->setItem(a,4,item5);
a++;
}
I have a problem filling a qtablewidget. Allways fill the first row. I 've checked the code but I dont see any error. Could you help me please? Many thanks and sorry for my english!
ui->tabla->setColumnCount(5);
while ( query4.next() )
{
//QString group = query4.value( 0 ).toString();
item->setText(query4.value(0).toString());
ui->tabla->setItem(a,0,item);
item2->setText(query4.value(1).toString());
ui->tabla->setItem(a,1,item2);
item3->setText(query4.value(2).toString());
ui->tabla->setItem(a,2,item3);
item4->setText(query4.value(3).toString());
ui->tabla->setItem(a,3,item4);
//QMessageBox::information(this,"",query4.value(3).toString());
item5->setText(query4.value(4).toString());
ui->tabla->setItem(a,4,item5);
a++;
}