stevey
5th September 2009, 03:05
Hi,
I'm subclassing QHttp to a class called HttpSyncr.
I have the following slot declarations in HttpSyncr.h:
public slots:
void ReceiveResponseHeader(const QHttpResponseHeader& header);
void HttpRequestStarted(int id);
void HttpRequestFinished(int id, bool error);
This is how I'm connecting:
HttpSyncr::HttpSyncr(QObject *parent)
: QHttp(parent)
{
bool res = connect(this, SIGNAL(responseHeaderReceived(const QHttpResponseHeader&)), this, SLOT(ReceiveResponseHeader(const QHttpResponseHeader&)));
res = connect(this, SIGNAL(requestStarted(int)), this, SLOT(HttpRequestStarted(int)));
res = connect(this, SIGNAL(requestFinished(int, bool)), this, SLOT(HttpRequestFinished(int, bool)));
}
I figured that simply specifying 'this' as both source and target would be okay, but the slot is getting defined incorrectly. My debug output from the connect() function is:
Object::connect: No such slot QHttp::ReceiveResponseHeader(QHttpResponseHeader)
Object::connect: No such slot QHttp::HttpRequestStarted(int)
Object::connect: No such slot QHttp::HttpRequestFinished(int,bool)
Is there a way to force MOC to know that the slot is actually in HttpSyncr and not the base class?
Steve
I'm subclassing QHttp to a class called HttpSyncr.
I have the following slot declarations in HttpSyncr.h:
public slots:
void ReceiveResponseHeader(const QHttpResponseHeader& header);
void HttpRequestStarted(int id);
void HttpRequestFinished(int id, bool error);
This is how I'm connecting:
HttpSyncr::HttpSyncr(QObject *parent)
: QHttp(parent)
{
bool res = connect(this, SIGNAL(responseHeaderReceived(const QHttpResponseHeader&)), this, SLOT(ReceiveResponseHeader(const QHttpResponseHeader&)));
res = connect(this, SIGNAL(requestStarted(int)), this, SLOT(HttpRequestStarted(int)));
res = connect(this, SIGNAL(requestFinished(int, bool)), this, SLOT(HttpRequestFinished(int, bool)));
}
I figured that simply specifying 'this' as both source and target would be okay, but the slot is getting defined incorrectly. My debug output from the connect() function is:
Object::connect: No such slot QHttp::ReceiveResponseHeader(QHttpResponseHeader)
Object::connect: No such slot QHttp::HttpRequestStarted(int)
Object::connect: No such slot QHttp::HttpRequestFinished(int,bool)
Is there a way to force MOC to know that the slot is actually in HttpSyncr and not the base class?
Steve