summaryrefslogtreecommitdiffstats
path: root/examples/serialport/creadersync/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/serialport/creadersync/main.cpp')
-rw-r--r--examples/serialport/creadersync/main.cpp16
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;
}