命令行读取器同步范例

展示如何通过串行端口同步接收数据。

命令行读取器同步 展示如何使用 QSerialPort class for receiving data synchronously over the selected serial port with the desired settings.

This command line reader sync example receives data synchronously over the selected serial port in a console, provided by the QSerialPort 类。

For receiving data synchronously over the selected serial port, use the read() or readAll() ,和 waitForReadyRead() 方法。

运行范例

要运行范例从 Qt Creator ,打开 欢迎 模式,然后选择范例从 范例 。更多信息,拜访 构建和运行范例 .

范例工程 @ code.qt.io