I want to add some functionality to the serialport class and therefore want to inherit it and add som functions. However, I got problems. I put the class in a header file like this:
class mySerialport : public QSerialPort
{
public:
void mySerialport(): QSerialPort(QObject*)
{
}
};
I'm modifying the Terminal example: http://qt-project.org/doc/qt-5.1/qtserialport/terminal-mainwindow-cpp.html
Here a serialport object is created in the MainWindow constructor by
serial = new QSerialPort(this);
However, after declaring mySerialport and trying
serial = new MySerialport(this);
I get nothing but a myriad of error messages regarding the constructor.
Questions:
1. What could the error be? I guess it's basic.
2. Why is the serialport ineheriting the MainWindow? Is it the Qt thing that the serialport than will be deleted when the MainWindow destructor is called?