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

Unable to re-start a singleshot timer in the onTriggered handler

    XMLWordPrintable

Details

    Description

      It is not possible to re-start a singleshot timer in the onTriggered handler since the timer is stopped only after the onTriggered handler.

      A possible fix is to change this code from

      void QDeclarativeTimer::finished()
      {
          Q_D(QDeclarativeTimer);
          if (d->repeating || !d->running)
              return;
          emit triggered();
          d->running = false;
          d->firstTick = false;
          emit runningChanged();
      }
      

      to

      void QDeclarativeTimer::finished()
      {
          Q_D(QDeclarativeTimer);
          if (d->repeating || !d->running)
              return;
          d->running = false;
          d->firstTick = false;
          emit runningChanged();
          emit triggered();
      }
      

      Attachments

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

        Activity

          People

            denexter Andrew den Exter (closed Nokia identity) (Inactive)
            agroyer Anthony Groyer
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes