I have change the QTableWidget into QTableWidgetItem.
In my Dialog it display nothing in LineEdits.
{
int row;
contactTable->selectRow(row);
if( item != 0 ) {
bedrijf = item->text();
}
if( contactitem != 0 ) {
contact = contactitem->text();
}
if( telitem != 0 ) {
tel = telitem->text();
}
{
contactDialog dlg(this);
dlg.leBedrijf->setText( bedrijf);
dlg.leContact->setText( contact );
dlg.leTel->setText( tel );
if(dlg.
exec() == QDialog::Accepted) { }
}
}
void ContactWindow::edit(QTableWidgetItem* )
{
int row;
contactTable->selectRow(row);
QTableWidgetItem *item = contactTable->item( row, 0 );
QString bedrijf;
if( item != 0 ) {
bedrijf = item->text();
}
QTableWidgetItem *contactitem = contactTable->item( row, 1 );
QString contact;
if( contactitem != 0 ) {
contact = contactitem->text();
}
QTableWidgetItem *telitem = contactTable->item( row, 2 );
QString tel;
if( telitem != 0 ) {
tel = telitem->text();
}
{
contactDialog dlg(this);
dlg.leBedrijf->setText( bedrijf);
dlg.leContact->setText( contact );
dlg.leTel->setText( tel );
if(dlg.exec() == QDialog::Accepted) {
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks