diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2016-04-30 10:25:27 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2016-05-13 11:27:08 +0000 |
commit | 2ac9c0c0e6210f73884bbe2bcb3d8269519003a8 (patch) | |
tree | e6f9334060f66448d9dff69c723eab6871ff3485 /examples/serialport/enumerator | |
parent | a11fa1dfd529948da961d3d292926a15f9b7005b (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/enumerator')
-rw-r--r-- | examples/serialport/enumerator/main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/serialport/enumerator/main.cpp b/examples/serialport/enumerator/main.cpp index a997bf52..fa925daf 100644 --- a/examples/serialport/enumerator/main.cpp +++ b/examples/serialport/enumerator/main.cpp @@ -64,7 +64,8 @@ int main(int argc, char *argv[]) QVBoxLayout *layout = new QVBoxLayout; - foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) { + const auto infos = QSerialPortInfo::availablePorts(); + for (const QSerialPortInfo &info : infos) { QString s = QObject::tr("Port: ") + info.portName() + "\n" + QObject::tr("Location: ") + info.systemLocation() + "\n" + QObject::tr("Description: ") + info.description() + "\n" |