This is usual question, but I can't make it work.
This is prototype of function:
void QSerialPort::setPort(const QSerialPortInfo &serialPortInfo)
QSerialPortInfo *serialPortInfo = new QSerialPortInfo("H");
QSerialPort *SerialPort=new QSerialPort;
QSerialPortInfo should not be dynamically allocated (this is not really QT-way, I know).
In your case it should be
SerialPort->setPort(*serialPortInfo) since you need to dereference your pointer to pass variable by reference.
But this code should be written like here:
QSerialPortInfo serialPortInfo("COM1"); QSerialPort* SerialPort = new QSerialPort; SerialPort->setPort(serialPortInfo);