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. QTimer
Forum Updated to NodeBB v4.3 + New Features

QTimer

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.9k 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

    I am a newbie in Qt. I was working on QTimer class. I have label = 00:00:00. I setted the label using setText("12:45:50"); using a button.
    When i click the start button it resets to 00:00:00 again and starts. It won't start from 12:45:50. How do i do that?

    Be me Guest!

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

      welcome to devnet

      You need to post at least some code snippet. Otherwise nobody can help you.
      There are also the examples eg "Analog Clock":http://qt-project.org/doc/qt-4.8/widgets-analogclock.html and "Digital Clock":http://qt-project.org/doc/qt-4.8/widgets-digitalclock.html

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

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MuldeR
        wrote on last edited by
        #3

        BTW: QTimer is used to trigger a Signal after a certain period of time or at regular intervals. If you want the current time, as it appears from your setText() command, you may want to have a look at QDateTime::currentDateTime(). If you need a string you can pass into setText(), use .time().toString().

        My OpenSource software at: http://muldersoft.com/

        Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

        Go visit the coop: http://youtu.be/Jay...

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

          I solved the problem myself. Thanks for the replies!

          Be me Guest!

          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