Qt 6.11 is out! See what's new in the release
blog
Restrict date selection in QDateEdit
General and Desktop
3
Posts
2
Posters
1.5k
Views
1
Watching
-
I have two QDateEdit widgets in my application. I have set values of these widgets from my code.
I need to restrict the user in date selection. The user should not be able to select date before the startdate and after the end date. How can I implement this.
Can I disable dates in QDateEdit after or before a certain date?
I could not find selectionChanged signal for QDateEdit.Any help would be highly appreciated.
-
It is inherited from SpinBox and QDateTimeEdit. Did you try setting the maximumDate and minimumDate ? Overring some of the spinbox methods may help you.
-
Try this. It works.
QDateEdit tim;
tim.setMaximumDate(QDate(2010,1,1));
tim.show()