Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to set an external clock as clock basetime?
Forum Updated to NodeBB v4.3 + New Features

How to set an external clock as clock basetime?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 4 Posters 801 Views 3 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.
  • alsaA Offline
    alsaA Offline
    alsa
    wrote on last edited by alsa
    #1

    I'd like to use an RTC as basetime for a QTextLabel in which I place a textual clock.
    How I can use it?
    Someone could give me a step-by-step procedure to insert it.
    I tried as QProcess: time is visible but my qtextlabel shows statically the time at the bootup only.
    ùThanks in advance
    Paolo

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

      Hi,

      Do you mean something like the digital clock example ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • alsaA Offline
        alsaA Offline
        alsa
        wrote on last edited by
        #3

        Something like this, but with an external basetime (in my case basetime is an RTC that I query with "hwclock -r" instead internal QTimer set with 1 sec).
        How to connect it ?

        aha_1980A 1 Reply Last reply
        0
        • alsaA alsa

          Something like this, but with an external basetime (in my case basetime is an RTC that I query with "hwclock -r" instead internal QTimer set with 1 sec).
          How to connect it ?

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @alsa The usual way is to use the hwclock to set the system time once, then rely on the system time.

          You can easily combine a QTimer to update the display with QTime::currentTime() to display your time.

          Qt has to stay free or it will die.

          1 Reply Last reply
          2
          • alsaA Offline
            alsaA Offline
            alsa
            wrote on last edited by alsa
            #5

            @aha_1980 said in How to set an external clock as clock basetime?:

            QTime::currentTime()

            Exactly This !!!
            SOLVED !!!!
            thanks aha_1980

            Pablo J. RoginaP 1 Reply Last reply
            1
            • alsaA alsa

              @aha_1980 said in How to set an external clock as clock basetime?:

              QTime::currentTime()

              Exactly This !!!
              SOLVED !!!!
              thanks aha_1980

              Pablo J. RoginaP Offline
              Pablo J. RoginaP Offline
              Pablo J. Rogina
              wrote on last edited by
              #6

              @alsa said in How to set an external clock as clock basetime?:

              SOLVED !!!!

              So don't forget to mark your post as such!

              Upvote the answer(s) that helped you solve the issue
              Use "Topic Tools" button to mark your post as Solved
              Add screenshots via postimage.org
              Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

              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