• Content Count

  • Joined

  • Last visited

About asoong1

  • Rank
  1. asoong1

    Qt Help

    Should I try using QUrlOperator instead? Could you show me how to do that? The API says I need to registed QHttp using qInitNetworkProtocols(). Anyideas?
  2. asoong1

    Qt Help

    Hmm, I tried both solutions but the output file result.html is still blank when i open it. Is the path incorrect? Or my use of the QHttp get?
  3. asoong1

    Qt Help

    I took a stab at creating a program using Qt that would use http to get data from a website and store it in a file. All parts seem to be accounted for but the returned "result.html" file is always blank. Does anybody know why? Here's my code below: I bound it to a command that executes when a button on the GUI is pushed: int rID = 0; void MainWindow::buttonClickHandler2() { ui->CurModeOUT->setText(ui->pushButton_2->text()); QHttp http; QIODevice*pdev = 0; QFile file("C:\\result.html");; QHttpRequestHeader header ("GET", ""); header.setValue("Host", ""); http.setHost("", 80); rID = http.get("/index.html",pdev); //rid = http.request(header, 0, pdev); printf("rid %d\n",rID); QTextStream stream(&file); pdev = stream.device(); file.flush(); file.close(); QString requestID = QString::number(rID); ui->DimPctOUT->setText(requestID); }