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!

Qt Code:
  1. ui->tabla->setColumnCount(5);
  2. while ( query4.next() )
  3. {
  4. //QString group = query4.value( 0 ).toString();
  5.  
  6. item->setText(query4.value(0).toString());
  7. ui->tabla->setItem(a,0,item);
  8. item2->setText(query4.value(1).toString());
  9. ui->tabla->setItem(a,1,item2);
  10. item3->setText(query4.value(2).toString());
  11. ui->tabla->setItem(a,2,item3);
  12. item4->setText(query4.value(3).toString());
  13. ui->tabla->setItem(a,3,item4);
  14. //QMessageBox::information(this,"",query4.value(3).toString());
  15. item5->setText(query4.value(4).toString());
  16. ui->tabla->setItem(a,4,item5);
  17. a++;
  18. }
To copy to clipboard, switch view to plain text mode