On Friday 10 June 2011, 12:17:32 John Layt wrote:
> On Thursday 09 Jun 2011 20:09:36 Hans-Peter Jansen wrote:
> > While I understand, that QWidgets are getting the lower echelons, I
> > feel like asking about tackling one major show stopper in certain
> > Qt scenarios:
> >
> >     http://bugreports.qt.nokia.com/browse/QTBUG-277
> >
> > It's about QDateEdit, QTimeEdit and QDateTimeEdit allowing to keep
> > invalid dates, times and datetimes invalid (with databases, a NULL
> > value of such a field usually has a special meaning (think
> > "death-day" of still living people). Current behavior since Qt3 is:
> > if the user just tabs over such a field, the widgets force a valid
> > date/time value: leading to 2000-01-01 00:00:00 for a
> > QDateTimeEdit. Needless to say, that this behavior isn't desired
> > almost all the time.
>
> Hi Pete,
>
> QDateTime and its widgets are one of the subjects that the KDE
> community are very interested in.  We have our own KDateTime class
> which supports time zones and various edit widgets including ones
> that will accept invalid dates.  We'd like to simplify this by adding
> as much of this functionality into Qt as possible.  I'll be posting
> something to the list soon-ish, and discussing it at QtCS next week. 
> Due to the "mostly source compatible" policy for Qt5 I'm not sure
> there will be a clean way to adapt QDateTimeEdit but I'll look into
> it, otherwise we may need to add a new widget.
>
> Cheers!
>
> John.

Hi John,

I appreciate all your work with QDate{Time}. Nevertheless, I would like 
to see something done in this very respect, too, since the existence of 
this behavior is nagging me for a long time.. I like KDE, but in order 
to get sane basic widget behavior in this respect, I don't think, that 
pulling in KDE is really a sound option (think mobile devices).

Here's some food for implementation thoughts: how about adding some 
global boolean flag (application wide), that allows enabling invalid 
Q{Date,Time,DateTime} in their edit widgets. If that flag is enabled, 
change the widget behavior in a way, that tabbing over it will keep an 
invalid date{time}, allow to explicitely set an invalid date{time} 
programatically, disable auto completion and set an invalid date{time}, 
if the user presses delete, or if {s}he removes all values with 
backspace, and finally add a similar widget property..

This should be possible without violating source code compatibility of 
these widgets. Sorry for not providing a patch, but being a PyQt hacker 
myself, my C++ skills are rusty at best.

Anyway, I would love to see Qt5 appearing without this very flaw, and I 
bet, that a considerable amout of other users will be very grateful for 
such an improvement.

Pete
_______________________________________________
Qt5-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback

Reply via email to