if( item != 0 ) {
text = item->text();
}
dlg.leContact->setText( text );
QTableWidget *item = contactTable->item( row, 0 );
QString text;
if( item != 0 ) {
text = item->text();
}
dlg.leContact->setText( text );
To copy to clipboard, switch view to plain text mode
I have tried is pieces off code in my edit function but it gives a error text() is no member off Class QTableWidget.
I have change the code because off the error.
{
int row;
contactTable->selectRow(row);
contactTable->item( row, 0 );
if( item != 0 ) {
bedrijf = item->text();
}
contactTable->item( row, 1 );
if( item != 0 ) {
contact = item->text();
}
contactTable->item( row, 2 );
if( item != 0 ) {
tel = item->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 *item )
{
int row;
contactTable->selectRow(row);
contactTable->item( row, 0 );
QString bedrijf;
if( item != 0 ) {
bedrijf = item->text();
}
contactTable->item( row, 1 );
QString contact;
if( item != 0 ) {
contact = item->text();
}
contactTable->item( row, 2 );
QString tel;
if( item != 0 ) {
tel = item->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
It still not working when i click on the row in contactTable i see in the Dialog in the lineEdits the same items from the first column.
Example off my Dialog LineEdits:
Bedrijf: TMC
Contact: TMC
Tel: TMC
Bookmarks