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>
{
Q_OBJECT
public:
ciao();
~ciao();
void Run();
void tryFinished( int id, bool error );
void tryReadProgress( int id, int total );
private:
};
#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;
};
To copy to clipboard, switch view to plain text mode
And here is what I'm doing in my constructor
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)));
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)));
To copy to clipboard, switch view to plain text mode
But... result is alway false. It sounds like connect does not recognize my methods to be valid.
Where I'm doing wrong???????
Bookmarks