Hi Qt folks,
Is there a way in Qt (4), to clear the contents of the QDateEdit???
I mean with an empty line edit in QDateEdit....
-James
Hi Qt folks,
Is there a way in Qt (4), to clear the contents of the QDateEdit???
I mean with an empty line edit in QDateEdit....
-James
See QDateEdit::clear(), inherited form QAbstractSpinBox. It clears everything except suffix and prefix.
I tried it.
But at the end, Minimum it displays the current date.
I'm afraid it might not be that simple. As far as I remember, there are a few event handlers like showEvent() and focusInEvent() that cause internal QAbstractSpinBoxPrivate::reset() to be called. I suggest you take a look at QAbstractSpinBox/QDateTimeEdit sources for possible workarounds.
J-P Nurmi
What do you need the empty spinbox for? Maybe there are other ways to do what you want? How about simply disabling the widget?
I wonder if there is still no way to clear the date field. As for the purpose of it, you can imagine providing an optional date field for people to fill in their birthday if they want to and use empty or "MM/DD/YYYY" instead of some arbitrary date as default. I suppose this is quite common and a little surprised that qt didn't support it.
Thanks!
Bookmarks