Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Starting the timer
Qt 6.11 is out! See what's new in the release blog

Starting the timer

Scheduled Pinned Locked Moved General and Desktop
8 Posts 5 Posters 3.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AnilHassan
    wrote on last edited by
    #1

    Hey everyone i was making a simple audio recorder for my desktop. I thought using a QTimer class to start and stop timer and QTime class to make hours, mins, secs. But i later realized that i want hours to extend even after the value = 60. I have a format witth label "00:00:00". Starting from left i want secs, mins to function as usual but i want to extend hours to go on forever untill user stop the timer. Please help.

    Be me Guest!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Santosh Reddy
      wrote on last edited by
      #2

      QTime will roll over the hours after 24 hours, you can never reach 60 hours, you can use QDateTime instead, call @int QDateTime::secsTo ( const QDateTime & other ) const@ and convert into seconds to mins and hours.

      SS

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AnilHassan
        wrote on last edited by
        #3

        !http://www.facebook.com/photo.php?fbid=386687634753876&set=a.386687644753875.90664.100002379275458&type=1&relevant_count=1&ref=nf()!

        Hi, I want the timer format like above format "Days:Hours:Min:Secs". Please Help

        Be me Guest!

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          For determining time spans you can check out posts with "qtimespan":http://qt-project.org/search/tag/qtimespan tag. There is some activity, but it did not make to the "last release (see here).":http://qt-project.org/forums/viewthread/3228/
          The development source is available "here":http://gitorious.org/qtimespandevel

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0
          • D Offline
            D Offline
            DerManu
            wrote on last edited by
            #5

            [quote author="Anil Kumar" date="1357474937"]
            Hi, I want the timer format like above format "Days:Hours:Min:Secs". Please Help[/quote]

            I don't see the problem. Santosh Reddy's post and some very basic maths solves the problem. What more is there?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              scroverty
              wrote on last edited by
              #6

              He seems new to Qt lib I suppose...Or maybe he wanted a widget?

              Alvis Ar'Berkeley Andrew.
              Pleased to meet you!

              1 Reply Last reply
              0
              • A Offline
                A Offline
                AnilHassan
                wrote on last edited by
                #7

                Oh! I have just started over in middle of the 2012. I hope i'm learning. But check out the software written by me. "Code Timer":https://sourceforge.net/projects/codetimer/ Jan 15th or so because i have not uploaded anything. I have to design a application icon and then say am i not suppose to know a widget. Thanks

                [quote author="A.A.B.A" date="1357503392"]He seems new to Qt lib I suppose...Or maybe he wanted a widget?[/quote]

                Be me Guest!

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  DerManu
                  wrote on last edited by
                  #8

                  [quote author="Anil Kumar" date="1357572353"]"Code Timer":https://sourceforge.net/projects/codetimer/[/quote]Heh, so you press the start button, then start "learning" the language, and then press the stop button? That's a rather peculiar idea of learning a programming language ;). In my opinion, you can set that time to numeric_limits<double>::infinity() right away.
                  But the program itself surely is a good exercise for learning programming. So yeah... good job! :)

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved