I want to create SerialPort
class,
and it can receive msg automatic and then emit a signal.
but when I compile it show the error message:
error: 'QObject' is an ambiguous base of 'SerialPort' QObject::connect(&uartObj, SIGNAL(readDone(QByteArray)), this, SLOT(hdlRxDone(QByteArray)));
have someone can help me to solve it ? thanks.
#ifndef SERIALPORT_H
#define SERIALPORT_H
#include <QObject>
#include <QSerialPort>
#include <QThread>
class SerialPort : public QSerialPort, public QThread
{
Q_OBJECT
public:
explicit SerialPort(QObject *parent = 0);
~SerialPort();
void stop();
signals:
void readDone(QByteArray data);
public slots:
private:
void run();
};
#endif // SERIALPORT_H