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/cenumerator/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/cenumerator/main.cpp')
-rw-r--r-- | examples/serialport/cenumerator/main.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/examples/serialport/cenumerator/main.cpp b/examples/serialport/cenumerator/main.cpp index 902a7935..344551e0 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() << "\n"; const QString blankString = "N/A"; QString description; @@ -69,18 +69,17 @@ 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 - << "Vendor Identifier: " << (serialPortInfo.hasVendorIdentifier() + out << "\nPort: " << serialPortInfo.portName() + << "\nLocation: " << serialPortInfo.systemLocation() + << "\nDescription: " << (!description.isEmpty() ? description : blankString) + << "\nManufacturer: " << (!manufacturer.isEmpty() ? manufacturer : blankString) + << "\nSerial number: " << (!serialNumber.isEmpty() ? serialNumber : blankString) + << "\nVendor Identifier: " << (serialPortInfo.hasVendorIdentifier() ? QByteArray::number(serialPortInfo.vendorIdentifier(), 16) - : blankString) << endl - << "Product Identifier: " << (serialPortInfo.hasProductIdentifier() + : blankString) + << "\nProduct Identifier: " << (serialPortInfo.hasProductIdentifier() ? QByteArray::number(serialPortInfo.productIdentifier(), 16) - : blankString) << endl; + : blankString) << "\n"; } return 0; |