I have been looking around Google and Stackoverflow, but I have yet to find out if there is any simple solution to auto-filling three comboboxes to represent a correct date (like YYYY-MM-DD). I would presume it would be related to QCalendarWidget. Any ideas?
I want to be able to scroll through current time to dates from X years ago, it shouldn’t have non-existant dates like February 29, 2011. Not sure if this is asking for too much.
Now i get what’s your idea.
The answer is simple. Make three combo boxes: Day (1 – 31), Month (1 – 12) and Year (i.e. 1999 – 2012). Create “OK” button. No ultra-logic is needed.
After button being pressed just validate the date by creating QDate object with three numbers given by user and calling QDate::isValid(). If it isn’t, create some warning prompt and ask user to change something in input.
The best way to validate the data entered by user is to override QDialog::done() method.