From fc7d7799b279d2c1fc2019966604f04e36218470 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 31 Jul 2019 17:30:57 +0200 Subject: Fix Qt6 build Change-Id: I6fdfe8b21efe92ba97b7c833997432e670e5937c Reviewed-by: Denis Shienkov --- examples/serialport/cenumerator/main.cpp | 20 ++++++++++---------- examples/serialport/creaderasync/main.cpp | 4 ++-- .../serialport/creaderasync/serialportreader.cpp | 8 ++++---- examples/serialport/creadersync/main.cpp | 12 ++++++------ examples/serialport/cwriterasync/main.cpp | 6 +++--- .../serialport/cwriterasync/serialportwriter.cpp | 10 +++++----- examples/serialport/cwritersync/main.cpp | 16 ++++++++-------- 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/examples/serialport/cenumerator/main.cpp b/examples/serialport/cenumerator/main.cpp index af6d7e4..5e1b645 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,19 +69,19 @@ 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 - << "Busy: " << (serialPortInfo.isBusy() ? "Yes" : "No") << endl; + : blankString) << Qt::endl + << "Busy: " << (serialPortInfo.isBusy() ? "Yes" : "No") << Qt::endl; } return 0; diff --git a/examples/serialport/creaderasync/main.cpp b/examples/serialport/creaderasync/main.cpp index 6c669ce..5e98bde 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 [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 a701839..dd683d5 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 845a5fb..7c7c150 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 [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 4d65e0a..763b18a 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 [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 c2916bb..489370e 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 125c111..9d4511a 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 [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; } -- cgit v1.2.1