QSignalSpy constructor takes a non-const QObject* as an argument while QObject::connect() takes a const object.