weaver4
11th January 2010, 18:00
I am getting this error when I run my code:
URL.Host = edition.cnn.com
URL.Path = /services/podcasting/newscast/rss.xml
Object::connect: No such slot PodcastFeed::FeedReadData(const QHttpResponseHeader &) in podcastfeed.cpp:25
Object::connect: No such slot PodcastFeed::FeedRequestFinished( int, bool) in podcastfeed.cpp:26
ConnectionId = 2
(Internal error: pc 0x6241a0 in read in psymtab, but not in symtab.)
(Internal error: pc 0x6241a0 in read in psymtab, but not in symtab.)
(Internal error: pc 0x6241a1 in read in psymtab, but not in symtab.)
(Internal error: pc 0x6241a0 in read in psymtab, but not in symtab.)
(Internal error: pc 0x6241a0 in read in psymtab, but not in symtab.)
Can someone give me a hand I am using QTCreator and QT 4.6.
Here is my header:
#ifndef PODCASTFEED_H
#define PODCASTFEED_H
#include <QObject>
#include <QString>
#include <QtNetwork>
#include <QHttp>
class PodcastFeed : public QObject
{
Q_OBJECT
public:
PodcastFeed();
int id;
QString title;
QString description;
QString url;
QString action;
int actionInt;
int sortOrder;
QString feedTitle;
QString feedDescription;
void Load();
void DownloadFeed(QString url);
void FeedReadData(const QHttpResponseHeader &resp);
void FeedRequestFinished( int id, bool error);
private:
bool completed;
int connectionId;
QHttp http;
QXmlStreamReader xml;
void ParseXml();
};
#endif // PODCASTFEED_H
and here is the function I am having difficulty with.
void PodcastFeed::DownloadFeed(QString url)
{
xml.clear();
QUrl myUrl(url);
http.setHost(myUrl.host());
Util::WriteLine("URL.Host = " + myUrl.host());
Util::WriteLine("URL.Path = " + myUrl.path());
QObject::connect(&http, SIGNAL(readyRead(const QHttpResponseHeader &)), this, SLOT(FeedReadData(const QHttpResponseHeader &)));
QObject::connect(&http, SIGNAL(requestFinished( int, bool)), this, SLOT(FeedRequestFinished( int, bool)));
connectionId = http.get(myUrl.path());
Util::WriteLine("ConnectionId = " + QString::number(connectionId));
// Proceeds to FeedReadData when read.
}
void PodcastFeed::FeedRequestFinished( int id, bool error)
{
Util::WriteLine("GotRequestFinished");
}
void PodcastFeed::FeedReadData(const QHttpResponseHeader &resp)
{
Util::WriteLine("FeedReadData");
if (resp.statusCode() != 200)
http.abort();
else {
xml.addData(http.readAll());
ParseXml();
}
}
URL.Host = edition.cnn.com
URL.Path = /services/podcasting/newscast/rss.xml
Object::connect: No such slot PodcastFeed::FeedReadData(const QHttpResponseHeader &) in podcastfeed.cpp:25
Object::connect: No such slot PodcastFeed::FeedRequestFinished( int, bool) in podcastfeed.cpp:26
ConnectionId = 2
(Internal error: pc 0x6241a0 in read in psymtab, but not in symtab.)
(Internal error: pc 0x6241a0 in read in psymtab, but not in symtab.)
(Internal error: pc 0x6241a1 in read in psymtab, but not in symtab.)
(Internal error: pc 0x6241a0 in read in psymtab, but not in symtab.)
(Internal error: pc 0x6241a0 in read in psymtab, but not in symtab.)
Can someone give me a hand I am using QTCreator and QT 4.6.
Here is my header:
#ifndef PODCASTFEED_H
#define PODCASTFEED_H
#include <QObject>
#include <QString>
#include <QtNetwork>
#include <QHttp>
class PodcastFeed : public QObject
{
Q_OBJECT
public:
PodcastFeed();
int id;
QString title;
QString description;
QString url;
QString action;
int actionInt;
int sortOrder;
QString feedTitle;
QString feedDescription;
void Load();
void DownloadFeed(QString url);
void FeedReadData(const QHttpResponseHeader &resp);
void FeedRequestFinished( int id, bool error);
private:
bool completed;
int connectionId;
QHttp http;
QXmlStreamReader xml;
void ParseXml();
};
#endif // PODCASTFEED_H
and here is the function I am having difficulty with.
void PodcastFeed::DownloadFeed(QString url)
{
xml.clear();
QUrl myUrl(url);
http.setHost(myUrl.host());
Util::WriteLine("URL.Host = " + myUrl.host());
Util::WriteLine("URL.Path = " + myUrl.path());
QObject::connect(&http, SIGNAL(readyRead(const QHttpResponseHeader &)), this, SLOT(FeedReadData(const QHttpResponseHeader &)));
QObject::connect(&http, SIGNAL(requestFinished( int, bool)), this, SLOT(FeedRequestFinished( int, bool)));
connectionId = http.get(myUrl.path());
Util::WriteLine("ConnectionId = " + QString::number(connectionId));
// Proceeds to FeedReadData when read.
}
void PodcastFeed::FeedRequestFinished( int id, bool error)
{
Util::WriteLine("GotRequestFinished");
}
void PodcastFeed::FeedReadData(const QHttpResponseHeader &resp)
{
Util::WriteLine("FeedReadData");
if (resp.statusCode() != 200)
http.abort();
else {
xml.addData(http.readAll());
ParseXml();
}
}