With the following code Put a DateEdit in a Cell of a TableWidget:
dateEdit
->setDate
(QDate::currentDate());
ui->twHomeworkList->setCellWidget(ui->twHomeworkList->rowCount()-1,1,dateEdit);
QDateEdit *dateEdit = new QDateEdit();
dateEdit->setDate(QDate::currentDate());
ui->twHomeworkList->setCellWidget(ui->twHomeworkList->rowCount()-1,1,dateEdit);
To copy to clipboard, switch view to plain text mode
Now I tied to read the Date fromt the Edit:
QString x
= static_cast<QDateEdit
*>
(ui
->twHomeworkList
->cellWidget
(1,y
))->date
().
toString();
QString x= static_cast<QDateEdit*>(ui->twHomeworkList->cellWidget(1,y))->date().toString();
To copy to clipboard, switch view to plain text mode
But the application just crash.
Can somebody help me?
Greets ceddy
Bookmarks