diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/cenumerator/main.cpp | 4 | ||||
-rw-r--r-- | examples/enumerator/main.cpp | 4 | ||||
-rw-r--r-- | examples/terminal/settingsdialog.cpp | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/examples/cenumerator/main.cpp b/examples/cenumerator/main.cpp index 3ae7d65e..f55b92d9 100644 --- a/examples/cenumerator/main.cpp +++ b/examples/cenumerator/main.cpp @@ -59,8 +59,8 @@ int main(int argc, char *argv[]) << QObject::tr("Location: ") << serialPortInfo.systemLocation() << endl << QObject::tr("Description: ") << serialPortInfo.description() << endl << QObject::tr("Manufacturer: ") << serialPortInfo.manufacturer() << endl - << QObject::tr("Vendor Identifier: ") << QByteArray::number(serialPortInfo.vendorIdentifier(), 16) << endl - << QObject::tr("Product Identifier: ") << QByteArray::number(serialPortInfo.productIdentifier(), 16) << endl + << QObject::tr("Vendor Identifier: ") << (serialPortInfo.hasVendorIdentifier() ? QByteArray::number(serialPortInfo.vendorIdentifier(), 16) : QByteArray()) << endl + << QObject::tr("Product Identifier: ") << (serialPortInfo.hasProductIdentifier() ? QByteArray::number(serialPortInfo.productIdentifier(), 16) : QByteArray()) << endl << QObject::tr("Busy: ") << (serialPortInfo.isBusy() ? QObject::tr("Yes") : QObject::tr("No")) << endl; } diff --git a/examples/enumerator/main.cpp b/examples/enumerator/main.cpp index a95ee76e..9e34d38c 100644 --- a/examples/enumerator/main.cpp +++ b/examples/enumerator/main.cpp @@ -61,8 +61,8 @@ int main(int argc, char *argv[]) + QObject::tr("Location: ") + info.systemLocation() + "\n" + QObject::tr("Description: ") + info.description() + "\n" + QObject::tr("Manufacturer: ") + info.manufacturer() + "\n" - + QObject::tr("Vendor Identifier: ") + QString::number(info.vendorIdentifier(), 16) + "\n" - + QObject::tr("Product Identifier: ") + QString::number(info.productIdentifier(), 16) + "\n" + + QObject::tr("Vendor Identifier: ") + (info.hasVendorIdentifier() ? QString::number(info.vendorIdentifier(), 16) : QString()) + "\n" + + QObject::tr("Product Identifier: ") + (info.hasProductIdentifier() ?QString::number(info.productIdentifier(), 16) : QString()) + "\n" + QObject::tr("Busy: ") + (info.isBusy() ? QObject::tr("Yes") : QObject::tr("No")) + "\n"; QLabel *label = new QLabel(s); diff --git a/examples/terminal/settingsdialog.cpp b/examples/terminal/settingsdialog.cpp index 4533da9e..65f6b87c 100644 --- a/examples/terminal/settingsdialog.cpp +++ b/examples/terminal/settingsdialog.cpp @@ -157,8 +157,8 @@ void SettingsDialog::fillPortsInfo() << info.description() << info.manufacturer() << info.systemLocation() - << QString::number(info.vendorIdentifier(), 16) - << QString::number(info.productIdentifier(), 16); + << (info.vendorIdentifier() ? QString::number(info.vendorIdentifier(), 16) : QString()) + << (info.productIdentifier() ? QString::number(info.productIdentifier(), 16) : QString()); ui->serialPortInfoListBox->addItem(list.first(), list); } |