Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Building a timer
Forum Updated to NodeBB v4.3 + New Features

Building a timer

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 3 Posters 1.8k 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
    Ankit.k
    wrote on last edited by
    #1

    I am working on building an app in which when a mouse area is clicked a timer starts and on clicking the other button the timer stops. I am having problems in including the timer. I tried using NumberAnimation but it does not work properly. Kindly help

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

      welcome to devnet

      You might want to have a look on to "QTime::currentTime()":http://qt-project.org/doc/qt-4.8/qtime.html#currentTime
      The difference of 2 time readings shall provide you the result you are looking for.

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

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Ankit.k
        wrote on last edited by
        #3

        Thank you Koahnig for the reply
        I looked into the link given by you, but couldn't use it in code as I am not sure in which file I should include it.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          steno
          wrote on last edited by
          #4

          You have to include QTime in the file you make the call in.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Ankit.k
            wrote on last edited by
            #5

            I included QTime in the file and included the timer.h and timer.cpp file, but i am still not getting the output when i build the code.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Ankit.k
              wrote on last edited by
              #6

              The Timer is working properly. Thanks everyone for the support.

              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