title: Doing a qt network request
body: <p>Im trying to connect to a website and perform a request with qt, i got this code so far, but it tells me the following mistakes : </p>
  
  <pre><code>#include &lt;QCoreApplication&gt;
  #include &lt;QDebug&gt;
  #include &lt;QNetworkAccessManager&gt;
  #include &lt;QNetworkRequest&gt;
  #include &lt;QNetworkReply&gt;
  #include &lt;QUrl&gt;
  #include &lt;QUrlQuery&gt;
  
  void sendRequest();
  
  int main(int argc, char *argv[]) { 
      QCoreApplication a(argc, argv);
      sendRequest();
      return a.exec();
  }
  
  void sendRequest() {    
  QNetworkAccessManager *manager = new QNetworkAccessManager(this);   connect(manager, SIGNAL(finished(QNetworkReply*)),      this, SLOT(replyFinished(QNetworkReply*)));
  
  manager-&gt;get(QNetworkRequest(QUrl("http://qt-project.org")));
  }
  </code></pre>
  
  <p>It says :</p>
  
  <blockquote>
    <p>Error 1   error C2355: 'this' : can only be referenced inside non-static
    member functions or non-static data member
    initializers  c:\Users\Synturas\documents\visual studio
    2013\Projects\qt_request\qt_request\main.cpp  19  1   qt_request</p>
    
    <p>Error 2   error C2355: 'this' : can only be referenced inside non-static
    member functions or non-static data member
    initializers  c:\Users\Synturas\documents\visual studio
    2013\Projects\qt_request\qt_request\main.cpp  21  1   qt_request</p>
    
    <p>Error 3   error C3861: 'connect': identifier not
    found c:\Users\Synturas\documents\visual studio
    2013\Projects\qt_request\qt_request\main.cpp  20  1   qt_request
      4   IntelliSense: 'this' may only be used inside a nonstatic member
    function  c:\Users\Synturas\Documents\Visual Studio
    2013\Projects\qt_request\qt_request\main.cpp  19  61  qt_request</p>
    
    <p>5   IntelliSense: identifier "connect" is
    undefined c:\Users\Synturas\Documents\Visual Studio
    2013\Projects\qt_request\qt_request\main.cpp  20  2   qt_request</p>
    
    <p>6   IntelliSense: 'this' may only be used inside a nonstatic member
    function  c:\Users\Synturas\Documents\Visual Studio
    2013\Projects\qt_request\qt_request\main.cpp  21  3   qt_request</p>
  </blockquote>
  
  <p>(Im using VS2013 for this project, if this is relevant)</p>