Hello, I got the following problem.
{
public:
mythread();
void run();
public slots:
void processpacket();
private:
};
class mythread : public QThread
{
public:
mythread();
void run();
public slots:
void processpacket();
private:
QTcpServer *tcpServer;
};
To copy to clipboard, switch view to plain text mode
inside mythread::run I have this
connect(tcpServer, SIGNAL(newConnection()), this, SLOT(processpacket()));
connect(tcpServer, SIGNAL(newConnection()), this, SLOT(processpacket()));
To copy to clipboard, switch view to plain text mode
everything compiles and builds but when I run it I get a
Object
::connect: No such
slot QThread::processpacket().
Object::connect: No such slot QThread::processpacket().
To copy to clipboard, switch view to plain text mode
and if I add Q_OBJECT as follows:
class mythread : public Qthread
{
Q_OBJECT
public:
mythread();
void run();
public slots:
void processpacket();
private:
};
class mythread : public Qthread
{
Q_OBJECT
public:
mythread();
void run();
public slots:
void processpacket();
private:
QTcpServer *tcpServer;
};
To copy to clipboard, switch view to plain text mode
I get the following error when compiling.:
undefined reference to 'vtable for mythread'
Any help in solving this issues is appreciated. Thanks in advanced
Bookmarks