summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/serialport/terminal/settingsdialog.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/serialport/terminal/settingsdialog.cpp b/examples/serialport/terminal/settingsdialog.cpp
index 7b278bb..978e15b 100644
--- a/examples/serialport/terminal/settingsdialog.cpp
+++ b/examples/serialport/terminal/settingsdialog.cpp
@@ -88,9 +88,10 @@ void SettingsDialog::showPortInfo(int idx)
QStringList list = ui->serialPortInfoListBox->itemData(idx).toStringList();
ui->descriptionLabel->setText(tr("Description: %1").arg(list.at(1)));
ui->manufacturerLabel->setText(tr("Manufacturer: %1").arg(list.at(2)));
- ui->locationLabel->setText(tr("Location: %1").arg(list.at(3)));
- ui->vidLabel->setText(tr("Vendor Identifier: %1").arg(list.at(4)));
- ui->pidLabel->setText(tr("Product Identifier: %1").arg(list.at(5)));
+ ui->serialNumberLabel->setText(tr("Serial number: %1").arg(list.at(3)));
+ ui->locationLabel->setText(tr("Location: %1").arg(list.at(4)));
+ ui->vidLabel->setText(tr("Vendor Identifier: %1").arg(list.at(5)));
+ ui->pidLabel->setText(tr("Product Identifier: %1").arg(list.at(6)));
}
}
@@ -148,13 +149,16 @@ void SettingsDialog::fillPortsInfo()
static const QString blankString = QObject::tr("N/A");
QString description;
QString manufacturer;
+ QString serialNumber;
foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) {
QStringList list;
description = info.description();
manufacturer = info.manufacturer();
+ serialNumber = info.serialNumber();
list << info.portName()
<< (!description.isEmpty() ? description : blankString)
<< (!manufacturer.isEmpty() ? manufacturer : blankString)
+ << (!serialNumber.isEmpty() ? serialNumber : blankString)
<< info.systemLocation()
<< (info.vendorIdentifier() ? QString::number(info.vendorIdentifier(), 16) : blankString)
<< (info.productIdentifier() ? QString::number(info.productIdentifier(), 16) : blankString);