I have a problem with qdate and qtablewidget.
When I update an item on a qtablewdiget through a connect, I call a function "updateProdotto". I have a problem in reading the new qdate that I insert and in storing it in a new qdate variable.
I have already searched in the web, but without results because nobody does the operation I neeed with the qdate type.
connect(ui->tableViewProdotti,SIGNAL(itemChanged(QTableWidgetItem*)),this,SLOT(updateProdotto()));
void UserInterface::updateProdotto() {
int colonna = ui->tableViewProdotti->currentColumn();
int riga = ui->tableViewProdotti->currentRow();
if(colonna == 1)
art[riga]->setNome(ui->tableViewProdotti->item(riga,1)->text().toStdString());
if(colonna == 2)
art[riga]->setCategoria(ui->tableViewProdotti->item(riga,2)->text().toStdString());
if(colonna == 5) { // this is for date
QDate date= // read date and store it
art[riga]->setDate(date);
}
}
How can I do this?