I'm trying to write a function using QT to read in data from the Yahoo! weather feed so that I can parse it and put the data in a widget. I can't seem to get the data to come over though. Does anyone see anything wrong with my code? It compiles fine. I'm new to QT however and I would really appreciate some pointers.
Code:
char* Plasma_Weather::collectData()
{
QHttp* http = new QHttp();
QBuffer* buffer = new QBuffer();
QUrl url("http://weather.yahooapis.com/forecastrss?p=08002");
buffer->open(QBuffer::ReadWrite);
http->setHost(url.host());
http->get(url.path(), buffer);
http->closeConnection();
QByteArray array = buffer->readAll();
delete http;
delete buffer;
return array.data();
}