QCanBusFactoryV2 类

QCanBusFactoryV2 类是用作 CAN Bus 插件的插件接口的工厂类。 更多...

头: #include <QCanBusFactoryV2>
qmake: QT += serialbus
Since: Qt 5.9
继承: QCanBusFactory

该类在 Qt 5.9 引入。

公共函数

virtual QList<QCanBusDeviceInfo> availableDevices (QString * errorMessage ) const = 0

重实现公共函数

virtual QCanBusDevice * createDevice (const QString & interfaceName , QString * errorMessage ) const override = 0

详细描述

所有插件必须实现此工厂类提供的函数。

成员函数文档编制

[pure virtual] QList < QCanBusDeviceInfo > QCanBusFactoryV2:: availableDevices ( QString * errorMessage ) const

Returns the list of available devices and their capabilities for the QCanBusDevice .

errorMessage contains an error description in case of failure.

[override pure virtual] QCanBusDevice *QCanBusFactoryV2:: createDevice (const QString & interfaceName , QString * errorMessage ) const

重实现: QCanBusFactory::createDevice (const QString &interfaceName, QString *errorMessage) const.

创建新的 QCanBusDevice . The caller must take ownership of the returned pointer.

interfaceName is the CAN interface name and errorMessage contains an error description in case of failure.

若工厂无法创建插件,返回 nullptr .