summaryrefslogtreecommitdiffstats
path: root/examples/serialport/cwritersync/main.cpp
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-07-31 17:30:57 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-08-01 09:53:05 +0200
commitfc7d7799b279d2c1fc2019966604f04e36218470 (patch)
tree46e247bae48639b8110a7e08e1267524b2b4aeaf /examples/serialport/cwritersync/main.cpp
parent126809f150f03ab07b94bb508c89cea25440ac41 (diff)
Fix Qt6 build
Change-Id: I6fdfe8b21efe92ba97b7c833997432e670e5937c Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'examples/serialport/cwritersync/main.cpp')
-rw-r--r--examples/serialport/cwritersync/main.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/serialport/cwritersync/main.cpp b/examples/serialport/cwritersync/main.cpp
index 125c111c..9d4511a9 100644
--- a/examples/serialport/cwritersync/main.cpp
+++ b/examples/serialport/cwritersync/main.cpp
@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
if (argumentCount == 1) {
standardOutput << QObject::tr("Usage: %1 <serialportname> [baudrate]")
- .arg(argumentList.first()) << endl;
+ .arg(argumentList.first()) << Qt::endl;
return 1;
}
@@ -79,14 +79,14 @@ int main(int argc, char *argv[])
if (!serialPort.open(QIODevice::WriteOnly)) {
standardOutput << QObject::tr("Failed to open port %1, error: %2")
.arg(serialPortName).arg(serialPort.errorString())
- << endl;
+ << Qt::endl;
return 1;
}
QFile dataFile;
if (!dataFile.open(stdin, QIODevice::ReadOnly)) {
standardOutput << QObject::tr("Failed to open stdin for reading")
- << endl;
+ << Qt::endl;
return 1;
}
@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
standardOutput << QObject::tr("Either no data was currently available on "
"the standard input for reading, or an error "
"occurred for port %1, error: %2")
- .arg(serialPortName).arg(serialPort.errorString()) << endl;
+ .arg(serialPortName).arg(serialPort.errorString()) << Qt::endl;
return 1;
}
@@ -105,21 +105,21 @@ int main(int argc, char *argv[])
if (bytesWritten == -1) {
standardOutput << QObject::tr("Failed to write the data to port %1, error: %2")
- .arg(serialPortName).arg(serialPort.errorString()) << endl;
+ .arg(serialPortName).arg(serialPort.errorString()) << Qt::endl;
return 1;
} else if (bytesWritten != writeData.size()) {
standardOutput << QObject::tr("Failed to write all the data to port %1, error: %2")
- .arg(serialPortName).arg(serialPort.errorString()) << endl;
+ .arg(serialPortName).arg(serialPort.errorString()) << Qt::endl;
return 1;
} else if (!serialPort.waitForBytesWritten(5000)) {
standardOutput << QObject::tr("Operation timed out or an error "
"occurred for port %1, error: %2")
- .arg(serialPortName).arg(serialPort.errorString()) << endl;
+ .arg(serialPortName).arg(serialPort.errorString()) << Qt::endl;
return 1;
}
standardOutput << QObject::tr("Data successfully sent to port %1")
- .arg(serialPortName) << endl;
+ .arg(serialPortName) << Qt::endl;
return 0;
}