Hi all,
inside a library I have code like:
Qt Code:
  1. QNetworkReply* AIDAW::getRequest(const QString& url){
  2. QEventLoop loop;
  3. QTimer timer;
  4.  
  5. QNetworkRequest request(url);
  6. QNetworkReply *reply = this->network_manager->get(request);
  7.  
  8. QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
  9. QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
  10.  
  11. timer.start(TIMEOUT);
  12. loop.exec();
  13.  
  14. if(timer.isActive() == false){
  15. //manage the timeout
  16. }
  17.  
  18. return reply;
  19.  
  20. }
To copy to clipboard, switch view to plain text mode 

If I try to write a QTest Project using this library I get this error:
Qt Code:
  1. ********* Start testing of MyProject *********
  2. Config: Using QTest library 4.7.0, Qt 4.7.0
  3. PASS : AIDATest::initTestCase()
  4. QEventLoop: Cannot be used without QApplication
  5. QObject::connect: Cannot connect (null)::aboutToQuit() to QNativeWifiEngine::clo
  6. seHandle()
  7. QObject::startTimer: QTimer can only be used with threads started with QThread
  8. QObject::startTimer: QTimer can only be used with threads started with QThread
To copy to clipboard, switch view to plain text mode 

the main of the test project is managed by QTEST_MAIN(MyTestClass) macro