Using Libcurl properly in Qt application
<p>I am new to both Qt and libcurl. I now need to use libcurl in my Qt application.  I started with:</p>

<pre><code>m_res = curl_easy_perform(m_curl);
</code></pre>

<p>Then I emit a signal which gives this string to another application </p>

<pre><code>emit dataString (QString::fromStdString(dataBufferfromcurl));
</code></pre>

<p>I have connected this signal to an slot in other application. But when the curl is called, it's blocking the other program by reading data. Can someone suggest me how to use licurl properly in a Qt application? </p>

<p>Here's some more-complete code:</p>

<pre><code>Class A : public QObject{
void init(){
 if (m_curl){
   curl_easy_setopt(m_curl, CURLOPT_URL, "www.example.com"); 
   curl_easy_setopt(m_curl, CURLOPT_SSL_VERIFYPEER, 0L); // enabling ssl 
   curl_easy_setopt(m_curl, CURLOPT_SSL_VERIFYHOST, 0L);
   curl_easy_setopt(m_curl, CURLOPT_CONNECTTIMEOUT, 0); 
   curl_easy_setopt(m_curl, CURLOPT_WRITEFUNCTION, WriteCallback);
   curl_easy_setopt(m_curl, CURLOPT_WRITEDATA, this);//

}
void process(){
  if (m_curl) {     
    m_res = curl_easy_perform(m_curl);
  }
};

//*************************************************************

class B : QThread{
  Q_OBJECT
public:
  void runProcess(){
    aObject = new A(); 
    ///************ few more connects
    connect(aObject, SIGNAL(connectionError(QString)), this, SLOT(s_fireConnectionError(QString)), Qt::QueuedConnection);
    QTimer::singleShot(1000, workingHTTPReader, SLOT(process()));
  }    
} ;
</code></pre>

<p>In  class C, I call <code>B::runProcess()</code>:</p>

<pre><code>void C:: getAllData()
{
    bObject = new B;
    bObject-&gt;runProcess(); //***********Problem     
}
</code></pre>

<p>If I call it this way, it reads the web page content, but execution of the rest of the application blocks.</p>

<p>How can I call this without blocking?</p>