PDA

View Full Version : Clearing QDateEdit



jpujolf
27th July 2006, 17:22
Hello all,

I'm working with QDateEdit widgets showing Date values stored on a database. I often find NULL values that will be shown on screen as 01/01/2000 ( the forms are created with designer ).

I want to let the QDateEdit widget "clean & fresh" when this occurs ( The final user will understand better an empty value than an strange value... ). What can I do ? Any ideas ?

I've been searching on this forum and somebody said that TT guys sent him a little sample, but I haven't found it anywhere. If you have it...

Thanks,

Jordi.

patrik08
27th July 2006, 18:28
IMO:
I work on a floating widged calendar: http://www.qtnode.net/wiki/Custom_widgets
and i save UnixTime on DB... On this Way is possibel to Calc date and select mounth xx or week....

wysota
27th July 2006, 21:00
IMO:
I work on a floating widged calendar: http://www.qtnode.net/wiki/Custom_widgets
and i save UnixTime on DB... On this Way is possibel to Calc date and select mounth xx or week....

And in what way is this post related to the question?


Hello all,

I'm working with QDateEdit widgets showing Date values stored on a database. I often find NULL values that will be shown on screen as 01/01/2000 ( the forms are created with designer ).

I want to let the QDateEdit widget "clean & fresh" when this occurs ( The final user will understand better an empty value than an strange value... ). What can I do ? Any ideas ?

I've been searching on this forum and somebody said that TT guys sent him a little sample, but I haven't found it anywhere. If you have it...

Thanks,

Jordi.

Try using setSpecialValueText().

wysota
27th July 2006, 21:19
Another try could be to reimplement QDateTimeEdit::dateTimeFromText to return some special date if NULL is found and then use setSpecialValueText() to ask the box to display an empty string.