Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Add a stopwatch in QTwidget application.
Forum Updated to NodeBB v4.3 + New Features

Add a stopwatch in QTwidget application.

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
2 Posts 2 Posters 501 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.
  • M Offline
    M Offline
    Mar_60
    wrote on last edited by
    #1

    Hello Everyone!

    I am new to QT and C++ programming. I have tried to develop a simple app in qt written in c++. I want to add a stopwatch in my app. When I run my app the stopwatch starts and display it on app as well. How can I write a code for it? Can somebody help me?

    TIA

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Which part do you need help with ?
      You can use a QTimer + qelapsedtimer for keeping track of time.
      https://doc.qt.io/qt-5/qelapsedtimer.html

      https://forum.qt.io/topic/75609/proper-way-to-code-a-stopwatch

      Or you can use QDateTime as in this example
      https://github.com/jesslarsen21/stopwatch-QT/tree/master/a5-erik-jessica-stopwatch

      1 Reply Last reply
      1

      • Login

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