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

QObject::startTimer enqueues in reverse order on same tick

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.12.3
    • Core: Object Model
    • None
    • Windows

      If I create multiple timers with QObject::startTimer, all with the same duration, and they are launched close enough together that they end up scheduled on the timer tick, they perversely seem to fire in the reverse order. They should fire in FIFO order.

      Use case: I'd like to use a timer to simulate a comm link (e.g., serial, USB, MIDI, etc.) with a fixed delay, representing each message with a separate timer, since that takes almost no code. What I wind up having to do is create my own message queue and use a single timer, but that takes about a page of code. And since I'm doing it in QML (with a tiny C++ interface module), the JavaScript needed to do that becomes a major hotspot in my code.

      Since the order the timers fire seems consistent, it ought to be simple to fix this. Perhaps there's a < somewhere there should be a <= in the code.

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

            thiago Thiago Macieira
            pderocco Paul DeRocco
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes