I have change the QTableWidget into QTableWidgetItem.
In my Dialog it display nothing in LineEdits.
Qt Code:
  1. void ContactWindow::edit(QTableWidgetItem* )
  2. {
  3. int row;
  4. contactTable->selectRow(row);
  5.  
  6. QTableWidgetItem *item = contactTable->item( row, 0 );
  7. QString bedrijf;
  8. if( item != 0 ) {
  9. bedrijf = item->text();
  10. }
  11. QTableWidgetItem *contactitem = contactTable->item( row, 1 );
  12. QString contact;
  13. if( contactitem != 0 ) {
  14. contact = contactitem->text();
  15. }
  16. QTableWidgetItem *telitem = contactTable->item( row, 2 );
  17. QString tel;
  18. if( telitem != 0 ) {
  19. tel = telitem->text();
  20. }
  21.  
  22. {
  23. contactDialog dlg(this);
  24. dlg.leBedrijf->setText( bedrijf);
  25. dlg.leContact->setText( contact );
  26. dlg.leTel->setText( tel );
  27. if(dlg.exec() == QDialog::Accepted) {
  28. }
  29.  
  30. }
  31. }
To copy to clipboard, switch view to plain text mode