Hi there guys,

I've asking this question on a lot of websites for the past few days, but I've been out of luck appearently! No one could help me, so I hope you guys can figure out the problem & how to solve it.


I'm trying to use QNetworkAcessManager to get the source of a url .. But it seems that there's a problem with the signal-slot complex!
my onFinished() slot is never triggered! Why?

Here's my code:
Qt Code:
  1. void Worker::start(QString url)
  2. {
  3. QNetworkAccessManager *manager = new QNetworkAccessManager();
  4. QNetworkReply *reply = manager->get(QNetworkRequest(QUrl(url)));
  5. QObject::connect(reply, SIGNAL(finished()), this, SLOT(onFinished()));
  6.  
  7.  
  8. void Worker::onFinished()
  9. {
  10. qDebug() << "Slot has been triggered!";
  11.  
  12. QString html = reply->readAll();
  13. }
To copy to clipboard, switch view to plain text mode 


And actually I tried to play around & change the code many times without any luck, so please guide me & show me a nice working example to get html source of a webpage.

And thank you so much in advance;