I have 2 QDateEdit which are Date_dob and Date_doj. I am storing the value using a Qstring shown below.
QString str_dob(ui->DATE_dob->text());
QString str_doj(ui->DATE_doj->text());
Now i want to populate the same into ui->Date_dob and ui->Date_doj (after some editing event takes place). I have used ,
ui->DATE_dob->setText(s.at(2));
ui->DATE_doj->setText(s.at(5)); //where s is a string having data
but the data doesn't populate.
Any kind of suggestion will be extremely appreciated. Thanks in advance
For convert
QString
toQDate
you can use QDate::fromString(). Then you can set date inQDateEdit
with QDate::setDate(const QDate &date).Hope it help.