Fixed serial port code for Qt5.