Qt5.7已经封装了关于串口操作的类QSerialPort,QSerialPortInfo等,不需要再使用第三方串口类。串口应用程序的开发,包括查找串口,打开串口,发送数据,读取数据等。
界面如下:
先看看类QSerialPortInfo, Qt的解释如下:
Provides information about existing serial ports.
Use the static functions to generate a list of QSerialPortInfo objects. Each QSerialPortInfo object in the list represents a single serial port and can be queried for the port name, system location, description, and manufacturer. The QSerialPortInfo class can also be used as an input parameter for the setPort() method of the QSerialPort class.
提供现有的串行端口的信息。