How can I set the date of a QDateComboBox using a string that some times can also be empty?
The QDate class has a static fromString function that can create a QDate from a string, but you will have to know the format of the date in the string for it to work properly.
QDate.fromString assumes dates will be in the following format:
ddd MMM d yyyy (ShortDayName ShortMonthName ShortDayNumber LongYearNumber) e.g. Thu Dec 6 2012
If QDate can't parse the date-string, an invalid QDate object will be returned (you can check this with
An empty string will produce an invalid date object, but if you pass one to
QDateEdit.setDate, it will be ignored (i.e. the date won't change).