Results 1 to 4 of 4

Thread: Clearing QDateEdit

  1. #1
    Join Date
    Jul 2006
    Location
    Catalunya - Spain
    Posts
    117
    Thanks
    16
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Clearing QDateEdit

    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.

  2. #2
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Clearing QDateEdit

    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....

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Clearing QDateEdit

    Quote Originally Posted by patrik08
    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?

    Quote Originally Posted by jpujolf
    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().

  4. The following user says thank you to wysota for this useful post:

    jpujolf (1st August 2006)

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Clearing QDateEdit

    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.

Similar Threads

  1. Replies: 2
    Last Post: 8th July 2006, 17:16
  2. Problem with receiving events from QDateEdit
    By gunhelstr in forum Qt Programming
    Replies: 4
    Last Post: 20th April 2006, 11:21
  3. Clearing QTable
    By Lebowski in forum Newbie
    Replies: 1
    Last Post: 20th April 2006, 08:24
  4. Subclassing QDateEdit
    By jamadagni in forum Qt Programming
    Replies: 6
    Last Post: 4th February 2006, 13:26
  5. What's the correct way of clearing a pixmap?
    By karye in forum Qt Programming
    Replies: 4
    Last Post: 19th January 2006, 17:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.