summaryrefslogtreecommitdiffstats
path: root/examples/serialport/cenumerator
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2016-04-30 10:25:27 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2016-05-13 11:27:08 +0000
commit2ac9c0c0e6210f73884bbe2bcb3d8269519003a8 (patch)
treee6f9334060f66448d9dff69c723eab6871ff3485 /examples/serialport/cenumerator
parenta11fa1dfd529948da961d3d292926a15f9b7005b (diff)
Replace 'Q_FOREACH' with the range-based 'for'
Change-Id: I057267982ac946ce1ec863a79120cd21cd563c4b Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'examples/serialport/cenumerator')
-rw-r--r--examples/serialport/cenumerator/main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/serialport/cenumerator/main.cpp b/examples/serialport/cenumerator/main.cpp
index 7166b0b8..f8050219 100644
--- a/examples/serialport/cenumerator/main.cpp
+++ b/examples/serialport/cenumerator/main.cpp
@@ -58,16 +58,16 @@ int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QTextStream out(stdout);
- QList<QSerialPortInfo> serialPortInfoList = QSerialPortInfo::availablePorts();
+ const auto serialPortInfos = QSerialPortInfo::availablePorts();
- out << QObject::tr("Total number of ports available: ") << serialPortInfoList.count() << endl;
+ out << QObject::tr("Total number of ports available: ") << serialPortInfos.count() << endl;
const QString blankString = QObject::tr("N/A");
QString description;
QString manufacturer;
QString serialNumber;
- foreach (const QSerialPortInfo &serialPortInfo, serialPortInfoList) {
+ for (const QSerialPortInfo &serialPortInfo : serialPortInfos) {
description = serialPortInfo.description();
manufacturer = serialPortInfo.manufacturer();
serialNumber = serialPortInfo.serialNumber();