Results 1 to 4 of 4

Thread: QTimeEdit maximum time to 24h (24:00:00)

  1. #1
    Join Date
    Jan 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTimeEdit maximum time to 24h (24:00:00)

    I need a QTimeEdit where I can put the time of usage of some item in a day, so the maximum time must be 24:00:00, but the setMaximumTime don't do this because it's is considered an invalid value. There is a way to do this?
    I already tried overloading the class but when I overload setMaximumTime I can acess the property to change it...

  2. #2
    Join Date
    Feb 2010
    Location
    Hyderabad, India
    Posts
    15
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTimeEdit maximum time to 24h (24:00:00)

    The maximum time that can be set for the QTimeEdit is 23:59:59 and 999 milliseconds.
    But if you wish to customize it, try to override the 'validate' protected method.

  3. #3
    Join Date
    Jan 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTimeEdit maximum time to 24h (24:00:00)

    Well that is the biggeest problem, I can find which is the method that validates the value

  4. #4
    Join Date
    Feb 2010
    Location
    Hyderabad, India
    Posts
    15
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTimeEdit maximum time to 24h (24:00:00)

    You have the validate method of base class, QDateTimeEdit as defined below.

    QValidator::State QDateTimeEdit::validate ( QString & text, int & pos ) const [virtual protected]

    You can try to override this method.

Similar Threads

  1. Trouble using QTimeEdit
    By rforehand in forum Newbie
    Replies: 0
    Last Post: 17th October 2009, 01:03
  2. Replies: 1
    Last Post: 15th April 2009, 09:00
  3. Hourspinner in Qt3 QTimeEdit
    By user_mail07 in forum Qt Programming
    Replies: 0
    Last Post: 5th February 2009, 02:34
  4. QtimeEdit
    By mickey in forum Qt Programming
    Replies: 4
    Last Post: 11th July 2006, 18:04
  5. There is QTimeEdit another thing in Qt4
    By Krishnacins in forum Qt Programming
    Replies: 1
    Last Post: 26th May 2006, 16:06

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.