Set current date in QCalendarWidget
-
Hi, hello.
I am using a QCalendarWidget for date input that is stored in a QLineEdit. When I double click the QLineEdit box it pops up a QCalendarWidget for date selection. I wish to set the current date that is already displayed in the QLineEdit. I have found this in the Docs.
selectedDate : QDate This property holds the currently selected date. The selected date must be within the date range specified by the minimumDate and maximumDate properties. By default, the selected date is the current date. Access functions: QDate selectedDate() const void setSelectedDate(const QDate &date)
However, setSelectedDate does not appear to be a valid function of QCalendarWidget.
What am I missing here?
Thanks
Chris...
-
-
Hi Guys, and thanks for the help.
The issue was setCurrentDate() was not a valid function. The problem was, I set my QCalendarWidget class as private within the popup class. Once I wrote a function within the popup class to modify the current date all works as expected.
Thanks. again.