Results 1 to 13 of 13

Thread: QTime

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: QTime

    instead of time.toString() you can build your own representation by using QTime::hour(), minute(), second() and msec().
    Just convert them to QString and concatenate them.

    Regards

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: QTime


    That, or:
    Qt Code:
    1. time.toString("hh:mm:ss.zzz");
    To copy to clipboard, switch view to plain text mode 
    There are other formatters from which you can choose.

    Regards

  3. #3
    Join Date
    Jan 2006
    Posts
    115
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanked 1 Time in 1 Post

    Default Re: QTime

    I see in my lcdNumber the milliseconds but is not counting down only the seconds is counting down.
    Must i time.addMSecs to the code?

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

    Default Re: QTime

    You are only reducing the number of seconds so how do you expect anything else to change?

  5. #5
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: QTime

    Yes, addMsecs(-x), where x is smaller than 1000, in order to see a difference.

    Regards

  6. #6
    Join Date
    Jan 2006
    Posts
    115
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanked 1 Time in 1 Post

    Default Re: QTime

    Thanks Marcel and Wysota for your advise.

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

    Default Re: QTime

    Or try my approach

  8. #8
    Join Date
    Feb 2012
    Posts
    19
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1

    Default Re: QTime

    hello.

    is it possible to add a start, reset and pause button

    but already thank you for what i see here :-)

Similar Threads

  1. QTime private member mds means what?
    By jamadagni in forum Qt Programming
    Replies: 2
    Last Post: 24th March 2006, 18:08
  2. Extending QDate, QTime and QDateTime
    By jamadagni in forum Qt Programming
    Replies: 8
    Last Post: 24th March 2006, 15:51

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
  •  
Qt is a trademark of The Qt Company.