JoZCaVaLLo
31st July 2009, 08:32
Hi Volks,
I'm trying to connect some http signals... obviously, as all good newbies, it doesn't work...
Here is my class declaration
#include <Qt/qfile.h>
#include <QtNetwork/QHttp>
class ciao : public QObject
{
Q_OBJECT
public:
ciao();
~ciao();
void Run();
void tryFinished( int id, bool error );
void tryReadProgress( int id, int total );
private:
QFile myFile;
QHttp *http;
};
And here is what I'm doing in my constructor
http = new QHttp(this);
myFile.setFileName("something.txt");
bool result;
result = connect(http, SIGNAL(requestFinished(int, bool)),
this, SLOT(tryFinished(int, bool)));
result = connect(http, SIGNAL(dataReadProgress(int, int)),
this, SLOT(tryReadProgress(int, int)));
But... result is alway false. It sounds like connect does not recognize my methods to be valid.
Where I'm doing wrong???????
I'm trying to connect some http signals... obviously, as all good newbies, it doesn't work...
Here is my class declaration
#include <Qt/qfile.h>
#include <QtNetwork/QHttp>
class ciao : public QObject
{
Q_OBJECT
public:
ciao();
~ciao();
void Run();
void tryFinished( int id, bool error );
void tryReadProgress( int id, int total );
private:
QFile myFile;
QHttp *http;
};
And here is what I'm doing in my constructor
http = new QHttp(this);
myFile.setFileName("something.txt");
bool result;
result = connect(http, SIGNAL(requestFinished(int, bool)),
this, SLOT(tryFinished(int, bool)));
result = connect(http, SIGNAL(dataReadProgress(int, int)),
this, SLOT(tryReadProgress(int, int)));
But... result is alway false. It sounds like connect does not recognize my methods to be valid.
Where I'm doing wrong???????