summaryrefslogtreecommitdiff
path: root/examples/serialport/master/dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/serialport/master/dialog.cpp')
-rw-r--r--examples/serialport/master/dialog.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/serialport/master/dialog.cpp b/examples/serialport/master/dialog.cpp
index 2c92404..4bed08b 100644
--- a/examples/serialport/master/dialog.cpp
+++ b/examples/serialport/master/dialog.cpp
@@ -74,13 +74,14 @@ Dialog::Dialog(QWidget *parent)
, statusLabel(new QLabel(tr("Status: Not running.")))
, runButton(new QPushButton(tr("Start")))
{
- foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
+ const auto infos = QSerialPortInfo::availablePorts();
+ for (const QSerialPortInfo &info : infos)
serialPortComboBox->addItem(info.portName());
waitResponseSpinBox->setRange(0, 10000);
waitResponseSpinBox->setValue(100);
- QGridLayout *mainLayout = new QGridLayout;
+ auto mainLayout = new QGridLayout;
mainLayout->addWidget(serialPortLabel, 0, 0);
mainLayout->addWidget(serialPortComboBox, 0, 1);
mainLayout->addWidget(waitResponseLabel, 1, 0);