I am having a small problem on using QNetworkAccessManager in QThread. The error message is: 'Object::connect: No such slot QThread::replyFinished(QNetworkrReply*)'
- Qt No Such Slot Qthread Money
- Qt No Such Slot Qthread Machine
- Qt No Such Slot Qthread Play
- Qt No Such Slot Qthread Time
- Qt Qthread Terminate
C, qt, qt4, qthread A signal can be emitted from any class object which inherits QObject. And that signal can be caught in any slot provided the signatures are compatible. You can just inherit QObject by your non-GUI class. Effective Threading Using Qt. The two other approaches are defined by Qt’s QThread documentation. 1) use a QObject worker. 2) subclass QThread and reimplement the run function. This is a type that can be used with Qt’s signals and slots as well as many other types such as QString. Detailed Description. The QThread class provides a platform-independent way to manage threads. A QThread object manages one thread of control within the program. QThreads begin executing in run. By default, run starts the event loop by calling exec and runs a Qt event loop inside the thread. You can use worker objects by moving them to the thread using QObject::moveToThread.
And my code is header
@
class SSLReceive : public QThread
{
//Q_OBJECT
public slots:
void replyFinished(QNetworkReply* net_reply);
Qt No Such Slot Qthread Money
protected:
void run();
private:
void initialize();
QNetworkAccessManager* manager;
QSslConfiguration config;
};
@
implement
@
void SSLReceive::replyFinished(QNetworkReply *net_reply)
{
QByteArray data = net_reply->readAll();
QString str(data);
}
void SSLReceive::run()
{
initialize();
Qt No Such Slot Qthread Machine
}
Qt No Such Slot Qthread Play
void SSLReceive::initialize()
{
manager = new QNetworkAccessManager;
config = QSslConfiguration::defaultConfiguration();
}
@
I definitly have 'replyFinished(QNetworkrReply*)' in my class which is derived by QThread. I dont know why this happens.. Should I put something else instead of 'this'?
Qt No Such Slot Qthread Time
What am I missing? Please help!
Qt Qthread Terminate
[Edit: added @ tags; mlong]