Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-128426

QTimer vs. QChronoTimer::singleShot()

    XMLWordPrintable

Details

    • 5
    • 25b8d3743 (dev), 65a249715 (dev), ee6b101ad (6.8), 92597843d (6.8), 6991e848e (dev), 4e911bda2 (dev), 6e5eb082c (dev), 2fb422828 (6.8), f8b3c1f0a (6.8), e6ab7847a (6.8), 870307789 (dev), 28161ab42 (6.8)
    • Foundation Sprint 115

    Description

      The new QChronoTimer class has singleShot() static methods that provide nanosecond resolution while QTimer has singleShot() static methods that take any Duration, but implicitly round (or truncate?) to millisecond resolution. That means the same calls compile, but behave differently.

      Suggest to

      1. make QTimer::singleShot() have nanosecond resolution
      2. remove QChronoTimer::singleShot() static methods

      Rationale for (2): We don't want two timer classes. QChronoTimer is a kludge that was necessary due to the existing QTimer::interval int property (chrono types have a larger range than int ms). So the expectation is that QChronoTimer becomes QTimer in Qt 7. The static methods don't have the problem with int setter and getters and so can remain on QTimer, so that users don't need to first port to QChronoTimer::singleShot() in Qt 6 and then back to QTimer::singleShot() in Qt 7.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mmutz Marc Mutz
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: