summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-09-19 07:25:51 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-09-19 07:25:58 +0200
commitf602b8163fb61d260f331ae7cabba591bde85fb4 (patch)
tree148aa0c6e3203be2d7a4b56ae1771cb5566f2eac /examples
parentcb8cf3e7fd7a4ea39c25057c59888112e342ee66 (diff)
parent078483c9707b039c9480915eb92257c861acd017 (diff)
Merge remote-tracking branch 'origin/wip/qt6' into dev
Conflicts: .qmake.conf examples/serialport/cenumerator/main.cpp Change-Id: If1d733365bf6093537f5459485425525f69a3d26
Diffstat (limited to 'examples')
-rw-r--r--examples/serialport/cenumerator/main.cpp18
-rw-r--r--examples/serialport/creaderasync/main.cpp4
-rw-r--r--examples/serialport/creaderasync/serialportreader.cpp8
-rw-r--r--examples/serialport/creadersync/main.cpp12
-rw-r--r--examples/serialport/cwriterasync/main.cpp6
-rw-r--r--examples/serialport/cwriterasync/serialportwriter.cpp10
-rw-r--r--examples/serialport/cwritersync/main.cpp16
7 files changed, 37 insertions, 37 deletions
diff --git a/examples/serialport/cenumerator/main.cpp b/examples/serialport/cenumerator/main.cpp
index 902a7935..05a37154 100644
--- a/examples/serialport/cenumerator/main.cpp
+++ b/examples/serialport/cenumerator/main.cpp
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
QTextStream out(stdout);
const auto serialPortInfos = QSerialPortInfo::availablePorts();
- out << "Total number of ports available: " << serialPortInfos.count() << endl;
+ out << "Total number of ports available: " << serialPortInfos.count() << Qt::endl;
const QString blankString = "N/A";
QString description;
@@ -69,18 +69,18 @@ int main(int argc, char *argv[])
description = serialPortInfo.description();
manufacturer = serialPortInfo.manufacturer();
serialNumber = serialPortInfo.serialNumber();
- out << endl
- << "Port: " << serialPortInfo.portName() << endl
- << "Location: " << serialPortInfo.systemLocation() << endl
- << "Description: " << (!description.isEmpty() ? description : blankString) << endl
- << "Manufacturer: " << (!manufacturer.isEmpty() ? manufacturer : blankString) << endl
- << "Serial number: " << (!serialNumber.isEmpty() ? serialNumber : blankString) << endl
+ out << Qt::endl
+ << "Port: " << serialPortInfo.portName() << Qt::endl
+ << "Location: " << serialPortInfo.systemLocation() << Qt::endl
+ << "Description: " << (!description.isEmpty() ? description : blankString) << Qt::endl
+ << "Manufacturer: " << (!manufacturer.isEmpty() ? manufacturer : blankString) << Qt::endl
+ << "Serial number: " << (!serialNumber.isEmpty() ? serialNumber : blankString) << Qt::endl
<< "Vendor Identifier: " << (serialPortInfo.hasVendorIdentifier()
? QByteArray::number(serialPortInfo.vendorIdentifier(), 16)
- : blankString) << endl
+ : blankString) << Qt::endl
<< "Product Identifier: " << (serialPortInfo.hasProductIdentifier()
? QByteArray::number(serialPortInfo.productIdentifier(), 16)
- : blankString) << endl;
+ : blankString) << Qt::endl;
}
return 0;
diff --git a/examples/serialport/creaderasync/main.cpp b/examples/serialport/creaderasync/main.cpp
index 6c669ceb..5e98bde3 100644
--- a/examples/serialport/creaderasync/main.cpp
+++ b/examples/serialport/creaderasync/main.cpp
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
if (argumentCount == 1) {
standardOutput << QObject::tr("Usage: %1 <serialportname> [baudrate]")
.arg(argumentList.first())
- << endl;
+ << Qt::endl;
return 1;
}
@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
standardOutput << QObject::tr("Failed to open port %1, error: %2")
.arg(serialPortName)
.arg(serialPort.errorString())
- << endl;
+ << Qt::endl;
return 1;
}
diff --git a/examples/serialport/creaderasync/serialportreader.cpp b/examples/serialport/creaderasync/serialportreader.cpp
index a701839b..dd683d59 100644
--- a/examples/serialport/creaderasync/serialportreader.cpp
+++ b/examples/serialport/creaderasync/serialportreader.cpp
@@ -78,12 +78,12 @@ void SerialPortReader::handleTimeout()
m_standardOutput << QObject::tr("No data was currently available "
"for reading from port %1")
.arg(m_serialPort->portName())
- << endl;
+ << Qt::endl;
} else {
m_standardOutput << QObject::tr("Data successfully received from port %1")
.arg(m_serialPort->portName())
- << endl;
- m_standardOutput << m_readData << endl;
+ << Qt::endl;
+ m_standardOutput << m_readData << Qt::endl;
}
QCoreApplication::quit();
@@ -96,7 +96,7 @@ void SerialPortReader::handleError(QSerialPort::SerialPortError serialPortError)
"the data from port %1, error: %2")
.arg(m_serialPort->portName())
.arg(m_serialPort->errorString())
- << endl;
+ << Qt::endl;
QCoreApplication::exit(1);
}
}
diff --git a/examples/serialport/creadersync/main.cpp b/examples/serialport/creadersync/main.cpp
index 845a5fb2..7c7c1506 100644
--- a/examples/serialport/creadersync/main.cpp
+++ b/examples/serialport/creadersync/main.cpp
@@ -63,7 +63,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;
}
@@ -77,7 +77,7 @@ 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()) << Qt::endl;
return 1;
}
@@ -87,18 +87,18 @@ 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()) << Qt::endl;
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) << Qt::endl;
return 0;
}
standardOutput << QObject::tr("Data successfully received from port %1")
- .arg(serialPortName) << endl;
- standardOutput << readData << endl;
+ .arg(serialPortName) << Qt::endl;
+ standardOutput << readData << Qt::endl;
return 0;
}
diff --git a/examples/serialport/cwriterasync/main.cpp b/examples/serialport/cwriterasync/main.cpp
index 4d65e0a6..763b18a3 100644
--- a/examples/serialport/cwriterasync/main.cpp
+++ b/examples/serialport/cwriterasync/main.cpp
@@ -66,7 +66,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;
}
@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
QFile dataFile;
if (!dataFile.open(stdin, QIODevice::ReadOnly)) {
- standardOutput << QObject::tr("Failed to open stdin for reading") << endl;
+ standardOutput << QObject::tr("Failed to open stdin for reading") << Qt::endl;
return 1;
}
@@ -93,7 +93,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;
}
diff --git a/examples/serialport/cwriterasync/serialportwriter.cpp b/examples/serialport/cwriterasync/serialportwriter.cpp
index c2916bb2..489370eb 100644
--- a/examples/serialport/cwriterasync/serialportwriter.cpp
+++ b/examples/serialport/cwriterasync/serialportwriter.cpp
@@ -71,7 +71,7 @@ void SerialPortWriter::handleBytesWritten(qint64 bytes)
if (m_bytesWritten == m_writeData.size()) {
m_bytesWritten = 0;
m_standardOutput << QObject::tr("Data successfully sent to port %1")
- .arg(m_serialPort->portName()) << endl;
+ .arg(m_serialPort->portName()) << Qt::endl;
QCoreApplication::quit();
}
}
@@ -81,7 +81,7 @@ void SerialPortWriter::handleTimeout()
m_standardOutput << QObject::tr("Operation timed out for port %1, error: %2")
.arg(m_serialPort->portName())
.arg(m_serialPort->errorString())
- << endl;
+ << Qt::endl;
QCoreApplication::exit(1);
}
@@ -92,7 +92,7 @@ void SerialPortWriter::handleError(QSerialPort::SerialPortError serialPortError)
" the data to port %1, error: %2")
.arg(m_serialPort->portName())
.arg(m_serialPort->errorString())
- << endl;
+ << Qt::endl;
QCoreApplication::exit(1);
}
}
@@ -107,13 +107,13 @@ void SerialPortWriter::write(const QByteArray &writeData)
m_standardOutput << QObject::tr("Failed to write the data to port %1, error: %2")
.arg(m_serialPort->portName())
.arg(m_serialPort->errorString())
- << endl;
+ << Qt::endl;
QCoreApplication::exit(1);
} else if (bytesWritten != m_writeData.size()) {
m_standardOutput << QObject::tr("Failed to write all the data to port %1, error: %2")
.arg(m_serialPort->portName())
.arg(m_serialPort->errorString())
- << endl;
+ << Qt::endl;
QCoreApplication::exit(1);
}
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;
}