我正在尝试向我的 qthread 添加信号,但出现一些错误:
错误:未定义对“RFDongleCommunication 的 vtable”的引用
错误:未定义对“RFDongleCommunication::newLogger(unsigned char, unsigned char)”的引用
这是我的头文件:
#ifndef RFDONGLECOMMUNICATION_H
#define RFDONGLECOMMUNICATION_H
#include <QThread>
#include "qextserialport.h"
#include <QtGui>
class RFDongleCommunication: public QThread
{
Q_OBJECT
public:
explicit RFDongleCommunication(QextSerialPort * port);
QextSerialPort * rfport;
QByteArray data;
signals:
void newLogger(uchar,uchar);
private:
void run();
};
#endif // RFDONGLECOMMUNICATION_H
和cpp文件
#include "rfdonglecommunication.h"
#include "QDebug"
RFDongleCommunication::RFDongleCommunication(QextSerialPort * port)
{
rfport=port;
}
void RFDongleCommunication::run()
{
while(!(rfport->bytesAvailable()));
data = rfport->readAll();
uchar id = data[1];
uchar type = data[2];
emit newLogger(id,type);
}
有人看到我做错了吗?