title: Queue several QTimers calls to slots
body: <p>I'm using a library where I need to call a trigger function that starts some processing (starts a thread that does the job) and returns immediatly. Then when the processing is finished a signal is emitted.</p>
  
  <p>This needs to be done periodically based on different parameters. Since other calls to the trigger function must not be done while processing I would need to queue them in some way. I thought about using a QEventLoop ("loop") but without luck so far.</p>
  
  <p>Please look at this piece of code:</p>
  
  <pre><code>test::test()
      {
      connect(&amp;timer,   SIGNAL(timeout()), this, SLOT(timerSlot()));
      connect(&amp;timer2,  SIGNAL(timeout()), this, SLOT(timer2Slot()));
      connect(&amp;library, SIGNAL(processingFinished()), &amp;loop, SLOT(quit()));
  
      timer.setInterval(2000);
      timer.start();
  
      timer2.setInterval(4000);
      timer2.start();
      }
  
  void test::timerSlot()
      {
      loop.exec();
      startProcessing(some_parameters);
      }
  
  void test::timer2Slot()
      {
      loop.exec();
      startProcessing(some_other_parameters);
      }
  </code></pre>
  
  <p>The issue is that when loop.exec() is called while processing I get the message:</p>
  
  <pre><code>QEventLoop::exec: instance xxxxxx has already called exec()
  </code></pre>
  
  <p>What would be the right way to do what I intend?</p>
  
  <p>Thanks in advance.</p>