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

QElapsedTimer::elapsed returns negative values of qint64

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: 5.14.2
    • Fix Version/s: None
    • Component/s: Core: Date/Time
    • Labels:
      None
    • Platform/s:
      Linux/X11

      Description

      elapsed time returns negative value of type qint64. It should return quint64. The header seems to be wrong. I noticed this bug while switching from the deprecated QTime to QElapsedTimer.

       

      Negative value: qint64 elapsedMs = QElapsedTimer::elapsed();

      Correkt value:  quint64 elapsedMs = QElapsedTimer::elapsed();

       

      Docu:

      qint64 QElapsedTimer::elapsed() const
      Returns the number of milliseconds since this QElapsedTimer was last started.
      Calling this function on a QElapsedTimer that is invalid results in undefined behavior.
      See also start(), restart(), hasExpired(), isValid(), and invalidate().

        Attachments

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

          Activity

            People

            Assignee:
            Eddy Edward Welbourne
            Reporter:
            voptop Robert Stiehler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes