void import::on_pushButton_3_clicked(){ EditTable * TempEditTable= (EditTable *)editwin; for (int i = 1; i < ui->tableWidget->rowCount(); i++){ TempEditTable->addEndRow(); TempEditTable->edit = true; for(int j = 0; j < ui->tableWidget->columnCount(); j++){ for (int v = 1; v< TempEditTable->column();v++){ if (TempEditTable->TableText(1,v) == ui->tableWidget->item(0,j)->text()){ QString value = ui->tableWidget->item(i,j)->text(); TempEditTable->edit = true; TempEditTable->SetTableText(TempEditTable->row()-1,v,value); } } } } close();}
void EditTable::on_tableWidget_cellChanged(int row, int column){ if (edit){ qDebug() << QString::number(row)+" x "+QString::number(column) << " = " << ui->tableWidget->item(row,column)->text(); QByteArray block; QDataStream out(&block,QIODevice::WriteOnly); out.setVersion(QDataStream::Qt_4_7); out <<quint8('U'); out <<quint8('A'); out << ui->tableWidget->item(row,0)->text(); out << ui->tableWidget->item(0,column)->text(); out << ui->tableWidget->item(row,column)->text(); if (column < 5){ out << qint8('1'); } else{ out << qint8('2'); } _sock->write(block); }}