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. Hot to display current value of a qtimer?
Forum Updated to NodeBB v4.3 + New Features

Hot to display current value of a qtimer?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 4.2k 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.
  • T Offline
    T Offline
    talanfree
    wrote on last edited by
    #1

    Hi, i am beginner in Qt:
    I have no idea how to get value of a timer and display it on a textbox dynamicly?
    Thanks

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Hi,
      A QTimer is probably not what you want to use. A timer is a class to control time, not to display time. QTimer gives an identifier and ways to expire on a elapsed time in sequence or just ones.
      There is QTime on the other hand that is used for the human readable time in UTC format and is able to be converted to all kinds of human readable times.
      I think (just guessing goes I have no clue to what you want do display) that QTime::elapsed() is the function for you for a simple msec time to display.
      Maybe explain in detail what you need, then a better answer could be made if this is not the correct one.

      Greetz, Jeroen

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

        QElapsedTimer is probably the class you're looking for.

        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