title: Disconnect qt timer for unit test
body: <p>I'm trying to unit test some legacy code which is using QTimer for some periodic action basically:</p>
  
  <pre><code>class MyClass : public QObject
  {
      Q_OBJECT
  public:
      explicit MyClass(QObject* parent = nullptr) : QObject(parent)
      {
          timer.setInterval(1000);
          timer.setSingleShot(false);
          timer.start();
          connect(&amp;timer, &amp;QTimer::timeout, this, &amp;MyClass::onTimeout);
      }
      int getValue() const
      {
          return value;
      }
  signals:
  
  public slots:
      void onTimeout()
      {
          value++;
      }
  private:
      int value{0};
      QTimer timer{this};
  };
  </code></pre>
  
  <p>I need to write unit test for the method onTimeout() hence I'm trying to disconnect the QTimer::timeout from MyClass::onTimeout and trigger the update from the unit test.</p>
  
  <pre><code>void testFirstUpdate()
  {
      MyClass myClass;
      qDebug() &lt;&lt; "disconnect: " &lt;&lt; myClass.disconnect(); //returns false
      myClass.dumpObjectInfo();
      QCOMPARE(myClass.getValue(), 0);
      myClass.onTimeout();
      QCOMPARE(myClass.getValue(), 1);
  }
  </code></pre>
  
  <p>How can I make the disconnect working? Or is there a better way controlling QTimer from QtTestLib? Is adding MyClass::disconnectTimer() the only viable option?</p>