Get date from Calendar Widget to label

1.6k views Asked by At

I have a Calendar Widget in my form called cw_calendar and I want to get the current date from the widget to my label (called label). I'm trying:

ui->label->setText(ui->cw_calendar->selectedDate.toString("dd/mm/yy"));

But it's not working. Please, can anyone help me

1

There are 1 answers

0
user3448492 On

I've discovered the mistake, the right way is " ui->label->setText(ui->cw_calendar->selectedDate().toString("dd/MM/yy")); "