Hi

Try this

Qt Code:
  1. Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget)
  2. {
  3. ui->setupUi(this);
  4. http = new QHttp;
  5. chart = new QByteArray;
  6. QHttpRequestHeader header("POST", "/chart?cht=p3&chf=bg,s,65432100&chd=t:60,40&chs=250x100&chl=Hello|World");
  7. header.setValue("Host","chart.apis.google.com");
  8. http->setHost("chart.apis.google.com");
  9. http->request(header, *chart);
  10. QApplication::processEvents();
  11. connect(http, SIGNAL(done(bool)), this, SLOT(showChart()));
  12. }
  13.  
  14. void Widget::showChart()
  15. {
  16. *chart = http->readAll();
  17. QPixmap chartPixmap;
  18. chartPixmap.loadFromData(*chart);
  19. ui->label->setPixmap(chartPixmap);
  20. }
To copy to clipboard, switch view to plain text mode 


Greetings!