title: How to prevent the QBasicTimer::stop: Failed warning when objects become threadless?
body: <p><code>QObject</code>s can easily become threadless, when their work thread finishes ahead of them. When this happens, Qt doesn't release their timer ids, even though the timers are not active anymore. Thus, a <code>QBasicTimer::stop: Failed. Possibly trying to stop from a different thread</code> warning appears. It has mostly cosmetic consequences, but does indicate a timer id leak, and thus a workaround would be nice to have. The following example triggers the problem:</p>
  
  <pre><code>#include &lt;QtCore&gt;
  int main(int argc, char *argv[]) {
     static_assert(QT_VERSION &lt; QT_VERSION_CHECK(5,11,0), "");
     QCoreApplication app(argc, argv);
     QObject object;
     object.startTimer(1000);
     QThread workThread;
     workThread.start();
     object.moveToThread(&amp;workThread);
     QTimer::singleShot(500, &amp;QCoreApplication::quit);
     app.exec();
     workThread.quit();
     workThread.wait();
  }
  </code></pre>
  
  <p>It'd be nice if the workaround didn't have to make any modifications to how the timers are allocated, i.e. that there would be no extra tracking of timers needed beyond what Qt already does.</p>