diff options
author | Andre Hartmann <aha_1980@gmx.de> | 2017-10-26 22:28:50 +0200 |
---|---|---|
committer | André Hartmann <aha_1980@gmx.de> | 2018-01-12 06:56:45 +0000 |
commit | 44a449ff8f0b7cdb71e67385e1bd9a098209045e (patch) | |
tree | 3860802a1afff79563970166f4739a6b187f265e /examples/serialbus/can/connectdialog.cpp | |
parent | df9735fc1660dd40730693f08f6e046a5e01deb3 (diff) |
Add more info to QCanBusDeviceInfo
Added description, serial number and channel for SocketCAN, PeakCAN,
SystecCAN, and VectorCAN plugins. For now, not all plugins do support
all kind of information:
SocketCAN: description and channel
PeakCAN: description and channel (Windows PCANBasic >= 4.2.0)
SystecCAN: description, serial number, and channel
VectorCAN: description, serial number, and channel
[ChangeLog][QCanBusDeviceInfo] Added description, serial number
and channel to QCanBusDeviceInfo, as far as supported by the
various plugins.
Change-Id: Ib2292e06065eb91848f682ebf69a4cc968f4d4ba
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples/serialbus/can/connectdialog.cpp')
-rw-r--r-- | examples/serialbus/can/connectdialog.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/serialbus/can/connectdialog.cpp b/examples/serialbus/can/connectdialog.cpp index 5a12592..601ef2c 100644 --- a/examples/serialbus/can/connectdialog.cpp +++ b/examples/serialbus/can/connectdialog.cpp @@ -115,6 +115,12 @@ void ConnectDialog::interfaceChanged(const QString &interface) for (const QCanBusDeviceInfo &info : qAsConst(m_interfaces)) { if (info.name() == interface) { + m_ui->descriptionLabel->setText(info.description()); + QString serialNumber = info.serialNumber(); + if (serialNumber.isEmpty()) + serialNumber = tr("n/a"); + m_ui->serialNumberLabel->setText(tr("Serial: %1").arg(serialNumber)); + m_ui->channelLabel->setText(tr("Channel: %1").arg(info.channel())); m_ui->isVirtual->setChecked(info.isVirtual()); m_ui->isFlexibleDataRateCapable->setChecked(info.hasFlexibleDataRate()); break; |