diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-03-30 15:01:44 +0200 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2020-04-06 10:32:07 +0200 |
commit | ff3fd7b0330cb76772066ce7162320f4dc1a5c28 (patch) | |
tree | 7fe2f0d11e600a6d0e7d375a781c30e7e7c30045 /examples/serialport/creadersync/main.cpp | |
parent | b30052fa41f6332f20ec440dcdbcd06b41a954f5 (diff) |
Remove deprecated QTextStream operators from examplesv5.15.0-beta4
Use '\n' instead.
Task-number: QTBUG-82532
Change-Id: I97aec4076bd46f23644099158f346a6ca32a4a0e
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'examples/serialport/creadersync/main.cpp')
-rw-r--r-- | examples/serialport/creadersync/main.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/examples/serialport/creadersync/main.cpp b/examples/serialport/creadersync/main.cpp index 845a5fb2..863ae014 100644 --- a/examples/serialport/creadersync/main.cpp +++ b/examples/serialport/creadersync/main.cpp @@ -63,7 +63,8 @@ int main(int argc, char *argv[]) if (argumentCount == 1) { standardOutput << QObject::tr("Usage: %1 <serialportname> [baudrate]") - .arg(argumentList.first()) << endl; + .arg(argumentList.first()) + << "\n"; return 1; } @@ -77,7 +78,8 @@ int main(int argc, char *argv[]) if (!serialPort.open(QIODevice::ReadOnly)) { standardOutput << QObject::tr("Failed to open port %1, error: %2") - .arg(serialPortName).arg(serialPort.error()) << endl; + .arg(serialPortName).arg(serialPort.error()) + << "\n"; return 1; } @@ -87,18 +89,20 @@ int main(int argc, char *argv[]) if (serialPort.error() == QSerialPort::ReadError) { standardOutput << QObject::tr("Failed to read from port %1, error: %2") - .arg(serialPortName).arg(serialPort.errorString()) << endl; + .arg(serialPortName).arg(serialPort.errorString()) + << "\n"; return 1; } else if (serialPort.error() == QSerialPort::TimeoutError && readData.isEmpty()) { standardOutput << QObject::tr("No data was currently available" " for reading from port %1") - .arg(serialPortName) << endl; + .arg(serialPortName) + << "\n"; return 0; } standardOutput << QObject::tr("Data successfully received from port %1") - .arg(serialPortName) << endl; - standardOutput << readData << endl; + .arg(serialPortName); + standardOutput << "\n" << readData << "\n"; return 0; } |