[Qt-interest] QDateEdit minimum date is year 100
Maximilien Renard
iixamaxii at gmail.com
Wed Mar 10 21:39:49 CET 2010
So what should I do ? Post this suggestion in the bug tracker or leave it
here hoping that someone will see it?
Anyway, thank you for your help :)
Maximilien
On 10 March 2010 19:53, John Layt <johnlayt at googlemail.com> wrote:
> On Wednesday 10 Mar 2010 18:14:23 Maximilien Renard wrote:
> > Hi John,
> >
> > Here is the link, you might be right about the cause of the problem but
> as
> > you can see with link provided below, it was stated that the bug was
> > related with QDateTime. I cannot figure out why it would be, since it
> > works as expected but I didn't take a look so I couldn't know!
> >
> > http://bugreports.qt.nokia.com/browse/QTBUG-277
> >
> > <http://bugreports.qt.nokia.com/browse/QTBUG-277>What I'd really like
> would
> > be a QDate(Time)Edit widget where the date would be displayed correctly
> > whatever it is (not limited to 100-01-01) and that it would not display
> > anything (or just the chosen separating characters) if the provided date
> is
> > 0000-00-00.
> > That way, it would be clear to the program user that when the field is
> left
> > blank, the date is not set :)
> >
> > Thank you for answer and your time !
> >
> >
> > Kind regards,
> >
> >
> > Maximilien
>
> OK, I was half right, the minimum date of 100AD probably is to do with the
> setYMD() behaviour, but that's not the behaviour preventing this fix (and
> actually I don't think it is an historic behaviour, so I don't know why
> that
> limit is in place). What they don't want to change is the default
> behaviour
> of converting a blank entry into the minimum date as that might break
> existing
> apps that rely on this behaviour.
>
> The easy and obvious solution is to keep the default behaviour, but have a
> flag or enum the coder can set to AllowNullDates, which would then allow a
> blank entry in the edit field and return a null date. It would be up to
> the
> coder to convert that QDate::isNull() status into whatever database format
> is
> required. If done as an enum, other behaviours could be possible.
>
> Seems a pretty fundamental feature for a date entry widget to have,
> especially
> for databases and the like where the current behaviour could cause bad data
> to
> be stored.
>
> John.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
--
Maximilien Renard
ULB - MA1 Ingénieur Civil Biomédical
maximilien.renard at ulb.ac.be
+32 476 63 68 92
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100310/307d524e/attachment.html
More information about the Qt-interest-old
mailing list